Пример #1
0
func ExampleSMS_StartOnDemandReplicationRun() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := sms.New(sess)

	params := &sms.StartOnDemandReplicationRunInput{
		ReplicationJobId: aws.String("ReplicationJobId"), // Required
		Description:      aws.String("Description"),
	}
	resp, err := svc.StartOnDemandReplicationRun(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Пример #2
0
func ExampleSMS_UpdateReplicationJob() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := sms.New(sess)

	params := &sms.UpdateReplicationJobInput{
		ReplicationJobId:            aws.String("ReplicationJobId"), // Required
		Description:                 aws.String("Description"),
		Frequency:                   aws.Int64(1),
		LicenseType:                 aws.String("LicenseType"),
		NextReplicationRunStartTime: aws.Time(time.Now()),
		RoleName:                    aws.String("RoleName"),
	}
	resp, err := svc.UpdateReplicationJob(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Пример #3
0
func ExampleSMS_GetServers() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := sms.New(sess)

	params := &sms.GetServersInput{
		MaxResults: aws.Int64(1),
		NextToken:  aws.String("NextToken"),
	}
	resp, err := svc.GetServers(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Пример #4
0
func ExampleSMS_DeleteServerCatalog() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := sms.New(sess)

	var params *sms.DeleteServerCatalogInput
	resp, err := svc.DeleteServerCatalog(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}
Пример #5
0
func ExampleSMS_DisassociateConnector() {
	sess, err := session.NewSession()
	if err != nil {
		fmt.Println("failed to create session,", err)
		return
	}

	svc := sms.New(sess)

	params := &sms.DisassociateConnectorInput{
		ConnectorId: aws.String("ConnectorId"), // Required
	}
	resp, err := svc.DisassociateConnector(params)

	if err != nil {
		// Print the error, cast err to awserr.Error to get the Code and
		// Message from an error.
		fmt.Println(err.Error())
		return
	}

	// Pretty-print the response data.
	fmt.Println(resp)
}