public class InfrastructureManager extends Object
Constructor and Description |
---|
InfrastructureManager(String targetUrl,
AuthorizationHeader authorizationHeader)
Create a new IM client.
|
InfrastructureManager(String targetUrl,
Path authFile)
Create a new IM client.
|
InfrastructureManager(String targetUrl,
String authorizationHeader)
Create a new IM client.
|
Modifier and Type | Method and Description |
---|---|
InfrastructureUris |
addResource(String infId,
String radlFile,
BodyContentType bodyContentType,
boolean... context)
Add the resources specified in the body contents to the infrastructure with
ID 'infId'.
|
VirtualMachineInfo |
alterVm(String infId,
String vmId,
String radlFile,
BodyContentType bodyContentType)
Change the features of the virtual machine with ID 'vmId' in the
infrastructure with with ID 'infId', specified by the RADL document
specified in the body contents.
Return a RADL with information about the virtual machine, like GetVMInfo. |
InfrastructureUri |
createInfrastructure(String infrastructureDefinition,
BodyContentType bodyContentType)
Create and configure an infrastructure with the requirements specified in
the document of the body contents.
If success, it is returned the URI of the new infrastructure. |
void |
destroyInfrastructure(String infId)
Undeploy the virtual machines associated to the infrastructure with ID
'infId'.
|
Property |
getInfrastructureContMsg(String infId)
Return the contextualization log associated to the infrastructure with ID
'infId'.
|
InfrastructureUris |
getInfrastructureInfo(String infId)
Return a list of URIs referencing the virtual machines associated to the
infrastructure with ID 'infId'.
|
InfrastructureUris |
getInfrastructureList()
Return a list of URIs referencing the infrastructures associated to the IM
user.
|
InfOutputValues |
getInfrastructureOutputs(String infId)
Return a class that includes the outputs defined in the TOSCA document.
|
Property |
getInfrastructureRadl(String infId)
Return a json with the original RADL specified to create the infrastructure
with ID 'infId'.
|
InfrastructureState |
getInfrastructureState(String infId)
Return a JSON with the infrastructure and virtual machines states.
The JSON has a 'vm_states' array describing the states of all the machines of the infrastructure and a 'state' that describes the general state of the infrastructure ( e.g. |
VirtualMachineInfo |
getVmInfo(String infId,
String vmId)
Return information about the virtual machine with ID vmId associated to the
infrastructure with ID infId.
|
Property |
getVmProperty(String infId,
String vmId,
VmProperties vmProperty)
Return property 'propertyName' from to the virtual machine with ID 'vmId'
associated to the infrastructure with ID 'infId'.
|
void |
reconfigure(String infId)
Perform the reconfigure action in all the virtual machines in the the
infrastructure with ID 'infID'.
This method starts the contextualization process again. To reconfigure the VMs see the reconfigure methods that include the 'radl' parameter. |
void |
reconfigure(String infId,
String radlFile,
BodyContentType bodyContentType)
Perform the reconfigure action in all the virtual machines of the
infrastructure with ID 'infID.' It updates the configuration of the
infrastructure as indicated in the 'radlFile'.
|
void |
reconfigure(String infId,
String radlFile,
BodyContentType bodyContentType,
List<Integer> vmList)
Perform the reconfigure action in all the virtual machines of the
infrastructure with ID 'infID.' It updates the configuration of the
infrastructure as indicated in the 'radlFile'.
|
void |
removeResource(String infId,
List<String> vmIds,
boolean... context)
Undeploy the virtual machine with ID 'vmId' associated to the
infrastructure with ID 'infId'.
|
void |
removeResource(String infId,
String vmId,
boolean... context)
Undeploy the virtual machine with ID vmId associated to the infrastructure
with ID 'infId'.
The context parameter is optional and is a flag to specify if the contextualization step will be launched just after the VM addition. As default the contextualization flag is set to True. |
void |
startInfrastructure(String infId)
Resume all the virtual machines associated to the infrastructure with ID
'infId', previously stopped with the 'stopInfrastructure' method.
|
void |
startVm(String infId,
String vmId)
Perform the 'start' action in the virtual machine with ID 'vmId' associated
to the infrastructure with ID 'infId'.
|
void |
stopInfrastructure(String infId)
Stop (but do not undeploy) all the virtual machines associated to the
infrastructure with ID 'infId'.
|
void |
stopVm(String infId,
String vmId)
Perform the 'stop' action in the virtual machine with ID 'vmId' associated
to the infrastructure with ID 'infId'.
|
public InfrastructureManager(String targetUrl, Path authFile) throws ImClientException
targetUrl
- : the URL where the REST API of the IM is definedauthFile
- : the authorization fileImClientException
public InfrastructureManager(String targetUrl, String authorizationHeader) throws ImClientException
targetUrl
- : the URL where the REST API of the IM is definedauthorizationHeader
- : string with the authorization contentImClientException
public InfrastructureManager(String targetUrl, AuthorizationHeader authorizationHeader) throws ImClientException
targetUrl
- : the URL where the REST API of the IM is definedauthorizationHeader
- : AuthorizationHeader
with the authorization contentImClientException
public InfrastructureUri createInfrastructure(String infrastructureDefinition, BodyContentType bodyContentType) throws ImClientException
infrastructureDefinition
- : file with the virtual machine properties and configurationbodyContentType
- : set the body content type. Can be RADL, RADL_JSON or TOSCA.ImClientException
public InfrastructureUris getInfrastructureList() throws ImClientException
ImClientException
public InfrastructureUris getInfrastructureInfo(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public VirtualMachineInfo getVmInfo(String infId, String vmId) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idImClientException
public Property getVmProperty(String infId, String vmId, VmProperties vmProperty) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idvmProperty
- : VM property to retrieve from the virtual machineImClientException
public Property getInfrastructureContMsg(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public Property getInfrastructureRadl(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public InfrastructureState getInfrastructureState(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public void destroyInfrastructure(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public InfrastructureUris addResource(String infId, String radlFile, BodyContentType bodyContentType, boolean... context) throws ImClientException
infId
- : infrastructure idradlFile
- : file with the virtual machine properties and configurationbodyContentType
- : set the body content type. Can be RADL, RADL_JSON or TOSCA.context
- : flag to specify if the contextualization step will be launched
just after the VM additionImClientException
public void removeResource(String infId, List<String> vmIds, boolean... context) throws ImClientException
infId
- : infrastructure idvmIds
- : list of virtual machine idscontext
- : flag to specify if the contextualization step will be launched
just after the VM additionImClientException
- : exception in the IM clientpublic void removeResource(String infId, String vmId, boolean... context) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idcontext
- : flag to specify if the contextualization step will be launched
just after the VM additionImClientException
public void stopInfrastructure(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public void startInfrastructure(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public void stopVm(String infId, String vmId) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idImClientException
public void startVm(String infId, String vmId) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idImClientException
public VirtualMachineInfo alterVm(String infId, String vmId, String radlFile, BodyContentType bodyContentType) throws ImClientException
infId
- : infrastructure idvmId
- : virtual machine idradlFile
- : file with the virtual machine properties and configurationbodyContentType
- : set the body content type. Can be RADL or RADL_JSONImClientException
public void reconfigure(String infId) throws ImClientException
infId
- : infrastructure idImClientException
public void reconfigure(String infId, String radlFile, BodyContentType bodyContentType) throws ImClientException
infId
- : infrastructure idradlFile
- : file with the infrastructure properties and configurationbodyContentType
- : set the body content type. Can be RADL or RADL_JSONImClientException
public void reconfigure(String infId, String radlFile, BodyContentType bodyContentType, List<Integer> vmList) throws ImClientException
infId
- : infrastructure idradlFile
- : file with the infrastructure properties and configurationbodyContentType
- : set the body content type. Can be RADL or RADL_JSONvmList
- : comma separated list of IDs of the VMs to reconfigure. If not
specified all the VMs will be reconfigured.ImClientException
public InfOutputValues getInfrastructureOutputs(String infId) throws ImClientException
infId
- : infrastructure idImClientException
Copyright © 2016. All rights reserved.