Documentation
¶
Overview ¶
Package cloud_scheduler manages Cloud Scheduler jobs over the REST API.
Only the HTTP target is modelled. The API also schedules App Engine requests and Pub/Sub messages; nothing here uses either, and a type for something no caller sends is a type nobody checks.
A job's identity is its full resource name, projects/P/locations/L/jobs/J. Create takes the parent and the id separately because that is how the API takes them; everything else takes the name Create returned.
Index ¶
- Constants
- func Parent(project string, location string) (string, error)
- type Client
- func (client *Client) CreateJob(ctx context.Context, parent string, jobId string, newJob *job.Job, ...) (*job.Job, error)
- func (client *Client) DeleteJob(ctx context.Context, name string, options ...fetch_config.Option) error
- func (client *Client) GetJob(ctx context.Context, name string, options ...fetch_config.Option) (*job.Job, error)
- func (client *Client) ListJobs(ctx context.Context, parent string, options ...fetch_config.Option) ([]*job.Job, error)
- func (client *Client) PatchJob(ctx context.Context, name string, updated *job.Job, updateMask []string, ...) (*job.Job, error)
- func (client *Client) PauseJob(ctx context.Context, name string, options ...fetch_config.Option) (*job.Job, error)
- func (client *Client) ResumeJob(ctx context.Context, name string, options ...fetch_config.Option) (*job.Job, error)
- func (client *Client) RunJob(ctx context.Context, name string, options ...fetch_config.Option) (*job.Job, error)
Constants ¶
const Domain = "cloudscheduler.googleapis.com"
const Scope = "https://www.googleapis.com/auth/cloud-scheduler"
Scope is the OAuth scope a token must carry to manage jobs. The broader cloud-platform scope also works and is what a Cloud Run runtime identity usually has.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ...cloud_scheduler_config.Option) *Client
func (*Client) CreateJob ¶
func (client *Client) CreateJob( ctx context.Context, parent string, jobId string, newJob *job.Job, options ...fetch_config.Option, ) (*job.Job, error)
CreateJob creates a job under parent with the id given, and returns it as the server recorded it -- with its full name, which is what every other call addresses it by.
func (*Client) DeleteJob ¶
func (client *Client) DeleteJob(ctx context.Context, name string, options ...fetch_config.Option) error
DeleteJob removes a job.
func (*Client) GetJob ¶
func (client *Client) GetJob( ctx context.Context, name string, options ...fetch_config.Option, ) (*job.Job, error)
GetJob reads one job by its full resource name.
func (*Client) ListJobs ¶
func (client *Client) ListJobs( ctx context.Context, parent string, options ...fetch_config.Option, ) ([]*job.Job, error)
ListJobs reads every job under parent, following the pages until there are none left.
The caller gets the whole list rather than a page and a token: a location holds the schedules of one deployment, which is tens of jobs rather than thousands, and every caller here wants all of them.
func (*Client) PatchJob ¶
func (client *Client) PatchJob( ctx context.Context, name string, updated *job.Job, updateMask []string, options ...fetch_config.Option, ) (*job.Job, error)
PatchJob updates the fields named in updateMask and leaves the rest alone.
The mask is required rather than optional: patching without one replaces the whole job with what was sent, so a caller that meant to change a schedule would silently drop its target.
func (*Client) PauseJob ¶
func (client *Client) PauseJob(ctx context.Context, name string, options ...fetch_config.Option) (*job.Job, error)
PauseJob stops a job running until it is resumed.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cloud_scheduler_config holds the settings of a Cloud Scheduler client.
|
Package cloud_scheduler_config holds the settings of a Cloud Scheduler client. |
|
types
|
|