Class SDKBaremetalCloudClient
- java.lang.Object
-
- com.oracle.cloud.baremetal.jenkins.client.SDKBaremetalCloudClient
-
- All Implemented Interfaces:
BaremetalCloudClient,AutoCloseable
public class SDKBaremetalCloudClient extends Object implements BaremetalCloudClient
An implementation of ComputeCloudClient using the JAX-RS client API.
-
-
Constructor Summary
Constructors Constructor Description SDKBaremetalCloudClient(com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider instancePrincipalsProvider, String regionId, int maxAsyncThreads, String instancePrincipalsTenantId)SDKBaremetalCloudClient(com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthenticate()voidclose()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>getCompartmentsList()Get the compartment listList<com.oracle.bmc.core.model.Image>getImagesList(String compartmentId)Get the available image listStringgetInstanceIp(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.GetSubnetResponsegetSubNet(String subnetId)Get 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.TenancygetTenant()Get 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 idStringstopInstance(String instanceId)Stop instance with the specified instance idStringterminateInstance(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 Detail
-
SDKBaremetalCloudClient
public SDKBaremetalCloudClient(com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider provider, String regionId, int maxAsyncThreads)
-
-
Method Detail
-
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
public void close() throws Exception- 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
public com.oracle.bmc.identity.model.Tenancy getTenant() throws ExceptionDescription copied from interface:BaremetalCloudClientGet root compartment- Specified by:
getTenantin interfaceBaremetalCloudClient- Returns:
- tenancy
- Throws:
Exception- if an error occurs
-
getCompartmentsList
public List<com.oracle.bmc.identity.model.Compartment> getCompartmentsList() throws Exception
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
public List<com.oracle.bmc.core.model.Image> getImagesList(String compartmentId) throws Exception
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
public List<com.oracle.bmc.core.model.Vcn> getVcnList(String compartmentId) throws Exception
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
public com.oracle.bmc.core.responses.GetSubnetResponse getSubNet(String subnetId) throws Exception
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
public String terminateInstance(String instanceId) throws Exception
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- Returns:
- Instance.LifecycleState
- Throws:
Exception- if an error occurs
-
stopInstance
public String stopInstance(String instanceId) throws Exception
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
public com.oracle.bmc.core.model.Instance startInstance(String instanceId) throws Exception
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
-
-