// 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 devops from "oci-devops";
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 devops.DevopsClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createDeployArtifactDetails = {
description: "EXAMPLE-description-Value",
displayName: "EXAMPLE-displayName-Value",
deployArtifactType: devops.models.DeployArtifact.DeployArtifactType.DeploymentSpec,
deployArtifactSource: {
deployArtifactSourceType: "HELM_CHART",
chartUrl: "EXAMPLE-chartUrl-Value",
deployArtifactVersion: "EXAMPLE-deployArtifactVersion-Value",
helmVerificationKeySource: {
verificationKeySourceType: "VAULT_SECRET",
vaultSecretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vaultSecretId-Value"
}
},
argumentSubstitutionMode:
devops.models.DeployArtifact.ArgumentSubstitutionMode.SubstitutePlaceholders,
projectId: "ocid1.test.oc1..<unique_ID>EXAMPLE-projectId-Value",
freeformTags: {
EXAMPLE_KEY_cUr9G: "EXAMPLE_VALUE_i1fq0h9RyIXdAlu3sWLl"
},
definedTags: {
EXAMPLE_KEY_hKlCY: {
EXAMPLE_KEY_4FwLR: "EXAMPLE--Value"
}
}
};
const createDeployArtifactRequest: devops.requests.CreateDeployArtifactRequest = {
createDeployArtifactDetails: createDeployArtifactDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "O1SAXHBLBRUCIDRI7QNK<unique_ID>"
};
// Send request to the Client.
const createDeployArtifactResponse = await client.createDeployArtifact(
createDeployArtifactRequest
);
} catch (error) {
console.log("createDeployArtifact Failed with error " + error);
}
})();