org.jclouds.googlecomputeengine.features
Interface ProjectApi


public interface ProjectApi

Provides access to Projects via their REST API.

Author:
David Alves
See Also:

Method Summary
 Project get(String projectName)
          Returns the specified project resource.
 Operation setCommonInstanceMetadata(String projectName, Map<String,String> metadata, String fingerprint)
          Sets metadata common to all instances within the specified project using the data included in the request.
 

Method Detail

get

@Named(value="Projects:get")
Project get(String projectName)
Returns the specified project resource.

Parameters:
projectName - name of the project to return
Returns:
if successful, this method returns a Project resource

setCommonInstanceMetadata

@Named(value="Projects:setCommonInstanceMetadata")
Operation setCommonInstanceMetadata(String projectName,
                                          Map<String,String> metadata,
                                          String fingerprint)
Sets metadata common to all instances within the specified project using the data included in the request.

NOTE: This *sets* metadata items on the project (vs *adding* items to metadata), if there are pre-existing metadata items that must be kept these must be fetched first and then re-set on the new Metadata, e.g.


    Metadata.Builder current = projectApi.get("myProject").getCommonInstanceMetadata().toBuilder();
    current.addItem("newItem","newItemValue");
    projectApi.setCommonInstanceMetadata(current.build());
 

Parameters:
projectName - name of the project to return
metadata - the metadata to set
fingerprint - The current fingerprint for the metadata
Returns:
an Operations resource. To check on the status of an operation, poll the Operations resource returned to you, and look for the status field.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.