Documentation
¶
Overview ¶
Package jobs provides methods and message types of the jobs v1alpha1 API.
Index ¶
- Constants
- type API
- func (s *API) CreateJobDefinition(req *CreateJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
- func (s *API) CreateJobDefinitionSecrets(req *CreateJobDefinitionSecretsRequest, opts ...scw.RequestOption) (*CreateJobDefinitionSecretsResponse, error)
- func (s *API) DeleteJobDefinition(req *DeleteJobDefinitionRequest, opts ...scw.RequestOption) error
- func (s *API) DeleteJobDefinitionSecret(req *DeleteJobDefinitionSecretRequest, opts ...scw.RequestOption) error
- func (s *API) GetJobDefinition(req *GetJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
- func (s *API) GetJobDefinitionSecret(req *GetJobDefinitionSecretRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) GetJobRun(req *GetJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
- func (s *API) GetJobsLimits(req *GetJobsLimitsRequest, opts ...scw.RequestOption) (*JobsLimits, error)
- func (s *API) ListJobDefinitionSecrets(req *ListJobDefinitionSecretsRequest, opts ...scw.RequestOption) (*ListJobDefinitionSecretsResponse, error)
- func (s *API) ListJobDefinitions(req *ListJobDefinitionsRequest, opts ...scw.RequestOption) (*ListJobDefinitionsResponse, error)
- func (s *API) ListJobRuns(req *ListJobRunsRequest, opts ...scw.RequestOption) (*ListJobRunsResponse, error)
- func (s *API) ListJobsResources(req *ListJobsResourcesRequest, opts ...scw.RequestOption) (*ListJobsResourcesResponse, error)
- func (s *API) Regions() []scw.Region
- func (s *API) StartJobDefinition(req *StartJobDefinitionRequest, opts ...scw.RequestOption) (*StartJobDefinitionResponse, error)
- func (s *API) StopJobRun(req *StopJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
- func (s *API) UpdateJobDefinition(req *UpdateJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
- func (s *API) UpdateJobDefinitionSecret(req *UpdateJobDefinitionSecretRequest, opts ...scw.RequestOption) (*Secret, error)
- func (s *API) WaitForJobRun(req *WaitForJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
- type CreateJobDefinitionRequest
- type CreateJobDefinitionRequestCronScheduleConfig
- type CreateJobDefinitionSecretsRequest
- type CreateJobDefinitionSecretsRequestSecretConfig
- type CreateJobDefinitionSecretsResponse
- type CronSchedule
- type DeleteJobDefinitionRequest
- type DeleteJobDefinitionSecretRequest
- type GetJobDefinitionRequest
- type GetJobDefinitionSecretRequest
- type GetJobRunRequest
- type GetJobsLimitsRequest
- type JobDefinition
- type JobRun
- type JobRunState
- type JobsLimits
- type ListJobDefinitionSecretsRequest
- type ListJobDefinitionSecretsResponse
- type ListJobDefinitionsRequest
- type ListJobDefinitionsRequestOrderBy
- func (enum ListJobDefinitionsRequestOrderBy) MarshalJSON() ([]byte, error)
- func (enum ListJobDefinitionsRequestOrderBy) String() string
- func (enum *ListJobDefinitionsRequestOrderBy) UnmarshalJSON(data []byte) error
- func (enum ListJobDefinitionsRequestOrderBy) Values() []ListJobDefinitionsRequestOrderBy
- type ListJobDefinitionsResponse
- type ListJobRunsRequest
- type ListJobRunsRequestOrderBy
- type ListJobRunsResponse
- type ListJobsResourcesRequest
- type ListJobsResourcesResponse
- type Resource
- type Secret
- type SecretEnvVar
- type SecretFile
- type StartJobDefinitionRequest
- type StartJobDefinitionResponse
- type StopJobRunRequest
- type UpdateJobDefinitionRequest
- type UpdateJobDefinitionRequestCronScheduleConfig
- type UpdateJobDefinitionSecretRequest
- type WaitForJobRunRequest
Constants ¶
const ( JobRunStateUnknownState = JobRunState("unknown_state") JobRunStateQueued = JobRunState("queued") JobRunStateScheduled = JobRunState("scheduled") JobRunStateRunning = JobRunState("running") JobRunStateSucceeded = JobRunState("succeeded") JobRunStateFailed = JobRunState("failed") JobRunStateCanceled = JobRunState("canceled") JobRunStateInternalError = JobRunState("internal_error") )
const ( ListJobDefinitionsRequestOrderByCreatedAtAsc = ListJobDefinitionsRequestOrderBy("created_at_asc") ListJobDefinitionsRequestOrderByCreatedAtDesc = ListJobDefinitionsRequestOrderBy("created_at_desc") )
const ( ListJobRunsRequestOrderByCreatedAtAsc = ListJobRunsRequestOrderBy("created_at_asc") ListJobRunsRequestOrderByCreatedAtDesc = ListJobRunsRequestOrderBy("created_at_desc") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
This API allows you to manage your Serverless Jobs.
func (*API) CreateJobDefinition ¶
func (s *API) CreateJobDefinition(req *CreateJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
CreateJobDefinition: Create a new job definition in a specified Project.
func (*API) CreateJobDefinitionSecrets ¶
func (s *API) CreateJobDefinitionSecrets(req *CreateJobDefinitionSecretsRequest, opts ...scw.RequestOption) (*CreateJobDefinitionSecretsResponse, error)
CreateJobDefinitionSecrets: Create a secret reference within a job definition.
func (*API) DeleteJobDefinition ¶
func (s *API) DeleteJobDefinition(req *DeleteJobDefinitionRequest, opts ...scw.RequestOption) error
DeleteJobDefinition: Delete an existing job definition by its unique identifier.
func (*API) DeleteJobDefinitionSecret ¶
func (s *API) DeleteJobDefinitionSecret(req *DeleteJobDefinitionSecretRequest, opts ...scw.RequestOption) error
DeleteJobDefinitionSecret: Delete a secret reference within a job definition.
func (*API) GetJobDefinition ¶
func (s *API) GetJobDefinition(req *GetJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
GetJobDefinition: Get a job definition by its unique identifier.
func (*API) GetJobDefinitionSecret ¶
func (s *API) GetJobDefinitionSecret(req *GetJobDefinitionSecretRequest, opts ...scw.RequestOption) (*Secret, error)
GetJobDefinitionSecret: Get a secret references within a job definition.
func (*API) GetJobRun ¶
func (s *API) GetJobRun(req *GetJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
GetJobRun: Get a job run by its unique identifier.
func (*API) GetJobsLimits ¶
func (s *API) GetJobsLimits(req *GetJobsLimitsRequest, opts ...scw.RequestOption) (*JobsLimits, error)
GetJobsLimits: Get jobs limits for the console.
func (*API) ListJobDefinitionSecrets ¶
func (s *API) ListJobDefinitionSecrets(req *ListJobDefinitionSecretsRequest, opts ...scw.RequestOption) (*ListJobDefinitionSecretsResponse, error)
ListJobDefinitionSecrets: List secrets references within a job definition.
func (*API) ListJobDefinitions ¶
func (s *API) ListJobDefinitions(req *ListJobDefinitionsRequest, opts ...scw.RequestOption) (*ListJobDefinitionsResponse, error)
ListJobDefinitions: List all your job definitions with filters.
func (*API) ListJobRuns ¶
func (s *API) ListJobRuns(req *ListJobRunsRequest, opts ...scw.RequestOption) (*ListJobRunsResponse, error)
ListJobRuns: List all job runs with filters.
func (*API) ListJobsResources ¶
func (s *API) ListJobsResources(req *ListJobsResourcesRequest, opts ...scw.RequestOption) (*ListJobsResourcesResponse, error)
ListJobsResources: List jobs resources for the console.
func (*API) StartJobDefinition ¶
func (s *API) StartJobDefinition(req *StartJobDefinitionRequest, opts ...scw.RequestOption) (*StartJobDefinitionResponse, error)
StartJobDefinition: Run an existing job definition by its unique identifier. This will create a new job run.
func (*API) StopJobRun ¶
func (s *API) StopJobRun(req *StopJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
StopJobRun: Stop a job run by its unique identifier.
func (*API) UpdateJobDefinition ¶
func (s *API) UpdateJobDefinition(req *UpdateJobDefinitionRequest, opts ...scw.RequestOption) (*JobDefinition, error)
UpdateJobDefinition: Update an existing job definition associated with the specified unique identifier.
func (*API) UpdateJobDefinitionSecret ¶
func (s *API) UpdateJobDefinitionSecret(req *UpdateJobDefinitionSecretRequest, opts ...scw.RequestOption) (*Secret, error)
UpdateJobDefinitionSecret: Update a secret reference within a job definition.
func (*API) WaitForJobRun ¶
func (s *API) WaitForJobRun(req *WaitForJobRunRequest, opts ...scw.RequestOption) (*JobRun, error)
WaitForJobRun waits for the job run to be in a "terminal state" before returning. This function can be used to wait for a job run to fail for example.
type CreateJobDefinitionRequest ¶
type CreateJobDefinitionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// Name: name of the job definition.
Name string `json:"name"`
// CPULimit: CPU limit of the job.
CPULimit uint32 `json:"cpu_limit"`
// MemoryLimit: memory limit of the job (in MiB).
MemoryLimit uint32 `json:"memory_limit"`
// LocalStorageCapacity: local storage capacity of the job (in MiB).
LocalStorageCapacity *uint32 `json:"local_storage_capacity,omitempty"`
// ImageURI: image to use for the job.
ImageURI string `json:"image_uri"`
// Command: startup command. If empty or not defined, the image's default command is used.
Command string `json:"command"`
// ProjectID: UUID of the Scaleway Project containing the job.
ProjectID string `json:"project_id"`
// EnvironmentVariables: environment variables of the job.
EnvironmentVariables map[string]string `json:"environment_variables"`
// Description: description of the job.
Description string `json:"description"`
// JobTimeout: timeout of the job in seconds.
JobTimeout *scw.Duration `json:"job_timeout,omitempty"`
// CronSchedule: configure a cron for the job.
CronSchedule *CreateJobDefinitionRequestCronScheduleConfig `json:"cron_schedule,omitempty"`
}
CreateJobDefinitionRequest: create job definition request.
type CreateJobDefinitionRequestCronScheduleConfig ¶
type CreateJobDefinitionRequestCronScheduleConfig struct {
Schedule string `json:"schedule"`
Timezone string `json:"timezone"`
}
CreateJobDefinitionRequestCronScheduleConfig: create job definition request cron schedule config.
type CreateJobDefinitionSecretsRequest ¶
type CreateJobDefinitionSecretsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition.
JobDefinitionID string `json:"-"`
// Secrets: list of secrets to inject into the job.
Secrets []*CreateJobDefinitionSecretsRequestSecretConfig `json:"secrets"`
}
CreateJobDefinitionSecretsRequest: create job definition secrets request.
type CreateJobDefinitionSecretsRequestSecretConfig ¶
type CreateJobDefinitionSecretsRequestSecretConfig struct {
SecretManagerID string `json:"secret_manager_id"`
SecretManagerVersion string `json:"secret_manager_version"`
// Precisely one of Path, EnvVarName must be set.
Path *string `json:"path,omitempty"`
// Precisely one of Path, EnvVarName must be set.
EnvVarName *string `json:"env_var_name,omitempty"`
}
CreateJobDefinitionSecretsRequestSecretConfig: create job definition secrets request secret config.
type CreateJobDefinitionSecretsResponse ¶
type CreateJobDefinitionSecretsResponse struct {
// Secrets: list of secrets created.
Secrets []*Secret `json:"secrets"`
}
CreateJobDefinitionSecretsResponse: create job definition secrets response.
type CronSchedule ¶
type CronSchedule struct {
// Schedule: uNIX cron schedule to run job (e.g., '* * * * *').
Schedule string `json:"schedule"`
// Timezone: timezone for the cron schedule, in tz database format (e.g., 'Europe/Paris').
Timezone string `json:"timezone"`
}
CronSchedule: cron schedule.
type DeleteJobDefinitionRequest ¶
type DeleteJobDefinitionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition to delete.
JobDefinitionID string `json:"-"`
}
DeleteJobDefinitionRequest: delete job definition request.
type DeleteJobDefinitionSecretRequest ¶
type DeleteJobDefinitionSecretRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition.
JobDefinitionID string `json:"-"`
// SecretID: UUID of the secret reference within the job.
SecretID string `json:"-"`
}
DeleteJobDefinitionSecretRequest: delete job definition secret request.
type GetJobDefinitionRequest ¶
type GetJobDefinitionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition to get.
JobDefinitionID string `json:"-"`
}
GetJobDefinitionRequest: get job definition request.
type GetJobDefinitionSecretRequest ¶
type GetJobDefinitionSecretRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition.
JobDefinitionID string `json:"-"`
// SecretID: UUID of the secret reference within the job.
SecretID string `json:"-"`
}
GetJobDefinitionSecretRequest: get job definition secret request.
type GetJobRunRequest ¶
type GetJobRunRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobRunID: UUID of the job run to get.
JobRunID string `json:"-"`
}
GetJobRunRequest: get job run request.
type GetJobsLimitsRequest ¶
type GetJobsLimitsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
}
GetJobsLimitsRequest: get jobs limits request.
type JobDefinition ¶
type JobDefinition struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
CPULimit uint32 `json:"cpu_limit"`
MemoryLimit uint32 `json:"memory_limit"`
ImageURI string `json:"image_uri"`
Command string `json:"command"`
ProjectID string `json:"project_id"`
EnvironmentVariables map[string]string `json:"environment_variables"`
Description string `json:"description"`
JobTimeout *scw.Duration `json:"job_timeout"`
CronSchedule *CronSchedule `json:"cron_schedule"`
LocalStorageCapacity uint32 `json:"local_storage_capacity"`
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"region"`
}
JobDefinition: job definition.
type JobRun ¶
type JobRun struct {
ID string `json:"id"`
JobDefinitionID string `json:"job_definition_id"`
// State: default value: unknown_state
State JobRunState `json:"state"`
CreatedAt *time.Time `json:"created_at"`
UpdatedAt *time.Time `json:"updated_at"`
TerminatedAt *time.Time `json:"terminated_at"`
ExitCode *int32 `json:"exit_code"`
RunDuration *scw.Duration `json:"run_duration"`
ErrorMessage string `json:"error_message"`
CPULimit uint32 `json:"cpu_limit"`
MemoryLimit uint32 `json:"memory_limit"`
Command string `json:"command"`
EnvironmentVariables map[string]string `json:"environment_variables"`
LocalStorageCapacity uint32 `json:"local_storage_capacity"`
StartedAt *time.Time `json:"started_at"`
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"region"`
}
JobRun: job run.
type JobRunState ¶
type JobRunState string
func (JobRunState) MarshalJSON ¶
func (enum JobRunState) MarshalJSON() ([]byte, error)
func (JobRunState) String ¶
func (enum JobRunState) String() string
func (*JobRunState) UnmarshalJSON ¶
func (enum *JobRunState) UnmarshalJSON(data []byte) error
func (JobRunState) Values ¶
func (enum JobRunState) Values() []JobRunState
type JobsLimits ¶
type JobsLimits struct {
SecretsPerJobDefinition uint32 `json:"secrets_per_job_definition"`
}
JobsLimits: jobs limits.
type ListJobDefinitionSecretsRequest ¶
type ListJobDefinitionSecretsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition.
JobDefinitionID string `json:"-"`
}
ListJobDefinitionSecretsRequest: list job definition secrets request.
type ListJobDefinitionSecretsResponse ¶
type ListJobDefinitionSecretsResponse struct {
// Secrets: list of secret references within a job definition.
Secrets []*Secret `json:"secrets"`
// TotalCount: total count of secret references within a job definition.
TotalCount uint64 `json:"total_count"`
}
ListJobDefinitionSecretsResponse: list job definition secrets response.
func (*ListJobDefinitionSecretsResponse) UnsafeAppend ¶
func (r *ListJobDefinitionSecretsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListJobDefinitionSecretsResponse) UnsafeGetTotalCount ¶
func (r *ListJobDefinitionSecretsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListJobDefinitionsRequest ¶
type ListJobDefinitionsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
Page *int32 `json:"-"`
PageSize *uint32 `json:"-"`
// OrderBy: default value: created_at_asc
OrderBy ListJobDefinitionsRequestOrderBy `json:"-"`
ProjectID *string `json:"-"`
OrganizationID *string `json:"-"`
}
ListJobDefinitionsRequest: list job definitions request.
type ListJobDefinitionsRequestOrderBy ¶
type ListJobDefinitionsRequestOrderBy string
func (ListJobDefinitionsRequestOrderBy) MarshalJSON ¶
func (enum ListJobDefinitionsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListJobDefinitionsRequestOrderBy) String ¶
func (enum ListJobDefinitionsRequestOrderBy) String() string
func (*ListJobDefinitionsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListJobDefinitionsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListJobDefinitionsRequestOrderBy) Values ¶
func (enum ListJobDefinitionsRequestOrderBy) Values() []ListJobDefinitionsRequestOrderBy
type ListJobDefinitionsResponse ¶
type ListJobDefinitionsResponse struct {
JobDefinitions []*JobDefinition `json:"job_definitions"`
TotalCount uint64 `json:"total_count"`
}
ListJobDefinitionsResponse: list job definitions response.
func (*ListJobDefinitionsResponse) UnsafeAppend ¶
func (r *ListJobDefinitionsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListJobDefinitionsResponse) UnsafeGetTotalCount ¶
func (r *ListJobDefinitionsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListJobRunsRequest ¶
type ListJobRunsRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
Page *int32 `json:"-"`
PageSize *uint32 `json:"-"`
// OrderBy: default value: created_at_asc
OrderBy ListJobRunsRequestOrderBy `json:"-"`
JobDefinitionID *string `json:"-"`
ProjectID *string `json:"-"`
OrganizationID *string `json:"-"`
// State: default value: unknown_state
State JobRunState `json:"-"`
States []JobRunState `json:"-"`
}
ListJobRunsRequest: list job runs request.
type ListJobRunsRequestOrderBy ¶
type ListJobRunsRequestOrderBy string
func (ListJobRunsRequestOrderBy) MarshalJSON ¶
func (enum ListJobRunsRequestOrderBy) MarshalJSON() ([]byte, error)
func (ListJobRunsRequestOrderBy) String ¶
func (enum ListJobRunsRequestOrderBy) String() string
func (*ListJobRunsRequestOrderBy) UnmarshalJSON ¶
func (enum *ListJobRunsRequestOrderBy) UnmarshalJSON(data []byte) error
func (ListJobRunsRequestOrderBy) Values ¶
func (enum ListJobRunsRequestOrderBy) Values() []ListJobRunsRequestOrderBy
type ListJobRunsResponse ¶
type ListJobRunsResponse struct {
JobRuns []*JobRun `json:"job_runs"`
TotalCount uint64 `json:"total_count"`
}
ListJobRunsResponse: list job runs response.
func (*ListJobRunsResponse) UnsafeAppend ¶
func (r *ListJobRunsResponse) UnsafeAppend(res any) (uint64, error)
UnsafeAppend should not be used Internal usage only
func (*ListJobRunsResponse) UnsafeGetTotalCount ¶
func (r *ListJobRunsResponse) UnsafeGetTotalCount() uint64
UnsafeGetTotalCount should not be used Internal usage only
type ListJobsResourcesRequest ¶
type ListJobsResourcesRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
}
ListJobsResourcesRequest: list jobs resources request.
type ListJobsResourcesResponse ¶
type ListJobsResourcesResponse struct {
Resources []*Resource `json:"resources"`
}
ListJobsResourcesResponse: list jobs resources response.
type Resource ¶
type Resource struct {
CPULimit uint32 `json:"cpu_limit"`
MemoryLimit uint32 `json:"memory_limit"`
}
Resource: resource.
type Secret ¶
type Secret struct {
// SecretID: UUID of the secret reference within the job.
SecretID string `json:"secret_id"`
// SecretManagerID: UUID of the secret in Secret Manager.
SecretManagerID string `json:"secret_manager_id"`
// SecretManagerVersion: version of the secret in Secret Manager.
SecretManagerVersion string `json:"secret_manager_version"`
// File: file secret mounted inside the job.
// Precisely one of File, EnvVar must be set.
File *SecretFile `json:"file,omitempty"`
// EnvVar: environment variable used to expose the secret.
// Precisely one of File, EnvVar must be set.
EnvVar *SecretEnvVar `json:"env_var,omitempty"`
}
Secret: secret.
type SecretEnvVar ¶
type SecretEnvVar struct {
Name string `json:"name"`
}
SecretEnvVar: secret env var.
type StartJobDefinitionRequest ¶
type StartJobDefinitionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition to start.
JobDefinitionID string `json:"-"`
// Command: contextual startup command for this specific job run.
Command *string `json:"command,omitempty"`
// EnvironmentVariables: contextual environment variables for this specific job run.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// Replicas: number of jobs to run.
Replicas *uint32 `json:"replicas,omitempty"`
}
StartJobDefinitionRequest: start job definition request.
type StartJobDefinitionResponse ¶
type StartJobDefinitionResponse struct {
JobRuns []*JobRun `json:"job_runs"`
}
StartJobDefinitionResponse: start job definition response.
type StopJobRunRequest ¶
type StopJobRunRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobRunID: UUID of the job run to stop.
JobRunID string `json:"-"`
}
StopJobRunRequest: stop job run request.
type UpdateJobDefinitionRequest ¶
type UpdateJobDefinitionRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition to update.
JobDefinitionID string `json:"-"`
// Name: name of the job definition.
Name *string `json:"name,omitempty"`
// CPULimit: CPU limit of the job.
CPULimit *uint32 `json:"cpu_limit,omitempty"`
// MemoryLimit: memory limit of the job (in MiB).
MemoryLimit *uint32 `json:"memory_limit,omitempty"`
// LocalStorageCapacity: local storage capacity of the job (in MiB).
LocalStorageCapacity *uint32 `json:"local_storage_capacity,omitempty"`
// ImageURI: image to use for the job.
ImageURI *string `json:"image_uri,omitempty"`
// Command: startup command.
Command *string `json:"command,omitempty"`
// EnvironmentVariables: environment variables of the job.
EnvironmentVariables *map[string]string `json:"environment_variables,omitempty"`
// Description: description of the job.
Description *string `json:"description,omitempty"`
// JobTimeout: timeout of the job in seconds.
JobTimeout *scw.Duration `json:"job_timeout,omitempty"`
CronSchedule *UpdateJobDefinitionRequestCronScheduleConfig `json:"cron_schedule,omitempty"`
}
UpdateJobDefinitionRequest: update job definition request.
type UpdateJobDefinitionRequestCronScheduleConfig ¶
type UpdateJobDefinitionRequestCronScheduleConfig struct {
Schedule *string `json:"schedule"`
Timezone *string `json:"timezone"`
}
UpdateJobDefinitionRequestCronScheduleConfig: update job definition request cron schedule config.
type UpdateJobDefinitionSecretRequest ¶
type UpdateJobDefinitionSecretRequest struct {
// Region: region to target. If none is passed will use default region from the config.
Region scw.Region `json:"-"`
// JobDefinitionID: UUID of the job definition.
JobDefinitionID string `json:"-"`
// SecretID: UUID of the secret reference within the job.
SecretID string `json:"-"`
// SecretManagerVersion: version of the secret in Secret Manager.
SecretManagerVersion *string `json:"secret_manager_version,omitempty"`
// Path: path of the secret to mount inside the job (either `path` or `env_var_name` must be set).
// Precisely one of Path, EnvVarName must be set.
Path *string `json:"path,omitempty"`
// EnvVarName: environment variable name used to expose the secret inside the job (either `path` or `env_var_name` must be set).
// Precisely one of Path, EnvVarName must be set.
EnvVarName *string `json:"env_var_name,omitempty"`
}
UpdateJobDefinitionSecretRequest: update job definition secret request.