# Compute Engine API . projects

## Instance Methods

Returns the specified project resource.

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

Sets usage export location

### Method Details

`get(project)`

    Returns the specified project resource.

    Args:
      project: string, Name of the project resource to retrieve. (required)

    Returns:
      An object of the form:

        { # A project resource. Projects can be created only in the APIs Console. Unless marked otherwise, values can only be modified in the console.
        "kind": "compute#project", # Type of the resource.
        "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.
          "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", # Type of the resource.
          "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify metadata.
        },
        "quotas": [ # Quotas assigned to this project.
          { # A quotas entry.
            "usage": 3.14, # Current usage of this metric.
            "metric": "A String", # Name of the quota metric.
            "limit": 3.14, # 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 simply 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 bucket_name. If not supplied, defaults to "usage_". The report is stored as a CSV file named _gce_.csv. where  is the day of the usage according to Pacific Time. The prefix should conform to Cloud Storage object naming conventions.
          },
        "creationTimestamp": "A String", # Creation timestamp in RFC3339 text format (output only).
        "id": "A String", # Unique identifier for the resource; defined by the server (output only).
        "selfLink": "A String", # Server defined URL for the resource (output only).
        "name": "A String", # Name of the resource.
      }

`setCommonInstanceMetadata(project, body)`

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

    Args:
      project: string, Name of the project scoping 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", # Type of the resource.
      "fingerprint": "A String", # Fingerprint of this resource. A hash of the metadata's contents. This field is used for optimistic locking. An up-to-date metadata fingerprint must be provided in order to modify 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",
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format (output only).
        "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 (output only).
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "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 RFC 3339 format.
        "warnings": [
          {
            "message": "A String", # Optional human-readable details for this warning.
            "code": "A String", # The warning type identifier for this warning.
            "data": [ # Metadata for this warning in 'key: value' format.
              {
                "value": "A String", # A warning data value corresponding to the key.
                "key": "A String", # A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC 3339 format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always kind#operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource (output only).
        "region": "A String", # [Output Only] URL of the region where the operation resides (output only).
        "error": { # [Output Only] If errors occurred during processing of this 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",
        "selfLink": "A String", # [Output Only] Server defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating (output only).
      }

`setUsageExportBucket(project, body)`

    Sets usage export location

    Args:
      project: string, Name of the project scoping 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 simply 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 bucket_name. If not supplied, defaults to "usage_". The report is stored as a CSV file named _gce_.csv. where  is the day of the usage according to Pacific Time. The prefix 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",
        "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format (output only).
        "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 (output only).
        "operationType": "A String",
        "httpErrorMessage": "A String",
        "progress": 42,
        "httpErrorStatusCode": 42,
        "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 RFC 3339 format.
        "warnings": [
          {
            "message": "A String", # Optional human-readable details for this warning.
            "code": "A String", # The warning type identifier for this warning.
            "data": [ # Metadata for this warning in 'key: value' format.
              {
                "value": "A String", # A warning data value corresponding to the key.
                "key": "A String", # A key for the warning data.
              },
            ],
          },
        ],
        "user": "A String",
        "startTime": "A String", # [Output Only] The time that this operation was started by the server. This is in RFC 3339 format.
        "kind": "compute#operation", # [Output Only] Type of the resource. Always kind#operation for Operation resources.
        "name": "A String", # [Output Only] Name of the resource (output only).
        "region": "A String", # [Output Only] URL of the region where the operation resides (output only).
        "error": { # [Output Only] If errors occurred during processing of this 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",
        "selfLink": "A String", # [Output Only] Server defined URL for the resource.
        "targetLink": "A String", # [Output Only] URL of the resource the operation is mutating (output only).
      }