Class SDKBaremetalCloudClient
java.lang.Object
com.oracle.cloud.baremetal.jenkins.client.SDKBaremetalCloudClient
- All Implemented Interfaces:
BaremetalCloudClient,AutoCloseable
An implementation of ComputeCloudClient using the JAX-RS client API.
-
Constructor Summary
ConstructorsConstructorDescriptionSDKBaremetalCloudClient(com.oracle.bmc.auth.BasicAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads, String tenantId) SDKBaremetalCloudClient(com.oracle.bmc.auth.BasicAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads, String tenantId, String userId) SDKBaremetalCloudClient(com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()com.oracle.bmc.core.model.InstancecreateInstance(String name, BaremetalCloudAgentTemplate template) Creates an instance with the specified templateList<com.oracle.bmc.identity.model.AvailabilityDomain>getAvailabilityDomainsList(String compartmentId) Get the available domain responseList<com.oracle.bmc.identity.model.Compartment>Get the compartment listprotected com.oracle.bmc.identity.IdentityClientList<com.oracle.bmc.core.model.Image>getImagesList(String compartmentId) Get the available image listgetInstanceIp(BaremetalCloudAgentTemplate template, String instanceId) Get an instance public or private ip with the specified instance idcom.oracle.bmc.core.model.Instance.LifecycleStategetInstanceState(String instanceId) Check instance's stateInteger[]getMinMaxMemory(String compartmentId, String availableDomain, String imageId, String shape) Get the memory options of Flex shapesInteger[]getMinMaxOcpus(String compartmentId, String availableDomain, String imageId, String shape) Get the OCPUs optionsList<com.oracle.bmc.core.model.NetworkSecurityGroup>getNsgIdsList(String compartmentId) Get the network security group listList<com.oracle.bmc.core.model.Shape>getShapesList(String compartmentId, String availableDomain, String imageId) Get the shape listList<com.oracle.bmc.core.model.Instance>getStoppedInstances(String compartmentId, String availableDomain) Get a list of stopped instances on OCIcom.oracle.bmc.core.responses.GetSubnetResponseGet the sub netList<com.oracle.bmc.core.model.Subnet>getSubNetList(String compartmentId, String vcnId) Get the sub net listList<com.oracle.bmc.identity.model.TagNamespaceSummary>getTagNamespaces(String compartmentId) Start instance with the specified instance idcom.oracle.bmc.identity.model.TenancyGet root compartmentList<com.oracle.bmc.core.model.Vcn>getVcnList(String compartmentId) Get the Virtual Cloud Network listcom.oracle.bmc.core.model.InstancestartInstance(String instanceId) Start instance with the specified instance idstopInstance(String instanceId) Stop instance with the specified instance idterminateInstance(String instanceId) Terminate instance with the specified instance idcom.oracle.bmc.core.model.InstancewaitForInstanceProvisioningToComplete(String instanceId) Creates an instance with the specified instance idcom.oracle.bmc.core.model.InstancewaitForInstanceTerminationToComplete(String instanceId) Wait for the termination with the specified instance id to complete
-
Constructor Details
-
SDKBaremetalCloudClient
-
SDKBaremetalCloudClient
-
SDKBaremetalCloudClient
public SDKBaremetalCloudClient(com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads)
-
-
Method Details
-
getIdentityClient
protected com.oracle.bmc.identity.IdentityClient getIdentityClient() -
authenticate
public void authenticate() throws com.oracle.bmc.model.BmcException- Specified by:
authenticatein interfaceBaremetalCloudClient- Throws:
com.oracle.bmc.model.BmcException- if an error occurs
-
createInstance
public com.oracle.bmc.core.model.Instance createInstance(String name, BaremetalCloudAgentTemplate template) throws Exception Description copied from interface:BaremetalCloudClientCreates an instance with the specified template- Specified by:
createInstancein interfaceBaremetalCloudClient- Parameters:
name- instance nametemplate- the instance configuration- Returns:
- Instance
- Throws:
Exception- if an error occurs
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
waitForInstanceProvisioningToComplete
public com.oracle.bmc.core.model.Instance waitForInstanceProvisioningToComplete(String instanceId) throws Exception Description copied from interface:BaremetalCloudClientCreates an instance with the specified instance id- Specified by:
waitForInstanceProvisioningToCompletein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Instance
- Throws:
Exception- if an error occurs
-
getInstanceIp
public String getInstanceIp(BaremetalCloudAgentTemplate template, String instanceId) throws Exception Description copied from interface:BaremetalCloudClientGet an instance public or private ip with the specified instance id- Specified by:
getInstanceIpin interfaceBaremetalCloudClient- Parameters:
template- baremetal cloud agent templateinstanceId- the instance id created before- Returns:
- the instance ip
- Throws:
Exception- if an error occurs
-
getTenant
Description copied from interface:BaremetalCloudClientGet root compartment- Specified by:
getTenantin interfaceBaremetalCloudClient- Returns:
- tenancy
- Throws:
Exception- if an error occurs
-
getCompartmentsList
Description copied from interface:BaremetalCloudClientGet the compartment list- Specified by:
getCompartmentsListin interfaceBaremetalCloudClient- Returns:
- compartment list
- Throws:
Exception- if an error occurs
-
getAvailabilityDomainsList
public List<com.oracle.bmc.identity.model.AvailabilityDomain> getAvailabilityDomainsList(String compartmentId) throws Exception Description copied from interface:BaremetalCloudClientGet the available domain response- Specified by:
getAvailabilityDomainsListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment id- Returns:
- ad list
- Throws:
Exception- if an error occurs
-
getImagesList
Description copied from interface:BaremetalCloudClientGet the available image list- Specified by:
getImagesListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment id- Returns:
- image list
- Throws:
Exception- if an error occurs
-
getShapesList
public List<com.oracle.bmc.core.model.Shape> getShapesList(String compartmentId, String availableDomain, String imageId) throws Exception Description copied from interface:BaremetalCloudClientGet the shape list- Specified by:
getShapesListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment idavailableDomain- available domainimageId- image id- Returns:
- shape list
- Throws:
Exception- if an error occurs
-
getMinMaxOcpus
public Integer[] getMinMaxOcpus(String compartmentId, String availableDomain, String imageId, String shape) throws Exception Description copied from interface:BaremetalCloudClientGet the OCPUs options- Specified by:
getMinMaxOcpusin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment idavailableDomain- available domainimageId- image idshape- shape name- Returns:
- an array with min (array[0]) and max (array[1])
- Throws:
Exception- if an error occurs
-
getMinMaxMemory
public Integer[] getMinMaxMemory(String compartmentId, String availableDomain, String imageId, String shape) throws Exception Description copied from interface:BaremetalCloudClientGet the memory options of Flex shapes- Specified by:
getMinMaxMemoryin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment idavailableDomain- available domainimageId- image idshape- shape name- Returns:
- an array with min (array[0]) and max (array[1])
- Throws:
Exception- if an error occurs
-
getVcnList
Description copied from interface:BaremetalCloudClientGet the Virtual Cloud Network list- Specified by:
getVcnListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the tenant id- Returns:
- vcn list
- Throws:
Exception- if an error occurs
-
getSubNetList
public List<com.oracle.bmc.core.model.Subnet> getSubNetList(String compartmentId, String vcnId) throws Exception Description copied from interface:BaremetalCloudClientGet the sub net list- Specified by:
getSubNetListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the tenant idvcnId- vcn id- Returns:
- subnet list
- Throws:
Exception- if an error occurs
-
getNsgIdsList
public List<com.oracle.bmc.core.model.NetworkSecurityGroup> getNsgIdsList(String compartmentId) throws Exception Description copied from interface:BaremetalCloudClientGet the network security group list- Specified by:
getNsgIdsListin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment id- Returns:
- network security group list
- Throws:
Exception- if an error occurs
-
getSubNet
Description copied from interface:BaremetalCloudClientGet the sub net- Specified by:
getSubNetin interfaceBaremetalCloudClient- Parameters:
subnetId- subnet id- Returns:
- GetSubnetResponse
- Throws:
Exception- if an error occurs
-
terminateInstance
Description copied from interface:BaremetalCloudClientTerminate instance with the specified instance id- Specified by:
terminateInstancein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Opc Request Id
- Throws:
Exception- if an error occurs
-
waitForInstanceTerminationToComplete
public com.oracle.bmc.core.model.Instance waitForInstanceTerminationToComplete(String instanceId) throws Exception Description copied from interface:BaremetalCloudClientWait for the termination with the specified instance id to complete- Specified by:
waitForInstanceTerminationToCompletein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Instance
- Throws:
Exception- if an error occurs
-
getInstanceState
public com.oracle.bmc.core.model.Instance.LifecycleState getInstanceState(String instanceId) throws Exception Description copied from interface:BaremetalCloudClientCheck instance's state- Specified by:
getInstanceStatein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Instance.LifecycleState
- Throws:
Exception- if an error occurs
-
getStoppedInstances
public List<com.oracle.bmc.core.model.Instance> getStoppedInstances(String compartmentId, String availableDomain) throws Exception Description copied from interface:BaremetalCloudClientGet a list of stopped instances on OCI- Specified by:
getStoppedInstancesin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment idavailableDomain- available domain or null for any AD- Returns:
- Instance.LifecycleState
- Throws:
Exception- if an error occurs
-
stopInstance
Description copied from interface:BaremetalCloudClientStop instance with the specified instance id- Specified by:
stopInstancein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Instance.LifecycleState
- Throws:
Exception- if an error occurs
-
startInstance
Description copied from interface:BaremetalCloudClientStart instance with the specified instance id- Specified by:
startInstancein interfaceBaremetalCloudClient- Parameters:
instanceId- the instance id created before- Returns:
- Instance.LifecycleState
- Throws:
Exception- if an error occurs
-
getTagNamespaces
public List<com.oracle.bmc.identity.model.TagNamespaceSummary> getTagNamespaces(String compartmentId) throws Exception Description copied from interface:BaremetalCloudClientStart instance with the specified instance id- Specified by:
getTagNamespacesin interfaceBaremetalCloudClient- Parameters:
compartmentId- the compartment id- Returns:
- tag namespace summary list
- Throws:
Exception- if an error occurs
-