# Compute Engine API . instanceGroups

## Instance Methods

Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network.

Retrieves the list of instance groups, and sorts them by zone.

Retrieves the next page of results.

Deletes the specified instance group.

Returns the specified instance group resource.

Creates an instance group in the specified project using the parameters that are included in the request.

Retrieves the list of instance groups that are located in the specified project and zone.

Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information.

Retrieves the next page of results.

Retrieves the next page of results.

Removes a list of instances from an instance group.

Sets the named ports in an instance group.

### Method Details

`addInstances(project, zone, instanceGroup, body)`

    Adds a list of instances to an instance group. All of the instances in the instance group must be in the same network.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group where you are adding instances. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "instances": [ # The instances to add to the instance group.
          {
            "instance": "A String",
          },
        ],
      }

    Returns:
      An object of the form:

        { # An Operation resource, used to manage asynchronous API requests.
        "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
        "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "zone": "A String", # [Output Only] URL of the zone where the operation resides.
        "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
        "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
        "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.
        "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
        "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
        "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
        "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
        "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
          {
            "message": "A String", # [Output Only] Optional human-readable details for this warning.
            "code": "A String", # [Output Only] The warning type identifier for this warning.
            "data": [ # [Output Only] Metadata for this warning in key: value format.
              {
                "value": "A String", # [Output Only] A warning data value corresponding to the key.
                "key": "A String", # [Output Only] A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource.
        "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
        "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
          "errors": [ # [Output Only] The array of errors encountered while processing this operation.
            {
              "message": "A String", # [Output Only] An optional, human-readable error message.
              "code": "A String", # [Output Only] The error type identifier for this error.
              "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
        "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
      }

`aggregatedList(project, maxResults=None, pageToken=None, filter=None)`

    Retrieves the list of instance groups, and sorts them by zone.

    Args:
      project: string, The project ID for this request. (required)
      maxResults: integer, Maximum count of results to be returned.
      pageToken: string, Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.
      filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.

    The FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.

    For example, filter=name ne example-instance.

    Returns:
      An object of the form:

        {
        "nextPageToken": "A String", # [Output Only] A token that is used to continue a truncated list request.
        "items": { # A map of scoped instance group lists.
          "a_key": { # The name of the scope that contains this set of instance groups.
            "warning": { # [Output Only] An informational warning that replaces the list of instance groups when the list is empty.
              "message": "A String", # [Output Only] Optional human-readable details for this warning.
              "code": "A String", # [Output Only] The warning type identifier for this warning.
              "data": [ # [Output Only] Metadata for this warning in key: value format.
                {
                  "value": "A String", # [Output Only] A warning data value corresponding to the key.
                  "key": "A String", # [Output Only] A key for the warning data.
                },
              ],
            },
            "instanceGroups": [ # [Output Only] The list of instance groups that are contained in this scope.
              {
                  "size": 42, # [Output Only] The total number of instances in the instance group.
                  "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups.
                  "description": "A String", # An optional text description for the instance group.
                  "zone": "A String", # The URL of the zone where the instance group is located.
                  "network": "A String", # The URL of the network to which all instances in the instance group belong.
                  "fingerprint": "A String", # [Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently.
                  "namedPorts": [ # Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: "http", port: 8080}] Named ports apply to all instances in this instance group.
                    { # The named port information. For example: .
                      "name": "A String", # The name for this NamedPort.
                      "port": 42, # The port number, which can be a value between 1 and 65535.
                    },
                  ],
                  "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format.
                  "id": "A String", # [Output Only] A unique identifier for this instance group. The server defines this identifier.
                  "selfLink": "A String", # [Output Only] The URL for this instance group. The server defines this URL.
                  "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.
                },
            ],
          },
        },
        "kind": "compute#instanceGroupAggregatedList", # [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.
        "id": "A String", # [Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier.
        "selfLink": "A String", # [Output Only] A unique identifier for this aggregated list of instance groups. The server defines this identifier.
      }

`aggregatedList_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.

`delete(project, zone, instanceGroup)`

    Deletes the specified instance group.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group to delete. (required)

    Returns:
      An object of the form:

        { # An Operation resource, used to manage asynchronous API requests.
        "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
        "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "zone": "A String", # [Output Only] URL of the zone where the operation resides.
        "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
        "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
        "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.
        "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
        "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
        "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
        "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
        "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
          {
            "message": "A String", # [Output Only] Optional human-readable details for this warning.
            "code": "A String", # [Output Only] The warning type identifier for this warning.
            "data": [ # [Output Only] Metadata for this warning in key: value format.
              {
                "value": "A String", # [Output Only] A warning data value corresponding to the key.
                "key": "A String", # [Output Only] A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource.
        "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
        "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
          "errors": [ # [Output Only] The array of errors encountered while processing this operation.
            {
              "message": "A String", # [Output Only] An optional, human-readable error message.
              "code": "A String", # [Output Only] The error type identifier for this error.
              "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
        "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
      }

`get(project, zone, instanceGroup)`

    Returns the specified instance group resource.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group. (required)

    Returns:
      An object of the form:

        {
          "size": 42, # [Output Only] The total number of instances in the instance group.
          "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups.
          "description": "A String", # An optional text description for the instance group.
          "zone": "A String", # The URL of the zone where the instance group is located.
          "network": "A String", # The URL of the network to which all instances in the instance group belong.
          "fingerprint": "A String", # [Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently.
          "namedPorts": [ # Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: "http", port: 8080}] Named ports apply to all instances in this instance group.
            { # The named port information. For example: .
              "name": "A String", # The name for this NamedPort.
              "port": 42, # The port number, which can be a value between 1 and 65535.
            },
          ],
          "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format.
          "id": "A String", # [Output Only] A unique identifier for this instance group. The server defines this identifier.
          "selfLink": "A String", # [Output Only] The URL for this instance group. The server defines this URL.
          "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.
        }

`insert(project, zone, body)`

    Creates an instance group in the specified project using the parameters that are included in the request.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "size": 42, # [Output Only] The total number of instances in the instance group.
        "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups.
        "description": "A String", # An optional text description for the instance group.
        "zone": "A String", # The URL of the zone where the instance group is located.
        "network": "A String", # The URL of the network to which all instances in the instance group belong.
        "fingerprint": "A String", # [Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently.
        "namedPorts": [ # Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: "http", port: 8080}] Named ports apply to all instances in this instance group.
          { # The named port information. For example: .
            "name": "A String", # The name for this NamedPort.
            "port": 42, # The port number, which can be a value between 1 and 65535.
          },
        ],
        "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format.
        "id": "A String", # [Output Only] A unique identifier for this instance group. The server defines this identifier.
        "selfLink": "A String", # [Output Only] The URL for this instance group. The server defines this URL.
        "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.
      }

    Returns:
      An object of the form:

        { # An Operation resource, used to manage asynchronous API requests.
        "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
        "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "zone": "A String", # [Output Only] URL of the zone where the operation resides.
        "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
        "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
        "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.
        "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
        "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
        "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
        "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
        "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
          {
            "message": "A String", # [Output Only] Optional human-readable details for this warning.
            "code": "A String", # [Output Only] The warning type identifier for this warning.
            "data": [ # [Output Only] Metadata for this warning in key: value format.
              {
                "value": "A String", # [Output Only] A warning data value corresponding to the key.
                "key": "A String", # [Output Only] A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource.
        "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
        "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
          "errors": [ # [Output Only] The array of errors encountered while processing this operation.
            {
              "message": "A String", # [Output Only] An optional, human-readable error message.
              "code": "A String", # [Output Only] The error type identifier for this error.
              "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
        "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
      }

`list(project, zone, maxResults=None, pageToken=None, filter=None)`

    Retrieves the list of instance groups that are located in the specified project and zone.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      maxResults: integer, Maximum count of results to be returned.
      pageToken: string, Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.
      filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.

    The FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.

    For example, filter=name ne example-instance.

    Returns:
      An object of the form:

        { # A list of InstanceGroup resources.
        "nextPageToken": "A String", # [Output Only] A token that is used to continue a truncated list request.
        "items": [ # A list of InstanceGroup resources.
          {
              "size": 42, # [Output Only] The total number of instances in the instance group.
              "kind": "compute#instanceGroup", # [Output Only] The resource type, which is always compute#instanceGroup for instance groups.
              "description": "A String", # An optional text description for the instance group.
              "zone": "A String", # The URL of the zone where the instance group is located.
              "network": "A String", # The URL of the network to which all instances in the instance group belong.
              "fingerprint": "A String", # [Output Only] The fingerprint of the named ports information. The system uses this fingerprint to detect conflicts when multiple users change the named ports information concurrently.
              "namedPorts": [ # Assigns a name to a port number. For example: {name: ?http?, port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: ?http?, port: 80},{name: "http", port: 8080}] Named ports apply to all instances in this instance group.
                { # The named port information. For example: .
                  "name": "A String", # The name for this NamedPort.
                  "port": 42, # The port number, which can be a value between 1 and 65535.
                },
              ],
              "creationTimestamp": "A String", # [Output Only] The creation timestamp for this instance group in RFC3339 text format.
              "id": "A String", # [Output Only] A unique identifier for this instance group. The server defines this identifier.
              "selfLink": "A String", # [Output Only] The URL for this instance group. The server defines this URL.
              "name": "A String", # The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.
            },
        ],
        "kind": "compute#instanceGroupList", # [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists.
        "id": "A String", # [Output Only] A unique identifier for this list of instance groups. The server defines this identifier.
        "selfLink": "A String", # [Output Only] The URL for this instance group. The server defines this URL.
      }

`listInstances(project, zone, instanceGroup, body, maxResults=None, pageToken=None, filter=None)`

    Lists instances in an instance group. The parameters for this method specify whether the list filters instances by state and named ports information.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group from which you want to generate a list of included instances. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "instanceState": "A String", # A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state.
      }

      maxResults: integer, Maximum count of results to be returned.
      pageToken: string, Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.
      filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.

    The FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.

    For example, filter=name ne example-instance.

    Returns:
      An object of the form:

        {
        "nextPageToken": "A String", # [Output Only] A token that is used to continue a truncated list request.
        "items": [ # A list of InstanceWithNamedPorts resources, which contains all named ports for the given instance.
          {
            "status": "A String", # The status of the instance.
            "instance": "A String", # The URL of the instance.
            "namedPorts": [ # The named ports that belong to this instance group.
              { # The named port information. For example: .
                "name": "A String", # The name for this NamedPort.
                "port": 42, # The port number, which can be a value between 1 and 65535.
              },
            ],
          },
        ],
        "kind": "compute#instanceGroupsListInstances", # [Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups.
        "id": "A String", # [Output Only] A unique identifier for this list of instance groups. The server defines this identifier.
        "selfLink": "A String", # [Output Only] The URL for this list of instance groups. The server defines this URL.
      }

`listInstances_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.

`removeInstances(project, zone, instanceGroup, body)`

    Removes a list of instances from an instance group.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group where the specified instances will be removed. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "instances": [ # The instances to remove from the instance group.
          {
            "instance": "A String",
          },
        ],
      }

    Returns:
      An object of the form:

        { # An Operation resource, used to manage asynchronous API requests.
        "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
        "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "zone": "A String", # [Output Only] URL of the zone where the operation resides.
        "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
        "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
        "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.
        "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
        "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
        "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
        "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
        "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
          {
            "message": "A String", # [Output Only] Optional human-readable details for this warning.
            "code": "A String", # [Output Only] The warning type identifier for this warning.
            "data": [ # [Output Only] Metadata for this warning in key: value format.
              {
                "value": "A String", # [Output Only] A warning data value corresponding to the key.
                "key": "A String", # [Output Only] A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource.
        "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
        "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
          "errors": [ # [Output Only] The array of errors encountered while processing this operation.
            {
              "message": "A String", # [Output Only] An optional, human-readable error message.
              "code": "A String", # [Output Only] The error type identifier for this error.
              "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
        "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
      }

`setNamedPorts(project, zone, instanceGroup, body)`

    Sets the named ports in an instance group.

    Args:
      project: string, The project ID for this request. (required)
      zone: string, The URL of the zone where the instance group is located. (required)
      instanceGroup: string, The name of the instance group where the named ports are updated. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "namedPorts": [ # The list of named ports to set for this instance group.
          { # The named port information. For example: .
            "name": "A String", # The name for this NamedPort.
            "port": 42, # The port number, which can be a value between 1 and 65535.
          },
        ],
        "fingerprint": "A String", # The fingerprint of the named ports information, which is a hash of the contents. Use this field for optimistic locking when you update the named ports entries.
      }

    Returns:
      An object of the form:

        { # An Operation resource, used to manage asynchronous API requests.
        "targetId": "A String", # [Output Only] Unique target ID which identifies a particular incarnation of the target.
        "clientOperationId": "A String", # [Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project.
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
        "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
        "zone": "A String", # [Output Only] URL of the zone where the operation resides.
        "operationType": "A String", # [Output Only] Type of the operation, such as insert, update, and delete.
        "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND.
        "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should monotonically increase as the operation progresses.
        "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as 404.
        "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
        "status": "A String", # [Output Only] Status of the operation. Can be one of the following: PENDING, RUNNING, or DONE.
        "insertTime": "A String", # [Output Only] The time that this operation was requested. This is in RFC3339 text format.
        "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
          {
            "message": "A String", # [Output Only] Optional human-readable details for this warning.
            "code": "A String", # [Output Only] The warning type identifier for this warning.
            "data": [ # [Output Only] Metadata for this warning in key: value format.
              {
                "value": "A String", # [Output Only] A warning data value corresponding to the key.
                "key": "A String", # [Output Only] A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com.
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC3339 text format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#Operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource.
        "region": "A String", # [Output Only] URL of the region where the operation resides. Only applicable for regional resources.
        "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
          "errors": [ # [Output Only] The array of errors encountered while processing this operation.
            {
              "message": "A String", # [Output Only] An optional, human-readable error message.
              "code": "A String", # [Output Only] The error type identifier for this error.
              "location": "A String", # [Output Only] Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # [Output Only] The time that this operation was completed. This is in RFC3339 text format.
        "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating.
      }