Documentation
¶
Index ¶
- type BatchService
- type ComputeEnvironment
- type ComputeEnvironmentOrder
- type ComputeResource
- type ContainerDetail
- type ContainerProperties
- type FairsharePolicy
- type Job
- type JobDefinition
- type JobQueue
- type JobTimeout
- type KeyValuePair
- type RetryStrategy
- type SchedulingPolicy
- type ServiceLocator
- type ShareDistribution
- type Store
- func (s *Store) CancelJob(jobID, reason string) error
- func (s *Store) CreateComputeEnvironment(name, ceType, state, serviceRole string, resources *ComputeResource) (*ComputeEnvironment, error)
- func (s *Store) CreateJobQueue(name, state string, priority int, computeEnvOrder []ComputeEnvironmentOrder) (*JobQueue, error)
- func (s *Store) CreateSchedulingPolicy(name string, fsp *FairsharePolicy, tags map[string]string) (*SchedulingPolicy, error)
- func (s *Store) DeleteComputeEnvironment(name string) bool
- func (s *Store) DeleteJobQueue(name string) bool
- func (s *Store) DeleteSchedulingPolicy(arn string) bool
- func (s *Store) DeregisterJobDefinition(defArn string) bool
- func (s *Store) DescribeSchedulingPolicies(arns []string) []*SchedulingPolicy
- func (s *Store) GetComputeEnvironment(name string) (*ComputeEnvironment, bool)
- func (s *Store) GetComputeEnvironmentVCPUs(name string) (available, desired int, ok bool)
- func (s *Store) GetJob(jobID string) (*Job, bool)
- func (s *Store) GetJobDefRevisions(name string) []*JobDefinition
- func (s *Store) GetJobDefinition(nameOrArn string) (*JobDefinition, bool)
- func (s *Store) GetJobQueue(name string) (*JobQueue, bool)
- func (s *Store) ListComputeEnvironments() []*ComputeEnvironment
- func (s *Store) ListJobDefinitions() []*JobDefinition
- func (s *Store) ListJobQueues() []*JobQueue
- func (s *Store) ListJobs(queue, status string) []*Job
- func (s *Store) ListTagsForResource(resourceARN string) map[string]string
- func (s *Store) RegisterJobDefinition(name, jobType string, container *ContainerProperties, retry *RetryStrategy, ...) (*JobDefinition, error)
- func (s *Store) SubmitJob(name, queue, jobDef string, container *ContainerDetail, retry *RetryStrategy, ...) (*Job, error)
- func (s *Store) TagResource(resourceARN string, tags map[string]string)
- func (s *Store) TerminateJob(jobID, reason string) error
- func (s *Store) UntagResource(resourceARN string, keys []string)
- func (s *Store) UpdateComputeEnvironment(name, state, serviceRole string) (*ComputeEnvironment, bool)
- func (s *Store) UpdateJobQueue(name, state string, priority int, ceOrder []ComputeEnvironmentOrder) (*JobQueue, bool)
- func (s *Store) UpdateSchedulingPolicy(arn string, fsp *FairsharePolicy) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchService ¶
type BatchService struct {
// contains filtered or unexported fields
}
BatchService is the cloudmock implementation of the AWS Batch API.
func New ¶
func New(accountID, region string) *BatchService
New returns a new BatchService for the given AWS account ID and region.
func (*BatchService) Actions ¶
func (s *BatchService) Actions() []service.Action
Actions returns the list of Batch API actions supported by this service.
func (*BatchService) HandleRequest ¶
func (s *BatchService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming Batch request to the appropriate handler. Batch uses REST-JSON protocol with path-based routing.
func (*BatchService) HealthCheck ¶
func (s *BatchService) HealthCheck() error
HealthCheck always returns nil.
func (*BatchService) Name ¶
func (s *BatchService) Name() string
Name returns the AWS service name used for routing.
type ComputeEnvironment ¶
type ComputeEnvironment struct {
ComputeEnvironmentName string
ComputeEnvironmentArn string
Type string // MANAGED or UNMANAGED
State string // ENABLED or DISABLED
Status string
StatusReason string
ComputeResources *ComputeResource
ServiceRole string
CreatedAt time.Time
// contains filtered or unexported fields
}
ComputeEnvironment represents a Batch compute environment.
type ComputeEnvironmentOrder ¶
ComputeEnvironmentOrder defines the order of compute environments in a job queue.
type ComputeResource ¶
type ComputeResource struct {
Type string
MinvCpus int
MaxvCpus int
DesiredvCpus int
InstanceTypes []string
Subnets []string
SecurityGroupIds []string
InstanceRole string
}
ComputeResource describes the compute resources in a managed compute environment.
type ContainerDetail ¶
type ContainerDetail struct {
Image string
Vcpus int
Memory int
Command []string
ExitCode *int
Reason string
LogStreamName string
}
ContainerDetail describes a running container.
type ContainerProperties ¶
type ContainerProperties struct {
Image string
Vcpus int
Memory int
Command []string
JobRoleArn string
Environment []KeyValuePair
}
ContainerProperties describes the container for a job definition.
type FairsharePolicy ¶
type FairsharePolicy struct {
}
FairsharePolicy defines fair-share parameters for a scheduling policy.
type Job ¶
type Job struct {
JobName string
JobID string
JobArn string
JobQueue string
JobDefinition string
Status string
StatusReason string
CreatedAt time.Time
StartedAt *time.Time
StoppedAt *time.Time
Container *ContainerDetail
RetryStrategy *RetryStrategy
Timeout *JobTimeout
// contains filtered or unexported fields
}
Job represents a Batch job.
type JobDefinition ¶
type JobDefinition struct {
JobDefinitionName string
JobDefinitionArn string
Revision int
Type string
Status string
ContainerProperties *ContainerProperties
RetryStrategy *RetryStrategy
Timeout *JobTimeout
CreatedAt time.Time
}
JobDefinition represents a Batch job definition.
type JobQueue ¶
type JobQueue struct {
JobQueueName string
JobQueueArn string
State string
Status string
StatusReason string
Priority int
ComputeEnvironmentOrder []ComputeEnvironmentOrder
CreatedAt time.Time
}
JobQueue represents a Batch job queue.
type JobTimeout ¶
type JobTimeout struct {
AttemptDurationSeconds int
}
JobTimeout describes the timeout for a job.
type KeyValuePair ¶
KeyValuePair represents a key-value pair.
type RetryStrategy ¶
type RetryStrategy struct {
Attempts int
}
RetryStrategy describes the retry strategy for a job.
type SchedulingPolicy ¶
SchedulingPolicy represents a Batch fair-share scheduling policy.
type ServiceLocator ¶
type ServiceLocator interface {
Lookup(name string) (interface {
HandleRequest(ctx interface{}) (interface{}, error)
}, error)
}
ServiceLocator resolves other services for cross-service integration.
type ShareDistribution ¶
type ShareDistribution struct {
}
ShareDistribution defines a share for a single compute identifier.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages Batch resources in memory.
func (*Store) CreateComputeEnvironment ¶
func (s *Store) CreateComputeEnvironment(name, ceType, state, serviceRole string, resources *ComputeResource) (*ComputeEnvironment, error)
CreateComputeEnvironment creates a compute environment.
func (*Store) CreateJobQueue ¶
func (s *Store) CreateJobQueue(name, state string, priority int, computeEnvOrder []ComputeEnvironmentOrder) (*JobQueue, error)
CreateJobQueue creates a job queue.
func (*Store) CreateSchedulingPolicy ¶
func (s *Store) CreateSchedulingPolicy(name string, fsp *FairsharePolicy, tags map[string]string) (*SchedulingPolicy, error)
CreateSchedulingPolicy creates a new scheduling policy.
func (*Store) DeleteComputeEnvironment ¶
DeleteComputeEnvironment removes a compute environment.
func (*Store) DeleteJobQueue ¶
DeleteJobQueue removes a job queue.
func (*Store) DeleteSchedulingPolicy ¶
DeleteSchedulingPolicy removes a scheduling policy.
func (*Store) DeregisterJobDefinition ¶
DeregisterJobDefinition deactivates a job definition.
func (*Store) DescribeSchedulingPolicies ¶
func (s *Store) DescribeSchedulingPolicies(arns []string) []*SchedulingPolicy
DescribeSchedulingPolicies returns scheduling policies by ARN.
func (*Store) GetComputeEnvironment ¶
func (s *Store) GetComputeEnvironment(name string) (*ComputeEnvironment, bool)
GetComputeEnvironment retrieves a compute environment.
func (*Store) GetComputeEnvironmentVCPUs ¶
GetComputeEnvironmentVCPUs returns available and desired vCPUs for a compute environment.
func (*Store) GetJobDefRevisions ¶
func (s *Store) GetJobDefRevisions(name string) []*JobDefinition
GetJobDefRevisions returns all revisions for a given job definition name.
func (*Store) GetJobDefinition ¶
func (s *Store) GetJobDefinition(nameOrArn string) (*JobDefinition, bool)
GetJobDefinition retrieves a job definition.
func (*Store) GetJobQueue ¶
GetJobQueue retrieves a job queue.
func (*Store) ListComputeEnvironments ¶
func (s *Store) ListComputeEnvironments() []*ComputeEnvironment
ListComputeEnvironments returns all compute environments.
func (*Store) ListJobDefinitions ¶
func (s *Store) ListJobDefinitions() []*JobDefinition
ListJobDefinitions returns all job definitions.
func (*Store) ListJobQueues ¶
ListJobQueues returns all job queues.
func (*Store) ListTagsForResource ¶
ListTagsForResource returns all tags for a resource by ARN.
func (*Store) RegisterJobDefinition ¶
func (s *Store) RegisterJobDefinition(name, jobType string, container *ContainerProperties, retry *RetryStrategy, timeout *JobTimeout) (*JobDefinition, error)
RegisterJobDefinition registers a new job definition.
func (*Store) SubmitJob ¶
func (s *Store) SubmitJob(name, queue, jobDef string, container *ContainerDetail, retry *RetryStrategy, timeout *JobTimeout) (*Job, error)
SubmitJob submits a new job.
func (*Store) TagResource ¶
TagResource applies tags to any resource by ARN.
func (*Store) TerminateJob ¶
TerminateJob terminates a running job.
func (*Store) UntagResource ¶
UntagResource removes tags from a resource by ARN.
func (*Store) UpdateComputeEnvironment ¶
func (s *Store) UpdateComputeEnvironment(name, state, serviceRole string) (*ComputeEnvironment, bool)
UpdateComputeEnvironment updates a compute environment's state or service role.
func (*Store) UpdateJobQueue ¶
func (s *Store) UpdateJobQueue(name, state string, priority int, ceOrder []ComputeEnvironmentOrder) (*JobQueue, bool)
UpdateJobQueue updates a job queue's state, priority, or compute environment order.
func (*Store) UpdateSchedulingPolicy ¶
func (s *Store) UpdateSchedulingPolicy(arn string, fsp *FairsharePolicy) bool
UpdateSchedulingPolicy updates a scheduling policy's fair-share config.