Modify Image Attribute operation for the Amazon EC2 REST adapter

The Modify Image Attribute operation enables you to modify an attribute of an Amazon Machine Image (AMI).

The following figure shows a sample <items> XML element for the Modify Image Attribute operation:

Sample <items> XML element for the Modify Image Attribute operation
<items>
    <item>
        <parameters>
            <image-id></image-id>
            <!--You have a CHOICE of the next 3 items at this level-->
            <launch-permission>
                <!--You have a CHOICE of the next 2 items at this level-->
                <add>
                    <!--Zero or more repetition -->
                    <item>
                        <user-id></user-id>
                    </item>
                    <item>
                        <group></group>
                    </item>
                </add>
            </launch-permission>
            <product-codes>
                <!--Zero or more repetition -->
                <item>
                    <product-code></product-code>
                </item>
            </product-codes>
            <description>
                <value></value>
            </description>
        </parameters>
    </item>
</items>

The following table describes the elements for this adapter request:

Adapter request elements for the Modify Image Attribute operation

Element

Definition

Required

<access-key>

Specifies the Amazon Web Services (AWS) access key

You need to generate the AWS access key by going to the Security Credentials tab in the AWS console.

Conditional;

  • You must specify the Access Key and the Secret Key together in the configuration or the adapter request.
  • If you specify both the keys in the adapter request and in the adapter configuration, the key values in the request override the values in the configuration.
  • If only the Access Key is specified, the adapter ignores the value.
<secret-key>

Specifies the AWS secret access key

You need to generate the AWS secret access key by going to the Security Credentials tab in the AWS console.

Conditional;

  • You must specify the Access Key and theSecret Key together in the configuration or the adapter request.
  • If you specify both the keys in the adapter request and in the adapter configuration, the key values in the request override the values in the configuration.
  • If only the Secret Access Key is specified, the adapter ignores the value.
<region>

Specifies the region with which you want the adapter to communicate

Amazon EC2 is hosted in multiple locations world-wide. You must specify the region in which you want the adapter to perform the actions.

Valid values:

  • us-east-1
  • us-west-2 (default)
  • us-west-1
  • eu-west-1
  • ap-southeast-1
  • ap-northeast-1
  • ap-southeast-2
  • sa-east-1
No

<operation-name>

Contains the name of the operation: modify-image-attribute

Yes

<image-id>

Specifies the ID of the AMI whose attribute is to be modified

Yes

<description>

Specifies the description of the AMI provided during image creation

No

<launch-permission>

Specifies the launch permissions associated with the AMI

  • add: Adds permission
  • remove: Removes permission
  • user-id: Specifies the Amazon Web Services (AWS) Access Key ID
  • group: Specifies the name of the group. Currently, supports the allgroup.

    Note

    You can use either add or remove permission. Do not use both, add and remove permissions together.

No

<product-codes>

Specifies the product code associated with the AMI

No

The following figure shows a sample adapter request for the Modify Image Attribute operation:

Sample adapter request for the Modify Image Attribute operation

 <amazon-ec2-rest-request>
    <operation-name>modify-image-attribute</operation-name>
    <parameters>
      <image-id>ami-b8cea688</image-id>
      <launch-permission>
        <add>
          <item>
            <user-id>246495073671</user-id>
          </item>
          <item>
            <group />
          </item>
        </add>
      </launch-permission>
    </parameters>
  </amazon-ec2-rest-request>

The following figure shows a sample adapter response for the Modify Image Attribute operation:

Sample adapter response for the Modify Image Attribute operation

 <amazon-ec2-rest-response>
  <metadata>
    <status>success</status>
  </metadata>
  <ModifyImageAttributeResponse>
    <return>true</return>
  </ModifyImageAttributeResponse>
</amazon-ec2-rest-response>
Was this page helpful? Yes No Submitting... Thank you

Comments