Class: Fog::AWS::ECS::Real
- Inherits:
-
Object
- Object
- Fog::AWS::ECS::Real
- Includes:
- CredentialFetcher::ConnectionMethods
- Defined in:
- lib/fog/aws/ecs.rb,
lib/fog/aws/requests/ecs/run_task.rb,
lib/fog/aws/requests/ecs/stop_task.rb,
lib/fog/aws/requests/ecs/list_tasks.rb,
lib/fog/aws/requests/ecs/start_task.rb,
lib/fog/aws/requests/ecs/list_clusters.rb,
lib/fog/aws/requests/ecs/list_services.rb,
lib/fog/aws/requests/ecs/create_cluster.rb,
lib/fog/aws/requests/ecs/create_service.rb,
lib/fog/aws/requests/ecs/delete_cluster.rb,
lib/fog/aws/requests/ecs/delete_service.rb,
lib/fog/aws/requests/ecs/describe_tasks.rb,
lib/fog/aws/requests/ecs/update_service.rb,
lib/fog/aws/requests/ecs/describe_clusters.rb,
lib/fog/aws/requests/ecs/describe_services.rb,
lib/fog/aws/requests/ecs/list_task_definitions.rb,
lib/fog/aws/requests/ecs/describe_task_definition.rb,
lib/fog/aws/requests/ecs/list_container_instances.rb,
lib/fog/aws/requests/ecs/register_task_definition.rb,
lib/fog/aws/requests/ecs/deregister_task_definition.rb,
lib/fog/aws/requests/ecs/describe_container_instances.rb,
lib/fog/aws/requests/ecs/deregister_container_instance.rb,
lib/fog/aws/requests/ecs/list_task_definition_families.rb
Instance Attribute Summary collapse
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
-
#create_cluster(params = {}) ⇒ Object
Creates a new Amazon ECS cluster docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html ==== Parameters * clusterName <~String> - The name of your cluster.
-
#create_service(params = {}) ⇒ Object
Runs and maintains a desired number of tasks from a specified task definition.
-
#delete_cluster(params = {}) ⇒ Object
Deletes the specified cluster docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteCluster.html ==== Parameters * cluster <~String> - The short name or full Amazon Resource Name (ARN) of the cluster that you want to delete ==== Returns * response<~Excon::Response>: * body<~Hash>: * ‘Cluster’<~Hash> - The full description of the deleted cluster.
-
#delete_service(params = {}) ⇒ Object
Deletes a specified service within a cluster.
-
#deregister_container_instance(params = {}) ⇒ Object
Deregisters an Amazon ECS container instance from the specified cluster.
-
#deregister_task_definition(params = {}) ⇒ Object
Deregisters the specified task definition.
-
#describe_clusters(params = {}) ⇒ Object
Describes one or more of your clusters.
-
#describe_container_instances(params = {}) ⇒ Object
Describes Amazon EC2 Container Service container instances.
-
#describe_services(params = {}) ⇒ Object
Describes the specified services running in your cluster.
-
#describe_task_definition(params = {}) ⇒ Object
Describes a task definition docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html ==== Parameters * taskDefinition <~String> - The family for the latest revision, family and revision (family:revision) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition that you want to describe.
-
#describe_tasks(params = {}) ⇒ Object
Describes a specified task or tasks.
-
#initialize(options = {}) ⇒ Real
constructor
Initialize connection to ECS.
-
#list_clusters(params = {}) ⇒ Object
Returns a list of existing clusters docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html ==== Parameters * maxResults <~Integer> - The maximum number of cluster results returned by ListClusters in paginated output.
-
#list_container_instances(params = {}) ⇒ Object
Returns a list of container instances in a specified cluster.
-
#list_services(params = {}) ⇒ Object
Lists the services that are running in a specified cluster.
-
#list_task_definition_families(params = {}) ⇒ Object
Returns a list of task definition families that are registered to your account.
-
#list_task_definitions(params = {}) ⇒ Object
Returns a list of task definitions that are registered to your account docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitions.html ==== Parameters * familyPrefix <~String> - The full family name that you want to filter the ListTaskDefinitions results with.
-
#list_tasks(params = {}) ⇒ Object
Returns a list of tasks for a specified cluster.
-
#register_task_definition(params = {}) ⇒ Object
Registers a new task definition from the supplied family and containerDefinitions.
- #reload ⇒ Object
-
#run_task(params = {}) ⇒ Object
Start a task using random placement and the default Amazon ECS scheduler.
-
#start_task(params = {}) ⇒ Object
Starts a new task from the specified task definition on the specified container instance or instances.
-
#stop_task(params = {}) ⇒ Object
Stops a running task.
-
#update_service(params = {}) ⇒ Object
Modify the desired count or task definition used in a service.
Methods included from CredentialFetcher::ConnectionMethods
#refresh_credentials_if_expired
Constructor Details
#initialize(options = {}) ⇒ Real
Initialize connection to ECS
Notes
options parameter must include values for :aws_access_key_id and :aws_secret_access_key in order to create a connection
Examples
ecs = ECS.new(
:aws_access_key_id => your_aws_access_key_id,
:aws_secret_access_key => your_aws_secret_access_key
)
Parameters
-
options<~Hash> - config arguments for connection. Defaults to {}.
-
region<~String> - optional region to use. For instance, ‘eu-west-1’, ‘us-east-1’ and etc.
-
Returns
-
ECS object with connection to AWS.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fog/aws/ecs.rb', line 58 def initialize(={}) @use_iam_profile = [:use_iam_profile] @instrumentor = [:instrumentor] @instrumentor_name = [:instrumentor_name] || 'fog.aws.ecs' @connection_options = [:connection_options] || {} @region = [:region] || 'us-east-1' @host = [:host] || "ecs.#{@region}.amazonaws.com" @path = [:path] || '/' @persistent = [:persistent] || false @port = [:port] || 443 @scheme = [:scheme] || 'https' @connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) @version = [:version] || '2014-11-13' setup_credentials() end |
Instance Attribute Details
#region ⇒ Object (readonly)
Returns the value of attribute region.
37 38 39 |
# File 'lib/fog/aws/ecs.rb', line 37 def region @region end |
Instance Method Details
#create_cluster(params = {}) ⇒ Object
Creates a new Amazon ECS cluster docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateCluster.html
Parameters
-
clusterName <~String> - The name of your cluster.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Cluster’ <~Hash> - The full description of your new cluster
-
-
15 16 17 18 19 20 |
# File 'lib/fog/aws/requests/ecs/create_cluster.rb', line 15 def create_cluster(params={}) request({ 'Action' => 'CreateCluster', :parser => Fog::Parsers::AWS::ECS::CreateCluster.new }.merge(params)) end |
#create_service(params = {}) ⇒ Object
Runs and maintains a desired number of tasks from a specified task definition. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html
Parameters
-
clientToken <~String> - unique, case-sensitive identifier you provide to ensure the idempotency of the request.
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that you want to run your service on.
-
desiredCount <~Integer> - number of instantiations of the specified task definition that you would like to place and keep running on your cluster.
-
loadBalancers <~Array> - list of load balancer objects, containing the load balancer name, the container name (as it appears in a container definition), and the container port to access from the load balancer.
-
role <~String> - name or full Amazon Resource Name (ARN) of the IAM role that allows your Amazon ECS container agent to make calls to your load balancer on your behalf.
-
serviceName <~String> - name of your service
-
taskDefinition <~String> - family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Service’ <~Hash> - The full description of your new service
-
-
21 22 23 24 25 26 27 28 29 |
# File 'lib/fog/aws/requests/ecs/create_service.rb', line 21 def create_service(params={}) if load_balancers = params.delete('loadBalancers') params.merge!(Fog::AWS.indexed_param('loadBalancers.member', [*load_balancers])) end request({ 'Action' => 'CreateService', :parser => Fog::Parsers::AWS::ECS::CreateService.new }.merge(params)) end |
#delete_cluster(params = {}) ⇒ Object
Deletes the specified cluster docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteCluster.html
Parameters
-
cluster <~String> - The short name or full Amazon Resource Name (ARN) of the cluster that you want to delete
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Cluster’<~Hash> - The full description of the deleted cluster
-
-
15 16 17 18 19 20 |
# File 'lib/fog/aws/requests/ecs/delete_cluster.rb', line 15 def delete_cluster(params={}) request({ 'Action' => 'DeleteCluster', :parser => Fog::Parsers::AWS::ECS::DeleteCluster.new }.merge(params)) end |
#delete_service(params = {}) ⇒ Object
Deletes a specified service within a cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeleteService.html
Parameters
-
cluster <~String> - name of the cluster that hosts the service you want to delete.
-
service <~String> - name of the service you want to delete.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Service’<~Hash> - The full description of the deleted service
-
-
16 17 18 19 20 21 |
# File 'lib/fog/aws/requests/ecs/delete_service.rb', line 16 def delete_service(params={}) request({ 'Action' => 'DeleteService', :parser => Fog::Parsers::AWS::ECS::DeleteService.new }.merge(params)) end |
#deregister_container_instance(params = {}) ⇒ Object
Deregisters an Amazon ECS container instance from the specified cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterContainerInstance.html
Parameters
-
cluster <~String> - short name or full ARN of the cluster that hosts the container instance you want to deregister.
-
containerInstance <~String> - container instance UUID or full Amazon Resource Name (ARN) of the container instance you want to deregister.
-
force <~Boolean> - Force the deregistration of the container instance.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ContainerInstance’ <~Hash> - full description of the deregistered container instance
-
-
17 18 19 20 21 22 |
# File 'lib/fog/aws/requests/ecs/deregister_container_instance.rb', line 17 def deregister_container_instance(params={}) request({ 'Action' => 'DeregisterContainerInstance', :parser => Fog::Parsers::AWS::ECS::DeregisterContainerInstance.new }.merge(params)) end |
#deregister_task_definition(params = {}) ⇒ Object
Deregisters the specified task definition. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DeregisterTaskDefinition.html
Parameters
-
taskDefinition <~String> - The family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to deregister.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘TaskDefinition’ <~Hash> - full description of the deregistered task
-
-
15 16 17 18 19 20 |
# File 'lib/fog/aws/requests/ecs/deregister_task_definition.rb', line 15 def deregister_task_definition(params={}) request({ 'Action' => 'DeregisterTaskDefinition', :parser => Fog::Parsers::AWS::ECS::DeregisterTaskDefinition.new }.merge(params)) end |
#describe_clusters(params = {}) ⇒ Object
Describes one or more of your clusters. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeClusters.html
Parameters
-
clusters <~Array> - list of cluster names or full cluster Amazon Resource Name (ARN) entries
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘clusters’ <~Array> - The list of clusters
-
‘failures’ <~Array> - The list of failures (if any)
-
-
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/aws/requests/ecs/describe_clusters.rb', line 16 def describe_clusters(params={}) if members = params.delete('clusters') params.merge!(Fog::AWS.indexed_param('clusters.member', [*members])) end request({ 'Action' => 'DescribeClusters', :parser => Fog::Parsers::AWS::ECS::DescribeClusters.new }.merge(params)) end |
#describe_container_instances(params = {}) ⇒ Object
Describes Amazon EC2 Container Service container instances. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeContainerInstances.html
Parameters
-
cluster <~String> - short name or full ARN of the cluster that hosts the container instances you want to describe.
-
containerInstances <~Array> - list of container instance UUIDs or full Amazon Resource Name (ARN) entries.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘containerInstances’ <~Array> - list of container instances.
-
‘failures’ <~Array> - list of failures (if any)
-
-
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/requests/ecs/describe_container_instances.rb', line 17 def describe_container_instances(params={}) if instances = params.delete('containerInstances') params.merge!(Fog::AWS.indexed_param('containerInstances.member', [*instances])) end request({ 'Action' => 'DescribeContainerInstances', :parser => Fog::Parsers::AWS::ECS::DescribeContainerInstances.new }.merge(params)) end |
#describe_services(params = {}) ⇒ Object
Describes the specified services running in your cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeServices.html
Parameters
-
cluster <~String> - name of the cluster that hosts the service you want to describe.
-
services <~Array> - list of services you want to describe.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘services’ <~Array> - The list of services described.
-
‘failures’ <~Array> - The list of failures associated with the call (if any).
-
-
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/requests/ecs/describe_services.rb', line 17 def describe_services(params={}) if services = params.delete('services') params.merge!(Fog::AWS.indexed_param('services.member', [*services])) end request({ 'Action' => 'DescribeServices', :parser => Fog::Parsers::AWS::ECS::DescribeServices.new }.merge(params)) end |
#describe_task_definition(params = {}) ⇒ Object
Describes a task definition docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTaskDefinition.html
Parameters
-
taskDefinition <~String> - The family for the latest revision, family and revision (family:revision) for a specific revision in the family, or full Amazon Resource Name (ARN) of the task definition that you want to describe.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘taskDefinition’ <~Hash> - full task definition description
-
-
15 16 17 18 19 20 |
# File 'lib/fog/aws/requests/ecs/describe_task_definition.rb', line 15 def describe_task_definition(params={}) request({ 'Action' => 'DescribeTaskDefinition', :parser => Fog::Parsers::AWS::ECS::DescribeTaskDefinition.new }.merge(params)) end |
#describe_tasks(params = {}) ⇒ Object
Describes a specified task or tasks. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_DescribeTasks.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to describe
-
tasks <~Array> - space-separated list of task UUIDs or full Amazon Resource Name (ARN) entries
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘tasks’ <~Array> - The list of tasks
-
‘failures’ <~Array> - The list of failures (if any)
-
-
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/requests/ecs/describe_tasks.rb', line 17 def describe_tasks(params={}) if tasks = params.delete('tasks') params.merge!(Fog::AWS.indexed_param('tasks.member', [*tasks])) end request({ 'Action' => 'DescribeTasks', :parser => Fog::Parsers::AWS::ECS::DescribeTasks.new }.merge(params)) end |
#list_clusters(params = {}) ⇒ Object
Returns a list of existing clusters docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListClusters.html
Parameters
-
maxResults <~Integer> - The maximum number of cluster results returned by ListClusters in paginated output.
-
nextToken <~String> - The nextToken value returned from a previous paginated ListClusters request where maxResults was used.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ClusterArns’ <~Array> - list of full Amazon Resource Name (ARN) entries for each cluster associated with your account.
-
‘NextToken’ <~String> - nextToken value to include in a future ListClusters request.
-
-
17 18 19 20 21 22 |
# File 'lib/fog/aws/requests/ecs/list_clusters.rb', line 17 def list_clusters(params={}) request({ 'Action' => 'ListClusters', :parser => Fog::Parsers::AWS::ECS::ListClusters.new }.merge(params)) end |
#list_container_instances(params = {}) ⇒ Object
Returns a list of container instances in a specified cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListContainerInstances.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances you want to list.
-
maxResults <~Integer> - maximum number of container instance results returned by ListContainerInstances in paginated output.
-
nextToken <~String> - nextToken value returned from a previous paginated ListContainerInstances request where maxResults was used.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ContainerInstanceArns’ <~Array> - list of container instance full ARN entries for each container instance associated with the specified cluster.
-
‘NextToken’ <~String> - nextToken value to include in a future ListContainerInstances request.
-
-
18 19 20 21 22 23 |
# File 'lib/fog/aws/requests/ecs/list_container_instances.rb', line 18 def list_container_instances(params={}) request({ 'Action' => 'ListContainerInstances', :parser => Fog::Parsers::AWS::ECS::ListContainerInstances.new }.merge(params)) end |
#list_services(params = {}) ⇒ Object
Lists the services that are running in a specified cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListServices.html
Parameters
-
cluster <~String> - The short name or full Amazon Resource Name (ARN) of the cluster that hosts the services you want to list.
-
maxResults <~Integer> - The maximum number of container instance results returned by ListServices in paginated output.
-
nextToken <~String> - The nextToken value returned from a previous paginated ListServices request where maxResults was used.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘ServiceArns’ <~Array> - list of full Amazon Resource Name (ARN) entries for each service associated with the specified cluster.
-
‘NextToken’ <~String> - nextToken value to include in a future ListServices request.
-
-
18 19 20 21 22 23 |
# File 'lib/fog/aws/requests/ecs/list_services.rb', line 18 def list_services(params={}) request({ 'Action' => 'ListServices', :parser => Fog::Parsers::AWS::ECS::ListServices.new }.merge(params)) end |
#list_task_definition_families(params = {}) ⇒ Object
Returns a list of task definition families that are registered to your account. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitionFamilies.html
Parameters
-
familyPrefix <~String> - familyPrefix is a string that is used to filter the results of ListTaskDefinitionFamilies.
-
maxResults <~Integer> - maximum number of task definition family results returned by ListTaskDefinitionFamilies in paginated output.
-
nextToken <~String> - nextToken value returned from a previous paginated ListTaskDefinitionFamilies request where maxResults was used.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Families’ <~Array> - list of task definition family names that match the ListTaskDefinitionFamilies request.
-
‘NextToken’ <~String> - nextToken value to include in a future ListTaskDefinitionFamilies request.
-
-
18 19 20 21 22 23 |
# File 'lib/fog/aws/requests/ecs/list_task_definition_families.rb', line 18 def list_task_definition_families(params={}) request({ 'Action' => 'ListTaskDefinitionFamilies', :parser => Fog::Parsers::AWS::ECS::ListTaskDefinitionFamilies.new }.merge(params)) end |
#list_task_definitions(params = {}) ⇒ Object
Returns a list of task definitions that are registered to your account docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTaskDefinitions.html
Parameters
-
familyPrefix <~String> - The full family name that you want to filter the ListTaskDefinitions results with.
-
maxResults <~Integer> - The maximum number of task definition results returned by ListTaskDefinitions in paginated output.
-
nextToken <~String> - The nextToken value returned from a previous paginated ListTaskDefinitions request.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘TaskDefinitionArns’ <~Array> - list of task definition Amazon Resource Name (ARN) entries for the ListTaskDefintions request.
-
‘NextToken’ <~String> - nextToken value to include in a future ListTaskDefinitions request
-
-
18 19 20 21 22 23 |
# File 'lib/fog/aws/requests/ecs/list_task_definitions.rb', line 18 def list_task_definitions(params={}) request({ 'Action' => 'ListTaskDefinitions', :parser => Fog::Parsers::AWS::ECS::ListTaskDefinitions.new }.merge(params)) end |
#list_tasks(params = {}) ⇒ Object
Returns a list of tasks for a specified cluster. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListTasks.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that hosts the tasks you want to list.
-
containerInstance <~String> - container instance UUID or full Amazon Resource Name (ARN) of the container instance that you want to filter the ListTasks results with.
-
family <~String> - name of the family that you want to filter the ListTasks results with.
-
maxResults <~Integer> - maximum number of task results returned by ListTasks in paginated output.
-
nextToken <~String> - nextToken value returned from a previous paginated ListTasks request where maxResults was used.
-
serviceName <~String> - name of the service that you want to filter the ListTasks results with.
-
startedBy <~String> - startedBy value that you want to filter the task results with.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘TaskArns’ <~Array> - list of task Amazon Resource Name (ARN) entries for the ListTasks request.
-
‘NextToken’ <~String> - nextToken value to include in a future ListTasks request.
-
-
22 23 24 25 26 27 |
# File 'lib/fog/aws/requests/ecs/list_tasks.rb', line 22 def list_tasks(params={}) request({ 'Action' => 'ListTasks', :parser => Fog::Parsers::AWS::ECS::ListTasks.new }.merge(params)) end |
#register_task_definition(params = {}) ⇒ Object
Registers a new task definition from the supplied family and containerDefinitions. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html
Parameters
-
containerDefinitions <~Array> - list of container definitions in JSON format that describe the different containers that make up your task.
-
family <~String> - family for a task definition, which allows you to track multiple versions of the same task definition.
-
volumes <~String> - list of volume definitions in JSON format that containers in your task may use.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘TaskDefinition’ <~Array> - full task definition description registered
-
-
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/fog/aws/requests/ecs/register_task_definition.rb', line 17 def register_task_definition(params={}) serialized_params = {} params.each_pair do |k,v| serialized_params.merge!(Fog::AWS.serialize_keys(k, v)) end request({ 'Action' => 'RegisterTaskDefinition', :parser => Fog::Parsers::AWS::ECS::RegisterTaskDefinition.new }.merge(serialized_params)) end |
#reload ⇒ Object
76 77 78 |
# File 'lib/fog/aws/ecs.rb', line 76 def reload @connection.reset end |
#run_task(params = {}) ⇒ Object
Start a task using random placement and the default Amazon ECS scheduler. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that you want to run your task on.
-
count <~Integer> - number of instantiations of the specified task that you would like to place on your cluster.
-
overrides <~Hash> - list of container overrides.
-
startedBy <~String> - optional tag specified when a task is started
-
taskDefinition <~String> - family and revision (family:revision) or full ARN of the task definition that you want to run.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘tasks’ <~Array> - full description of the tasks that were run.
-
‘failures’ <~Array> - Any failed tasks from your RunTask action are listed here.
-
-
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/aws/requests/ecs/run_task.rb', line 20 def run_task(params={}) if overrides = params.delete('overrides') serialized_overrides = {} if overrides.is_a?(Hash) overrides.each_pair do |k,v| serialized_overrides.merge!(Fog::AWS.serialize_keys(k, v)) end end params.merge!('overrides' => serialized_overrides) end request({ 'Action' => 'RunTask', :parser => Fog::Parsers::AWS::ECS::RunTask.new }.merge(params)) end |
#start_task(params = {}) ⇒ Object
Starts a new task from the specified task definition on the specified container instance or instances. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StartTask.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that you want to start your task on.
-
containerInstances <~Array> - container instance UUIDs or full ARN entries for the container instances on which you would like to place your task.
-
overrides <~Hash> - list of container overrides.
-
startedBy <~String> - optional tag specified when a task is started
-
taskDefinition <~String> - family and revision (family:revision) or full ARN of the task definition that you want to start.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘tasks’ <~Array> - full description of the tasks that were started.
-
‘failures’ <~Array> - Any failed tasks from your StartTask action are listed here.
-
-
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fog/aws/requests/ecs/start_task.rb', line 20 def start_task(params={}) if container_instances = params.delete('containerInstances') params.merge!(Fog::AWS.indexed_param('containerInstances.member', [*container_instances])) end if overrides = params.delete('overrides') serialized_overrides = {} if overrides.is_a?(Hash) overrides.each_pair do |k,v| serialized_overrides.merge!(Fog::AWS.serialize_keys(k, v)) end end params.merge!('overrides' => serialized_overrides) end request({ 'Action' => 'StartTask', :parser => Fog::Parsers::AWS::ECS::StartTask.new }.merge(params)) end |
#stop_task(params = {}) ⇒ Object
Stops a running task. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_StopTask.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that hosts the task you want to stop.
-
task <~String> - task UUIDs or full Amazon Resource Name (ARN) entry of the task you would like to stop.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Task’ <~Hash> - The full description of the stopped task.
-
-
16 17 18 19 20 21 |
# File 'lib/fog/aws/requests/ecs/stop_task.rb', line 16 def stop_task(params={}) request({ 'Action' => 'StopTask', :parser => Fog::Parsers::AWS::ECS::StopTask.new }.merge(params)) end |
#update_service(params = {}) ⇒ Object
Modify the desired count or task definition used in a service. docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html
Parameters
-
cluster <~String> - short name or full Amazon Resource Name (ARN) of the cluster that your service is running on.
-
desiredCount <~Integer> - number of instantiations of the task that you would like to place and keep running in your service.
-
service <~String> - name of the service that you want to update.
-
taskDefinition <~String> - family and revision (family:revision) or full Amazon Resource Name (ARN) of the task definition that you want to run in your service.
Returns
-
response<~Excon::Response>:
-
body<~Hash>:
-
‘Service’<~Hash> - The full description of the updated cluster
-
-
18 19 20 21 22 23 |
# File 'lib/fog/aws/requests/ecs/update_service.rb', line 18 def update_service(params={}) request({ 'Action' => 'UpdateService', :parser => Fog::Parsers::AWS::ECS::UpdateService.new }.merge(params)) end |