org.jclouds.privatechef
Interface PrivateChefApi


public interface PrivateChefApi

Provides synchronous access to the Private Chef.

Author:
Adrian Cole
See Also:
PrivateChefAsyncApi,

Method Summary
 Organization createOrganization(Organization organization)
          creates a new organization
 User createUser(User user)
          creates a new user
 Organization deleteOrganization(String organizationname)
          deletes an existing organization.
 User deleteUser(String username)
          deletes an existing user.
 PatchedChefApi getChefApi()
           
 Organization getOrganization(String organizationname)
          retrieves an existing organization.
 User getUser(String username)
          retrieves an existing user.
 Set<String> listOrganizations()
           
 Set<String> listUsers()
           
 boolean organizationExists(String name)
           
 Organization updateOrganization(Organization organization)
          updates an existing organization.
 User updateUser(User user)
          updates an existing user.
 boolean userExists(String name)
           
 

Method Detail

getChefApi

PatchedChefApi getChefApi()

listUsers

Set<String> listUsers()
Returns:
list of user names.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have rights to list users.


userExists

boolean userExists(String name)
Returns:
true if the specified user name exists.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have rights to view the user.


createUser

User createUser(User user)
creates a new user

Returns:
the private key of the user. You can then use this user name and private key to access the Opscode API.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if the caller is not a recognized user.

"403 Forbidden" if the caller is not authorized to create a user.


updateUser

User updateUser(User user)
updates an existing user. Note: you must have update rights on the user.

Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have Update rights on the user.

org.jclouds.rest.ResourceNotFoundException - if the user does not exist.

getUser

User getUser(String username)
retrieves an existing user. Note: you must have update rights on the user.

Returns:
null, if the user is not found

deleteUser

User deleteUser(String username)
deletes an existing user. Note: you must have delete rights on the user.

Returns:
last state of the user you deleted or null, if not found
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have Delete rights on the user.


listOrganizations

Set<String> listOrganizations()
Returns:
list of organization names.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have rights to list organizations.


organizationExists

boolean organizationExists(String name)
Returns:
true if the specified organization name exists.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized user.

"403 Forbidden" if you do not have rights to view the organization.


createOrganization

Organization createOrganization(Organization organization)
creates a new organization

Returns:
the private key of the organization. You can then use this organization name and private key to access the Opscode API.
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if the caller is not a recognized organization.

"403 Forbidden" if the caller is not authorized to create a organization.


updateOrganization

Organization updateOrganization(Organization organization)
updates an existing organization. Note: you must have update rights on the organization.

Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized organization.

"403 Forbidden" if you do not have Update rights on the organization.

org.jclouds.rest.ResourceNotFoundException - if the organization does not exist.

getOrganization

Organization getOrganization(String organizationname)
retrieves an existing organization. Note: you must have update rights on the organization.

Returns:
null, if the organization is not found

deleteOrganization

Organization deleteOrganization(String organizationname)
deletes an existing organization. Note: you must have delete rights on the organization.

Returns:
last state of the org you deleted or null, if not found
Throws:
org.jclouds.rest.AuthorizationException -

"401 Unauthorized" if you are not a recognized organization.

"403 Forbidden" if you do not have Delete rights on the organization.



Copyright © 2013 jclouds. All Rights Reserved.