// 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).
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/dif"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
)
func ExampleDeployArtifacts() {
// 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.
client, err := dif.NewStackClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := dif.DeployArtifactsRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
OpcRequestId: common.String("2KV7S3PL76WZ39NYOJWV<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value"),
StackId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-stackId-Value"),
DeployArtifactsDetails: dif.DeployArtifactsDetails{Services: []dif.ServiceEnum{dif.ServiceDataflow},
StackTemplates: []dif.StackTemplateEnum{dif.StackTemplateDatapipeline},
SubnetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value"),
Adb: []dif.AdbArtifactsDetail{dif.AdbArtifactsDetail{ArtifactObjectStoragePath: common.String("EXAMPLE-artifactObjectStoragePath-Value"),
DbCredentials: []dif.DbCredentialsDetail{dif.DbCredentialsDetail{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
UserName: common.String("EXAMPLE-userName-Value"),
UserType: common.String("EXAMPLE-userType-Value")}},
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
Dataflow: []dif.DataflowArtifactsDetail{dif.DataflowArtifactsDetail{ArchiveUri: common.String("EXAMPLE-archiveUri-Value"),
Execute: common.String("EXAMPLE-execute-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value")}},
Ggcs: []dif.GgcsArtifactsDetail{dif.GgcsArtifactsDetail{ArtifactObjectStoragePath: common.String("EXAMPLE-artifactObjectStoragePath-Value"),
InstanceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-instanceId-Value"),
Sources: []dif.GgcsSourceDetail{dif.GgcsSourceDetail{Action: dif.WorkflowActionUpdate,
ShouldStartSourceOperations: common.Bool(true),
SourceId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sourceId-Value"),
TargetConnectionName: common.String("EXAMPLE-targetConnectionName-Value"),
TargetUri: common.String("EXAMPLE-targetUri-Value")}},
Targets: []dif.GgcsTargetDetail{dif.GgcsTargetDetail{Action: dif.WorkflowActionUpdate,
ShouldStartTargetOperations: common.Bool(false),
SourceConnectionName: common.String("EXAMPLE-sourceConnectionName-Value"),
SourceUri: common.String("EXAMPLE-sourceUri-Value"),
TargetId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-targetId-Value")}},
Users: []dif.GgcsUserDetail{dif.GgcsUserDetail{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value"),
UserName: common.String("EXAMPLE-userName-Value"),
UserType: common.String("EXAMPLE-userType-Value"),
Action: dif.WorkflowActionUpdate}}}}}}
// Send the request using the service client
resp, err := client.DeployArtifacts(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}