|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jclouds.chef.test.TransientChefApi
public class TransientChefApi
In-memory chef simulator.
| Method Summary | |
|---|---|
void |
close()
|
Sandbox |
commitSandbox(String id,
boolean isCompleted)
Confirms if the sandbox is completed or not. |
Client |
createClient(String clientName)
Creates a new client. |
Client |
createClient(String clientName,
CreateClientOptions options)
Creates a new client with custom options. |
void |
createDatabag(String databagName)
Creates a new data bag. |
DatabagItem |
createDatabagItem(String databagName,
DatabagItem databagItem)
Adds an item in a data bag. |
void |
createEnvironment(Environment environment)
Creates a new environment. |
void |
createNode(Node node)
Creates a new node. |
void |
createRole(Role role)
Creates a new role. |
UploadSandbox |
createUploadSandboxForChecksums(Set<List<Byte>> md5s)
Creates a new sandbox. |
Client |
deleteClient(String clientName)
Deletes the given client. |
CookbookVersion |
deleteCookbook(String cookbookName,
String version)
Deletes the given cookbook. |
void |
deleteDatabag(String databagName)
Deletes a data bag, including its items. |
DatabagItem |
deleteDatabagItem(String databagName,
String databagItemId)
Deletes an item from a data bag. |
Environment |
deleteEnvironment(String environmentName)
Deletes the given environment. |
Node |
deleteNode(String nodeName)
Deletes the given node. |
Role |
deleteRole(String rolename)
Deletes the given role. |
Client |
generateKeyForClient(String clientName)
Generates a new key-pair for this client, and return the new private key in the response body. |
Client |
getClient(String clientName)
Gets the details of existing client. |
CookbookVersion |
getCookbook(String cookbookName,
String version)
Gets the details of the given cookbook, with the links to each resource such as recipe files, attributes, etc. |
CookbookDefinition |
getCookbookInEnvironment(String environmentName,
String cookbookName)
Gets the definition of the cookbook in the given environment. |
CookbookDefinition |
getCookbookInEnvironment(String environmentName,
String cookbookName,
String numVersions)
Gets the definition of the cookbook in the given environment. |
DatabagItem |
getDatabagItem(String databagName,
String databagItemId)
Gets an item in a data bag. |
Environment |
getEnvironment(String environmentName)
Gets the details of an existing environment. |
Node |
getNode(String nodeName)
Gets the details of the given node. |
InputStream |
getResourceContents(Resource resource)
Gets the contents of the given resource. |
Role |
getRole(String roleName)
Gets the details of the given role. |
Set<String> |
listClients()
Lists the names of the existing clients. |
Set<String> |
listCookbooks()
Lists the names of the existing cookbooks. |
Set<CookbookDefinition> |
listCookbooksInEnvironment(String environmentName)
Lists the cookbooks that are available in the given environment. |
Set<CookbookDefinition> |
listCookbooksInEnvironment(String environmentName,
String numVersions)
Lists the cookbooks that are available in the given environment, limiting the number of versions returned for each cookbook. |
Set<String> |
listDatabagItems(String databagName)
Lists the names of the items in a data bag. |
Set<String> |
listDatabags()
Lists the names of the existing data bags. |
Set<String> |
listEnvironments()
Lists the names of the existing environments. |
Set<String> |
listNodes()
Lists the names of the existing nodes. |
Set<String> |
listNodesInEnvironment(String environmentName)
Lists the names of the nodes in the given environment. |
Set<String> |
listRecipesInEnvironment(String environmentName)
Lists the names of the recipes in the given environment. |
Set<String> |
listRoles()
Lists the names of the existing roles. |
Set<String> |
listSearchIndexes()
Lists the names of the available search indexes. |
Set<String> |
listVersionsOfCookbook(String cookbookName)
Lists the available versions of the given cookbook. |
SearchResult<? extends Client> |
searchClients()
Searches all clients. |
SearchResult<? extends Client> |
searchClients(SearchOptions options)
Searches all clients that match the given options. |
SearchResult<? extends DatabagItem> |
searchDatabagItems(String databagName)
Searches all items in a data bag. |
SearchResult<? extends DatabagItem> |
searchDatabagItems(String databagName,
SearchOptions options)
Searches all items in a data bag that match the given options. |
SearchResult<? extends Environment> |
searchEnvironments()
Searches all environments. |
SearchResult<? extends Environment> |
searchEnvironments(SearchOptions options)
Searches all environments that match the given options. |
SearchResult<? extends Node> |
searchNodes()
Searches all nodes. |
SearchResult<? extends Node> |
searchNodes(SearchOptions options)
Searches all nodes that match the given options. |
SearchResult<? extends Role> |
searchRoles()
Searches all roles. |
SearchResult<? extends Role> |
searchRoles(SearchOptions options)
Searches all roles that match the given options. |
CookbookVersion |
updateCookbook(String cookbookName,
String version,
CookbookVersion cookbook)
Creates or updates the given cookbook. |
DatabagItem |
updateDatabagItem(String databagName,
DatabagItem item)
Updates an item in a data bag. |
Environment |
updateEnvironment(Environment environment)
Updates the given environment. |
Node |
updateNode(Node node)
Updates an existing node. |
Role |
updateRole(Role role)
Updates the given role. |
void |
uploadContent(URI location,
org.jclouds.io.Payload content)
Uploads the given content to the sandbox at the given URI. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Sandbox commitSandbox(String id,
boolean isCompleted)
ChefApiThis method should be used after uploading contents to the sandbox.
commitSandbox in interface ChefApiid - The id of the sandbox to commit.isCompleted - Flag to set if the sandbox is completed or not.
public Client createClient(String clientName)
ChefApi
createClient in interface ChefApi
public Client createClient(String clientName,
CreateClientOptions options)
ChefApi
createClient in interface ChefApioptions - The options to customize the client creation.
public void createDatabag(String databagName)
ChefApi
createDatabag in interface ChefApidatabagName - The name for the new data bag.
public DatabagItem createDatabagItem(String databagName,
DatabagItem databagItem)
ChefApi
createDatabagItem in interface ChefApidatabagName - The name of the data bag.public void createNode(Node node)
ChefApi
createNode in interface ChefApinode - The details of the node to create.public void createRole(Role role)
ChefApi
createRole in interface ChefApirole - The details for the new role.public Client deleteClient(String clientName)
ChefApi
deleteClient in interface ChefApi
public CookbookVersion deleteCookbook(String cookbookName,
String version)
ChefApi
deleteCookbook in interface ChefApicookbookName - The name of the cookbook to delete.version - The version of the cookbook to delete.
public void deleteDatabag(String databagName)
ChefApi
deleteDatabag in interface ChefApidatabagName - The name of the data bag to delete.
public DatabagItem deleteDatabagItem(String databagName,
String databagItemId)
ChefApi
deleteDatabagItem in interface ChefApidatabagName - The name of the data bag.databagItemId - The identifier of the item to delete.
public Node deleteNode(String nodeName)
ChefApi
deleteNode in interface ChefApipublic Role deleteRole(String rolename)
ChefApi
deleteRole in interface ChefApipublic Client generateKeyForClient(String clientName)
ChefApi
generateKeyForClient in interface ChefApipublic Client getClient(String clientName)
ChefApi
getClient in interface ChefApi
public CookbookVersion getCookbook(String cookbookName,
String version)
ChefApi
getCookbook in interface ChefApicookbookName - The name of the cookbook.version - The version of the cookbook to get.
public DatabagItem getDatabagItem(String databagName,
String databagItemId)
ChefApi
getDatabagItem in interface ChefApidatabagName - The name of the data bag.databagItemId - The identifier of the item to get.
public Node getNode(String nodeName)
ChefApi
getNode in interface ChefApipublic Role getRole(String roleName)
ChefApi
getRole in interface ChefApipublic UploadSandbox createUploadSandboxForChecksums(Set<List<Byte>> md5s)
ChefApiIt accepts a list of checksums as input and returns the URLs against which to PUT files that need to be uploaded.
createUploadSandboxForChecksums in interface ChefApimd5s - The raw md5 sums. Uses Bytes.asList() and
Bytes.toByteArray() as necessary
public Set<String> listVersionsOfCookbook(String cookbookName)
ChefApi
listVersionsOfCookbook in interface ChefApicookbookName - The name of the cookbook.
public Set<String> listClients()
ChefApi
listClients in interface ChefApipublic Set<String> listCookbooks()
ChefApi
listCookbooks in interface ChefApipublic Set<String> listDatabagItems(String databagName)
ChefApi
listDatabagItems in interface ChefApidatabagName - The name of the data bag.
public Set<String> listDatabags()
ChefApi
listDatabags in interface ChefApipublic Set<String> listNodes()
ChefApi
listNodes in interface ChefApipublic Set<String> listRoles()
ChefApi
listRoles in interface ChefApipublic Set<String> listSearchIndexes()
ChefApiBy default, the "role", "node" and "api" indexes will always be available.
Note that the search indexes may lag behind the most current data by at least 10 seconds at any given time - so if you need to write data and immediately query it, you likely need to produce an artificial delay (or simply retry until the data is available).
listSearchIndexes in interface ChefApipublic SearchResult<? extends Client> searchClients()
ChefApiNote that without any request parameters this will return all of the data within the index.
searchClients in interface ChefApipublic SearchResult<? extends Client> searchClients(SearchOptions options)
ChefApi
searchClients in interface ChefApipublic SearchResult<? extends DatabagItem> searchDatabagItems(String databagName)
ChefApiNote that without any request parameters this will return all of the data within the index.
searchDatabagItems in interface ChefApi
public SearchResult<? extends DatabagItem> searchDatabagItems(String databagName,
SearchOptions options)
ChefApi
searchDatabagItems in interface ChefApipublic SearchResult<? extends Node> searchNodes()
ChefApiNote that without any request parameters this will return all of the data within the index.
searchNodes in interface ChefApipublic SearchResult<? extends Node> searchNodes(SearchOptions options)
ChefApi
searchNodes in interface ChefApipublic SearchResult<? extends Role> searchRoles()
ChefApiNote that without any request parameters this will return all of the data within the index.
searchRoles in interface ChefApipublic SearchResult<? extends Role> searchRoles(SearchOptions options)
ChefApi
searchRoles in interface ChefApi
public CookbookVersion updateCookbook(String cookbookName,
String version,
CookbookVersion cookbook)
ChefApi
updateCookbook in interface ChefApicookbookName - The name of the cookbook to create or update.version - The version of the cookbook to create or update.cookbook - The contents of the cookbook to create or update.
public DatabagItem updateDatabagItem(String databagName,
DatabagItem item)
ChefApi
updateDatabagItem in interface ChefApidatabagName - The name of the data bag.item - The new contents for the item in the data bag.
public Node updateNode(Node node)
ChefApi
updateNode in interface ChefApinode - The new details for the node.
public Role updateRole(Role role)
ChefApi
updateRole in interface ChefApirole - The new details for the role.
public void uploadContent(URI location,
org.jclouds.io.Payload content)
ChefApi
The URI must be obtained, after uploading a sandbox, from the
UploadSandbox.getUri().
uploadContent in interface ChefApilocation - The URI where the upload must be performed.content - The contents to upload.public InputStream getResourceContents(Resource resource)
ChefApi
getResourceContents in interface ChefApiresource - The resource to get.
public Set<String> listEnvironments()
ChefApi
listEnvironments in interface ChefApipublic void createEnvironment(Environment environment)
ChefApi
createEnvironment in interface ChefApienvironment - The environment to create.public Environment deleteEnvironment(String environmentName)
ChefApi
deleteEnvironment in interface ChefApipublic Environment getEnvironment(String environmentName)
ChefApi
getEnvironment in interface ChefApipublic Environment updateEnvironment(Environment environment)
ChefApi
updateEnvironment in interface ChefApienvironment - The new details for the environment.
public Set<CookbookDefinition> listCookbooksInEnvironment(String environmentName)
ChefApi
listCookbooksInEnvironment in interface ChefApi
public Set<CookbookDefinition> listCookbooksInEnvironment(String environmentName,
String numVersions)
ChefApi
listCookbooksInEnvironment in interface ChefApi
public CookbookDefinition getCookbookInEnvironment(String environmentName,
String cookbookName)
ChefApi
getCookbookInEnvironment in interface ChefApi
public CookbookDefinition getCookbookInEnvironment(String environmentName,
String cookbookName,
String numVersions)
ChefApi
getCookbookInEnvironment in interface ChefApipublic SearchResult<? extends Environment> searchEnvironments()
ChefApiNote that without any request parameters this will return all of the data within the index.
searchEnvironments in interface ChefApipublic SearchResult<? extends Environment> searchEnvironments(SearchOptions options)
ChefApi
searchEnvironments in interface ChefApipublic Set<String> listRecipesInEnvironment(String environmentName)
ChefApi
listRecipesInEnvironment in interface ChefApipublic Set<String> listNodesInEnvironment(String environmentName)
ChefApi
listNodesInEnvironment in interface ChefApi
public void close()
throws IOException
close in interface CloseableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||