func ExampleSSM_UpdateAssociationStatus() { svc := ssm.New(nil) params := &ssm.UpdateAssociationStatusInput{ AssociationStatus: &ssm.AssociationStatus{ // Required Date: aws.Time(time.Now()), // Required Message: aws.String("StatusMessage"), // Required Name: aws.String("AssociationStatusName"), // Required AdditionalInfo: aws.String("StatusAdditionalInfo"), }, InstanceID: aws.String("InstanceId"), // Required Name: aws.String("DocumentName"), // Required } resp, err := svc.UpdateAssociationStatus(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS Error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, The SDK should alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSSM_CreateDocument() { svc := ssm.New(nil) params := &ssm.CreateDocumentInput{ Content: aws.String("DocumentContent"), // Required Name: aws.String("DocumentName"), // Required } resp, err := svc.CreateDocument(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS Error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, The SDK should alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func ExampleSSM_ListDocuments() { svc := ssm.New(nil) params := &ssm.ListDocumentsInput{ DocumentFilterList: []*ssm.DocumentFilter{ &ssm.DocumentFilter{ // Required Key: aws.String("DocumentFilterKey"), // Required Value: aws.String("DocumentFilterValue"), // Required }, // More values... }, MaxResults: aws.Long(1), NextToken: aws.String("NextToken"), } resp, err := svc.ListDocuments(params) if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Generic AWS Error with Code, Message, and original error (if any) fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr()) if reqErr, ok := err.(awserr.RequestFailure); ok { // A service error occurred fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID()) } } else { // This case should never be hit, The SDK should alwsy return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
func init() { Before("@ssm", func() { World["client"] = ssm.New(nil) }) }
func TestInterface(t *testing.T) { assert.Implements(t, (*ssmiface.SSMAPI)(nil), ssm.New(nil)) }