# 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.

### 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.
          },
        ],
        "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", # Unique target id which identifies a particular incarnation of the target (output only).
        "clientOperationId": "A String", # An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project (output only).
        "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).
        "zone": "A String", # URL of the zone where the operation resides (output only).
        "operationType": "A String", # Type of the operation. Examples include "insert", "update", and "delete" (output only).
        "httpErrorMessage": "A String", # If operation fails, the HTTP error message returned, e.g. NOT FOUND. (output only).
        "progress": 42, # 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 (output only).
        "httpErrorStatusCode": 42, # If operation fails, the HTTP error status code returned, e.g. 404. (output only).
        "statusMessage": "A String", # An optional textual description of the current status of the operation (output only).
        "status": "A String", # Status of the operation. Can be one of the following: "PENDING", "RUNNING", or "DONE" (output only).
        "insertTime": "A String", # The time that this operation was requested. This is in RFC 3339 format (output only).
        "warnings": [ # If warning messages generated during processing of this operation, this field will be populated (output only).
          {
            "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", # User who requested the operation, for example "user@example.com" (output only).
        "startTime": "A String", # The time that this operation was started by the server. This is in RFC 3339 format (output only).
        "kind": "compute#operation", # Type of the resource.
        "name": "A String", # Name of the resource (output only).
        "region": "A String", # URL of the region where the operation resides (output only).
        "error": { # If errors occurred during processing of this operation, this field will be populated (output only).
          "errors": [ # The array of errors encountered while processing this operation.
            {
              "message": "A String", # An optional, human-readable error message.
              "code": "A String", # The error type identifier for this error.
              "location": "A String", # Indicates the field in the request which caused the error. This property is optional.
            },
          ],
        },
        "endTime": "A String", # The time that this operation was completed. This is in RFC 3339 format (output only).
        "selfLink": "A String", # Server defined URL for the resource (output only).
        "targetLink": "A String", # URL of the resource the operation is mutating (output only).
      }