You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::EC2::PlacementGroup

Inherits:
Resources::Resource show all
Defined in:
(unknown)

Instance Attribute Summary collapse

Attributes inherited from Resources::Resource

#client, #identifiers

Instance Method Summary collapse

Methods inherited from Resources::Resource

add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until

Methods included from Resources::OperationMethods

#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations

Constructor Details

#initialize(name, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object

Overloads:

  • #initialize(name, options = {}) ⇒ Object

    Parameters:

    • name (String)

    Options Hash (options):

    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

  • #initialize(options = {}) ⇒ Object

    Options Hash (options):

    • :name (required, String)
    • :client (Client)

      When `:client is not given, the options hash is used to construct a new Client object.

Instance Attribute Details

#group_idString (readonly)

The ID of the placement group.

Returns:

  • (String)

    The ID of the placement group.

#group_nameString (readonly)

The name of the placement group.

Returns:

  • (String)

    The name of the placement group.

#nameString (readonly)

Returns:

  • (String)

#partition_countInteger (readonly)

The number of partitions. Valid only if strategy is set to partition.

Returns:

  • (Integer)

    The number of partitions.

#stateString (readonly)

The state of the placement group.

Possible values:

  • pending
  • available
  • deleting
  • deleted

Returns:

  • (String)

    The state of the placement group.

#strategyString (readonly)

The placement strategy.

Possible values:

  • cluster
  • spread
  • partition

Returns:

  • (String)

    The placement strategy.

#tagsArray<Types::Tag> (readonly)

Any tags applied to the placement group.

Returns:

  • (Array<Types::Tag>)

    Any tags applied to the placement group.

Instance Method Details

#delete(options = {}) ⇒ Struct

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. For more information, see Placement groups in the Amazon Elastic Compute Cloud User Guide.

Examples:

Request syntax example with placeholder values


placementgroup.delete({
  dry_run: false,
})

Options Hash (options):

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#instances(options = {}) ⇒ Collection<Instance>

Returns a Collection of Instance resources. No API requests are made until you call an enumerable method on the collection. Client#describe_instances will be called multiple times until every Instance has been yielded.

Examples:

Request syntax example with placeholder values


placementgroup.instances({
  instance_ids: ["InstanceId"],
  dry_run: false,
  max_results: 1,
  next_token: "String",
})

Enumerating Instance resources.

placementgroup.instances.each do |instance|
  # yields each instance
end

Enumerating Instance resources with a limit.

placementgroup.instances.limit(10).each do |instance|
  # yields at most 10 instances
end

Batch operations callable on the returned collection


# calls Client#create_tags on each batch
placementgroup.instances.batch_create_tags

# calls Client#delete_tags on each batch
placementgroup.instances.batch_delete_tags!

# calls Client#monitor_instances on each batch
placementgroup.instances.batch_monitor

# calls Client#reboot_instances on each batch
placementgroup.instances.batch_reboot

# calls Client#start_instances on each batch
placementgroup.instances.batch_start

# calls Client#stop_instances on each batch
placementgroup.instances.batch_stop

# calls Client#terminate_instances on each batch
placementgroup.instances.batch_terminate!

# calls Client#unmonitor_instances on each batch
placementgroup.instances.batch_unmonitor

Options Hash (options):

  • :instance_ids (Array<String>)

    The instance IDs.

    Default: Describes all your instances.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • :max_results (Integer)

    The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value. This value can be between 5 and 1000. You cannot specify this parameter and the instance IDs parameter in the same call.

  • :next_token (String)

    The token to request the next page of results.

Returns:

See Also: