# Compute Engine API . projects

## Instance Methods

Returns the specified project resource.

Moves a persistent disk from one zone to another.

Moves an instance and its attached persistent disks from one zone to another.

Sets metadata common to all instances within the specified project using the data included in the request.

Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.

### Method Details

`get(project)`

    Returns the specified project resource.

    Args:
      project: string, Project ID for this request. (required)

    Returns:
      An object of the form:

        { # A Project resource. Projects can only be created in the Google Developers Console. Unless marked otherwise, values can only be modified in the console.
        "kind": "compute#project", # [Output Only] Type of the resource. Always compute#project for projects.
        "description": "A String", # An optional textual description of the resource.
        "commonInstanceMetadata": { # A metadata key/value entry. # Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information.
          "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
            {
              "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
              "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
            },
          ],
          "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
          "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
        },
        "quotas": [ # [Output Only] Quotas assigned to this project.
          { # A quotas entry.
            "usage": 3.14, # [Output Only] Current usage of this metric.
            "metric": "A String", # [Output Only] Name of the quota metric.
            "limit": 3.14, # [Output Only] Quota limit for this metric.
          },
        ],
        "usageExportLocation": { # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. # The location in Cloud Storage and naming method of the daily usage report.
            "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This is just the bucket name, with no gs:// or https://storage.googleapis.com/ in front of it.
            "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
          },
        "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.
        "selfLink": "A String", # [Output Only] Server defined URL for the resource.
        "name": "A String", # Name of the resource.
      }

`moveDisk(project, body)`

    Moves a persistent disk from one zone to another.

    Args:
      project: string, Project ID for this request. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "targetDisk": "A String", # The URL of the target disk to be moved.
        "destinationZone": "A String", # The URL of the zone to which the disk will be moved.
      }

    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 be monotonically increasing 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.
      }

`moveInstance(project, body)`

    Moves an instance and its attached persistent disks from one zone to another.

    Args:
      project: string, Project ID for this request. (required)
      body: object, The request body. (required)
        The object takes the form of:

    {
        "targetInstance": "A String", # The URL of the target instance to move.
        "destinationZone": "A String", # The URL of the zone to move the instance to.
      }

    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 be monotonically increasing 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.
      }

`setCommonInstanceMetadata(project, body)`

    Sets metadata common to all instances within the specified project using the data included in the request.

    Args:
      project: string, Project ID for this request. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # A metadata key/value entry.
      "items": [ # Array of key/value pairs. The total size of all keys and values must be less than 512 KB.
        {
          "value": "A String", # Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 32768 bytes.
          "key": "A String", # Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project.
        },
      ],
      "kind": "compute#metadata", # [Output Only] Type of the resource. Always compute#metadata for metadata.
      "fingerprint": "A String", # Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata.
    }

    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 be monotonically increasing 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.
      }

`setUsageExportBucket(project, body)`

    Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.

    Args:
      project: string, Project ID for this request. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix.
        "bucketName": "A String", # The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This is just the bucket name, with no gs:// or https://storage.googleapis.com/ in front of it.
        "reportNamePrefix": "A String", # An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions.
      }

    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 be monotonically increasing 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.
      }