// SchedDelete cloud backup schedule
542374
func (s *CloudBackupServer) SchedDelete(
	ctx context.Context,
	req *api.SdkCloudBackupSchedDeleteRequest,
) (*api.SdkCloudBackupSchedDeleteResponse, error) {
	if s.driver(ctx) == nil {
		return nil, status.Error(codes.Unavailable, "Resource has not been initialized")
	}

	// TODO
	// XXX inspect from uuid and get volume id

	if len(req.GetBackupScheduleId()) == 0 {
		return nil, status.Error(codes.InvalidArgument, "Must provide volumeId")
	}

	// Call cloud backup driver function to delete cloud schedule
	if err := s.driver(ctx).CloudBackupSchedDelete(&api.CloudBackupSchedDeleteRequest{
		UUID: req.GetBackupScheduleId(),
	}); err != nil {
		return nil, status.Errorf(codes.Internal, "Failed to delete cloud backup schedule: %v", err)
	}

	return &api.SdkCloudBackupSchedDeleteResponse{}, nil
}
511646
func (c *Client) BackupGetSchedule(id string) (*BackupScheduleResponse, error) {
	var bsr = &BackupScheduleResponse{}
	values := url.Values{
		"SUBID": {id},
	}
	if err := c.post(`server/backup_get_schedule`, values, &bsr); err != nil {
		return nil, err
	}
	return bsr, nil
}
572032
func removePendingVolumeAttachment(ctx *context, id params.MachineStorageId) {
	delete(ctx.incompleteVolumeAttachmentParams, id)
	ctx.schedule.Remove(id)
}
1002411
func (p *propInstance) MaintenanceScheduled() bool {
	if p.Instance == nil {
		return false
	}
	return p.Instance.MaintenanceScheduled()
}
192092
func (js *JobsService) ListScheduled(ctx context.Context) (jobs []*JobSchedule, resp *APIResponse, err error) {
	j := &JobScheduleResponse{}
	_, resp, err = js.client.getAction(ctx, &APIClientRequest{
		Path:         "jobs/scheduled.xml",
		ResponseBody: j,
		ResponseType: responseTypeXML,
	})
	jobs = j.Jobs

	return
}
1086830
func listScheduledJobsCommand() *cli.Command {
	return &cli.Command{
		Name:     ListScheduledJobsCommandName,
		Usage:    ListScheduledJobsCommandUsage,
		Action:   ActionWrapper(listScheduledJobsAction),
		Category: "Jobs",
	}
}
3521
func (c *Client) ScheduleAppGarbageCollection(appID string) error {
	return c.Post(fmt.Sprintf("/apps/%s/gc", appID), nil, nil)
}
1069153
func (c *Core) scheduleUpgradeCleanup(ctx context.Context) error {
	// List the upgrades
	upgrades, err := c.barrier.List(ctx, keyringUpgradePrefix)
	if err != nil {
		return errwrap.Wrapf("failed to list upgrades: {{err}}", err)
	}

	// Nothing to do if no upgrades
	if len(upgrades) == 0 {
		return nil
	}

	// Schedule cleanup for all of them
	time.AfterFunc(keyRotateGracePeriod, func() {
		sealed, err := c.barrier.Sealed()
		if err != nil {
			c.logger.Warn("failed to check barrier status at upgrade cleanup time")
			return
		}
		if sealed {
			c.logger.Warn("barrier sealed at upgrade cleanup time")
			return
		}
		for _, upgrade := range upgrades {
			path := fmt.Sprintf("%s%s", keyringUpgradePrefix, upgrade)
			if err := c.barrier.Delete(ctx, path); err != nil {
				c.logger.Error("failed to cleanup upgrade", "path", path, "error", err)
			}
		}
	})
	return nil
}
946641
func (c *ClusterManager) SchedPolicyUpdate(name, sched string) error {
	return c.schedManager.SchedPolicyUpdate(name, sched)
}
13616
func (m *MockVolumeDriver) CloudBackupDeleteAll(arg0 *api.CloudBackupDeleteAllRequest) error {
	ret := m.ctrl.Call(m, "CloudBackupDeleteAll", arg0)
	ret0, _ := ret[0].(error)
	return ret0
}
501423
func (c *clusterClient) SchedPolicyCreate(name, schedule string) error {
	request := &sched.SchedPolicy{
		Name:     name,
		Schedule: schedule,
	}

	req := c.c.Post().Resource(clusterPath + SchedPath).Body(request)
	res := req.Do()
	if res.Error() != nil {
		return res.FormatError()
	}

	return nil
}
1221816
func (w *Worker) ScheduleList() (schedules []ScheduleInfo, err error) {
	out := map[string][]ScheduleInfo{}
	err = w.schedules().Req("GET", nil, &out)
	if err != nil {
		return
	}
	return out["schedules"], nil
}
1037720
func (c *ClusterManager) SchedPolicyCreate(name, sched string) error {
	return c.schedManager.SchedPolicyCreate(name, sched)
}
149453
func (c *ClusterManager) SchedPolicyDelete(name string) error {
	return c.schedManager.SchedPolicyDelete(name)
}
814515
func (d *CacheDumper) dumpSchedulingQueue() {
	pendingPods := d.podQueue.PendingPods()
	var podData strings.Builder
	for _, p := range pendingPods {
		podData.WriteString(printPod(p))
	}
	klog.Infof("Dump of scheduling queue:\n%s", podData.String())
}
793313
func (c *Client) BackupSetSchedule(id string, bs BackupSchedule) error {
	values := url.Values{
		"SUBID":     {id},
		"cron_type": {bs.CronType},
		"hour":      {string(bs.Hour)},
		"dow":       {string(bs.Dow)},
		"dom":       {string(bs.Dom)},
	}
	return c.post(`server/backup_set_schedule`, values, nil)
}
700179
func (util *AWSDiskUtil) DeleteVolume(d *awsElasticBlockStoreDeleter) error {
	cloud, err := getCloudProvider(d.awsElasticBlockStore.plugin.host.GetCloudProvider())
	if err != nil {
		return err
	}

	deleted, err := cloud.DeleteDisk(d.volumeID)
	if err != nil {
		// AWS cloud provider returns volume.deletedVolumeInUseError when
		// necessary, no handling needed here.
		klog.V(2).Infof("Error deleting EBS Disk volume %s: %v", d.volumeID, err)
		return err
	}
	if deleted {
		klog.V(2).Infof("Successfully deleted EBS Disk volume %s", d.volumeID)
	} else {
		klog.V(2).Infof("Successfully deleted EBS Disk volume %s (actually already deleted)", d.volumeID)
	}
	return nil
}