// 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 datascience from "oci-datascience";
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 datascience.DataScienceClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createModelDeploymentDetails = {
displayName: "EXAMPLE-displayName-Value",
description: "EXAMPLE-description-Value",
projectId: "ocid1.test.oc1..<unique_ID>EXAMPLE-projectId-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
modelDeploymentConfigurationDetails: {
deploymentType: "MODEL_GROUP", modelGroupConfigurationDetails: {
modelGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-modelGroupId-Value",
}
,
infrastructureConfigurationDetails: {
infrastructureType: "INSTANCE_POOL", instanceConfiguration: {
instanceShapeName: "EXAMPLE-instanceShapeName-Value",
modelDeploymentInstanceShapeConfigDetails: {
ocpus: 50.02558,
memoryInGBs: 23.218018,
cpuBaseline: datascience.models.ModelDeploymentInstanceShapeConfigDetails.CpuBaseline.Baseline11,
}
,
subnetId: "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
privateEndpointId: "ocid1.test.oc1..<unique_ID>EXAMPLE-privateEndpointId-Value",
}
,
scalingPolicy: {
policyType: "FIXED_SIZE", instanceCount: 2
}
,
bandwidthMbps: 3278,
maximumBandwidthMbps: 4907
}
,
environmentConfigurationDetails: {
environmentConfigurationType: "OCIR_CONTAINER", image: "EXAMPLE-image-Value",
imageDigest: "EXAMPLE-imageDigest-Value",
cmd: ["EXAMPLE--Value" ],
entrypoint: ["EXAMPLE--Value" ],
serverPort: 82,
healthCheckPort: 619,
environmentVariables: {
EXAMPLE_KEY_vyDGN :"EXAMPLE_VALUE_EkSipz58Ga7H2j7po4XK"
}
}
}
,
categoryLogDetails: {
access: {
logId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value",
logGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value",
}
,
predict: {
logId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logId-Value",
logGroupId: "ocid1.test.oc1..<unique_ID>EXAMPLE-logGroupId-Value",
}
,
}
,
freeformTags: {
EXAMPLE_KEY_Hf6tA :"EXAMPLE_VALUE_jo4EQnYo0jUJAJlIwWiT"
},
definedTags: {
EXAMPLE_KEY_5YsVh :{
EXAMPLE_KEY_ezabH :"EXAMPLE--Value"
}
},
}
const createModelDeploymentRequest: datascience.requests.CreateModelDeploymentRequest = {
createModelDeploymentDetails: createModelDeploymentDetails,
opcRequestId: "ZQRB9K0WV407MNK8ZP9Q<unique_ID>",
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcParentRptUrl: "EXAMPLE-opcParentRptUrl-Value",
};
// Send request to the Client.
const createModelDeploymentResponse = await client.createModelDeployment(createModelDeploymentRequest);
}
catch (error) {
console.log("createModelDeployment Failed with error " + error);
}
})();