123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
- package ssm_test
- import (
- "bytes"
- "fmt"
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/service/ssm"
- )
- var _ time.Duration
- var _ bytes.Buffer
- func ExampleSSM_CreateAssociation() {
- svc := ssm.New(nil)
- params := &ssm.CreateAssociationInput{
- InstanceId: aws.String("InstanceId"), // Required
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.CreateAssociation(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)
- }
- func ExampleSSM_CreateAssociationBatch() {
- svc := ssm.New(nil)
- params := &ssm.CreateAssociationBatchInput{
- Entries: []*ssm.CreateAssociationBatchRequestEntry{ // Required
- { // Required
- InstanceId: aws.String("InstanceId"),
- Name: aws.String("DocumentName"),
- },
- // More values...
- },
- }
- resp, err := svc.CreateAssociationBatch(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)
- }
- 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 {
- // 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)
- }
- func ExampleSSM_DeleteAssociation() {
- svc := ssm.New(nil)
- params := &ssm.DeleteAssociationInput{
- InstanceId: aws.String("InstanceId"), // Required
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.DeleteAssociation(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)
- }
- func ExampleSSM_DeleteDocument() {
- svc := ssm.New(nil)
- params := &ssm.DeleteDocumentInput{
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.DeleteDocument(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)
- }
- func ExampleSSM_DescribeAssociation() {
- svc := ssm.New(nil)
- params := &ssm.DescribeAssociationInput{
- InstanceId: aws.String("InstanceId"), // Required
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.DescribeAssociation(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)
- }
- func ExampleSSM_DescribeDocument() {
- svc := ssm.New(nil)
- params := &ssm.DescribeDocumentInput{
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.DescribeDocument(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)
- }
- func ExampleSSM_GetDocument() {
- svc := ssm.New(nil)
- params := &ssm.GetDocumentInput{
- Name: aws.String("DocumentName"), // Required
- }
- resp, err := svc.GetDocument(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)
- }
- func ExampleSSM_ListAssociations() {
- svc := ssm.New(nil)
- params := &ssm.ListAssociationsInput{
- AssociationFilterList: []*ssm.AssociationFilter{ // Required
- { // Required
- Key: aws.String("AssociationFilterKey"), // Required
- Value: aws.String("AssociationFilterValue"), // Required
- },
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.ListAssociations(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)
- }
- func ExampleSSM_ListDocuments() {
- svc := ssm.New(nil)
- params := &ssm.ListDocumentsInput{
- DocumentFilterList: []*ssm.DocumentFilter{
- { // Required
- Key: aws.String("DocumentFilterKey"), // Required
- Value: aws.String("DocumentFilterValue"), // Required
- },
- // More values...
- },
- MaxResults: aws.Int64(1),
- NextToken: aws.String("NextToken"),
- }
- resp, err := svc.ListDocuments(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)
- }
- 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 {
- // 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)
- }
|