// This is an automatically generated code sample.
// To make this code sample work in your Oracle Cloud tenancy,
// please replace the values for any parameters whose current values do not fit
// your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
// boolean, number, and enum parameters with values not fitting your use case).
import * as ocvp from "oci-ocvp";
import common = require("oci-common");
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new ocvp.ClusterClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createClusterDetails = {
sddcId: "ocid1.test.oc1..<unique_ID>EXAMPLE-sddcId-Value",
computeAvailabilityDomain: "EXAMPLE-computeAvailabilityDomain-Value",
displayName: "EXAMPLE-displayName-Value",
instanceDisplayNamePrefix: "EXAMPLE-instanceDisplayNamePrefix-Value",
esxiHostsCount: 31,
networkConfiguration: {
provisioningSubnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-provisioningSubnetId-Value",
vsphereVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vsphereVlanId-Value",
vmotionVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vmotionVlanId-Value",
vsanVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vsanVlanId-Value",
nsxVTepVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-nsxVTepVlanId-Value",
nsxEdgeVTepVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-nsxEdgeVTepVlanId-Value",
nsxEdgeUplink1VlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-nsxEdgeUplink1VlanId-Value",
nsxEdgeUplink2VlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-nsxEdgeUplink2VlanId-Value",
replicationVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-replicationVlanId-Value",
provisioningVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-provisioningVlanId-Value",
hcxVlanId: "ocid1.test.oc1..<unique_ID>EXAMPLE-hcxVlanId-Value",
}
,
initialCommitment: ocvp.models.Commitment.Month,
workloadNetworkCidr: "EXAMPLE-workloadNetworkCidr-Value",
initialHostShapeName: "EXAMPLE-initialHostShapeName-Value",
initialHostOcpuCount: 223.23608,
isShieldedInstanceEnabled: true,
capacityReservationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-capacityReservationId-Value",
datastores: [{
blockVolumeIds: ["EXAMPLE--Value" ],
datastoreType: ocvp.models.DatastoreTypes.Management,
}
],
datastoreClusterIds: ["EXAMPLE--Value" ],
vmwareSoftwareVersion: "EXAMPLE-vmwareSoftwareVersion-Value",
esxiSoftwareVersion: "EXAMPLE-esxiSoftwareVersion-Value",
freeformTags: {
EXAMPLE_KEY_W5F8D :"EXAMPLE_VALUE_191Z7ZkUo2M7fDJllwyg"
},
definedTags: {
EXAMPLE_KEY_fqWz9 :{
EXAMPLE_KEY_aVmDh :"EXAMPLE--Value"
}
},
}
const createClusterRequest: ocvp.requests.CreateClusterRequest = {
createClusterDetails: createClusterDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "BIMH1ZM6TLOATUDL82XU<unique_ID>",
};
// Send request to the Client.
const createClusterResponse = await client.createCluster(createClusterRequest);
}
catch (error) {
console.log("createCluster Failed with error " + error);
}
})();