Documentation ¶
Overview ¶
Package ssm provides a client for Amazon Simple Systems Management Service.
Index ¶
- type Association
- type AssociationDescription
- type AssociationFilter
- type AssociationStatus
- type CreateAssociationBatchInput
- type CreateAssociationBatchOutput
- type CreateAssociationBatchRequestEntry
- type CreateAssociationInput
- type CreateAssociationOutput
- type CreateDocumentInput
- type CreateDocumentOutput
- type DeleteAssociationInput
- type DeleteAssociationOutput
- type DeleteDocumentInput
- type DeleteDocumentOutput
- type DescribeAssociationInput
- type DescribeAssociationOutput
- type DescribeDocumentInput
- type DescribeDocumentOutput
- type DocumentDescription
- type DocumentFilter
- type DocumentIdentifier
- type FailedCreateAssociation
- type GetDocumentInput
- type GetDocumentOutput
- type ListAssociationsInput
- type ListAssociationsOutput
- type ListDocumentsInput
- type ListDocumentsOutput
- type SSM
- func (c *SSM) CreateAssociation(input *CreateAssociationInput) (*CreateAssociationOutput, error)
- func (c *SSM) CreateAssociationBatch(input *CreateAssociationBatchInput) (*CreateAssociationBatchOutput, error)
- func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) (req *aws.Request, output *CreateAssociationBatchOutput)
- func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *aws.Request, output *CreateAssociationOutput)
- func (c *SSM) CreateDocument(input *CreateDocumentInput) (*CreateDocumentOutput, error)
- func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *aws.Request, output *CreateDocumentOutput)
- func (c *SSM) DeleteAssociation(input *DeleteAssociationInput) (*DeleteAssociationOutput, error)
- func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *aws.Request, output *DeleteAssociationOutput)
- func (c *SSM) DeleteDocument(input *DeleteDocumentInput) (*DeleteDocumentOutput, error)
- func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *aws.Request, output *DeleteDocumentOutput)
- func (c *SSM) DescribeAssociation(input *DescribeAssociationInput) (*DescribeAssociationOutput, error)
- func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req *aws.Request, output *DescribeAssociationOutput)
- func (c *SSM) DescribeDocument(input *DescribeDocumentInput) (*DescribeDocumentOutput, error)
- func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *aws.Request, output *DescribeDocumentOutput)
- func (c *SSM) GetDocument(input *GetDocumentInput) (*GetDocumentOutput, error)
- func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *aws.Request, output *GetDocumentOutput)
- func (c *SSM) ListAssociations(input *ListAssociationsInput) (*ListAssociationsOutput, error)
- func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *aws.Request, output *ListAssociationsOutput)
- func (c *SSM) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, error)
- func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *aws.Request, output *ListDocumentsOutput)
- func (c *SSM) UpdateAssociationStatus(input *UpdateAssociationStatusInput) (*UpdateAssociationStatusOutput, error)
- func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput) (req *aws.Request, output *UpdateAssociationStatusOutput)
- type UpdateAssociationStatusInput
- type UpdateAssociationStatusOutput
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Association ¶
type Association struct { // The ID of the instance. InstanceID *string `locationName:"InstanceId" type:"string"` // The name of the configuration document. Name *string `type:"string"` // contains filtered or unexported fields }
Describes an association of a configuration document and an instance.
type AssociationDescription ¶
type AssociationDescription struct { // The date when the association was made. Date *time.Time `type:"timestamp" timestampFormat:"unix"` // The ID of the instance. InstanceID *string `locationName:"InstanceId" type:"string"` // The name of the configuration document. Name *string `type:"string"` // The association status. Status *AssociationStatus `type:"structure"` // contains filtered or unexported fields }
Describes an association.
type AssociationFilter ¶
type AssociationFilter struct { // The name of the filter. Key *string `locationName:"key" type:"string" required:"true"` // The filter value. Value *string `locationName:"value" type:"string" required:"true"` // contains filtered or unexported fields }
Describes a filter.
type AssociationStatus ¶
type AssociationStatus struct { // A user-defined string. AdditionalInfo *string `type:"string"` // The date when the status changed. Date *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` // The reason for the status. Message *string `type:"string" required:"true"` // The status. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
Describes an association status.
type CreateAssociationBatchInput ¶
type CreateAssociationBatchInput struct { // One or more associations. Entries []*CreateAssociationBatchRequestEntry `locationNameList:"entries" type:"list" required:"true"` // contains filtered or unexported fields }
type CreateAssociationBatchOutput ¶
type CreateAssociationBatchOutput struct { // Information about the associations that failed. Failed []*FailedCreateAssociation `locationNameList:"FailedCreateAssociationEntry" type:"list"` // Information about the associations that succeeded. Successful []*AssociationDescription `locationNameList:"AssociationDescription" type:"list"` // contains filtered or unexported fields }
type CreateAssociationBatchRequestEntry ¶
type CreateAssociationBatchRequestEntry struct { // The ID of the instance. InstanceID *string `locationName:"InstanceId" type:"string"` // The name of the configuration document. Name *string `type:"string"` // contains filtered or unexported fields }
Describes the association of a configuration document and an instance.
type CreateAssociationInput ¶
type CreateAssociationOutput ¶
type CreateAssociationOutput struct { // Information about the association. AssociationDescription *AssociationDescription `type:"structure"` // contains filtered or unexported fields }
type CreateDocumentInput ¶
type CreateDocumentInput struct { // A valid JSON file. For more information about the contents of this file, // see Configuration Document (http://docs.aws.amazon.com/ssm/latest/APIReference/aws-ssm-document.html). Content *string `type:"string" required:"true"` // A name for the configuration document. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
type CreateDocumentOutput ¶
type CreateDocumentOutput struct { // Information about the configuration document. DocumentDescription *DocumentDescription `type:"structure"` // contains filtered or unexported fields }
type DeleteAssociationInput ¶
type DeleteAssociationOutput ¶
type DeleteAssociationOutput struct {
// contains filtered or unexported fields
}
type DeleteDocumentInput ¶
type DeleteDocumentInput struct { // The name of the configuration document. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
type DeleteDocumentOutput ¶
type DeleteDocumentOutput struct {
// contains filtered or unexported fields
}
type DescribeAssociationOutput ¶
type DescribeAssociationOutput struct { // Information about the association. AssociationDescription *AssociationDescription `type:"structure"` // contains filtered or unexported fields }
type DescribeDocumentInput ¶
type DescribeDocumentInput struct { // The name of the configuration document. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
type DescribeDocumentOutput ¶
type DescribeDocumentOutput struct { // Information about the configuration document. Document *DocumentDescription `type:"structure"` // contains filtered or unexported fields }
type DocumentDescription ¶
type DocumentDescription struct { // The date when the configuration document was created. CreatedDate *time.Time `type:"timestamp" timestampFormat:"unix"` // The name of the configuration document. Name *string `type:"string"` // The SHA1 hash of the document, which you can use for verification purposes. SHA1 *string `locationName:"Sha1" type:"string"` // The status of the configuration document. Status *string `type:"string"` // contains filtered or unexported fields }
Describes a configuration document.
type DocumentFilter ¶
type DocumentFilter struct { // The name of the filter. Key *string `locationName:"key" type:"string" required:"true"` // The value of the filter. Value *string `locationName:"value" type:"string" required:"true"` // contains filtered or unexported fields }
Describes a filter.
type DocumentIdentifier ¶
type DocumentIdentifier struct { // The name of the configuration document. Name *string `type:"string"` // contains filtered or unexported fields }
Describes the name of a configuration document.
type FailedCreateAssociation ¶
type FailedCreateAssociation struct { // The association. Entry *CreateAssociationBatchRequestEntry `type:"structure"` // The source of the failure. Fault *string `type:"string"` // A description of the failure. Message *string `type:"string"` // contains filtered or unexported fields }
Describes a failed association.
type GetDocumentInput ¶
type GetDocumentInput struct { // The name of the configuration document. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
type GetDocumentOutput ¶
type ListAssociationsInput ¶
type ListAssociationsInput struct { // One or more filters. Use a filter to return a more specific list of results. AssociationFilterList []*AssociationFilter `locationNameList:"AssociationFilter" type:"list" required:"true"` // The maximum number of items to return for this call. The call also returns // a token that you can specify in a subsequent call to get the next set of // results. MaxResults *int64 `type:"integer"` // The token for the next set of items to return. (You received this token from // a previous call.) NextToken *string `type:"string"` // contains filtered or unexported fields }
type ListAssociationsOutput ¶
type ListAssociationsOutput struct { // The associations. Associations []*Association `locationNameList:"Association" type:"list"` // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. NextToken *string `type:"string"` // contains filtered or unexported fields }
type ListDocumentsInput ¶
type ListDocumentsInput struct { // One or more filters. Use a filter to return a more specific list of results. DocumentFilterList []*DocumentFilter `locationNameList:"DocumentFilter" type:"list"` // The maximum number of items to return for this call. The call also returns // a token that you can specify in a subsequent call to get the next set of // results. MaxResults *int64 `type:"integer"` // The token for the next set of items to return. (You received this token from // a previous call.) NextToken *string `type:"string"` // contains filtered or unexported fields }
type ListDocumentsOutput ¶
type ListDocumentsOutput struct { // The names of the configuration documents. DocumentIdentifiers []*DocumentIdentifier `locationNameList:"DocumentIdentifier" type:"list"` // The token to use when requesting the next set of items. If there are no additional // items to return, the string is empty. NextToken *string `type:"string"` // contains filtered or unexported fields }
type SSM ¶
SSM is a client for Amazon SSM.
func (*SSM) CreateAssociation ¶
func (c *SSM) CreateAssociation(input *CreateAssociationInput) (*CreateAssociationOutput, error)
Associates the specified configuration document with the specified instance.
When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.
If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) CreateAssociationBatch ¶
func (c *SSM) CreateAssociationBatch(input *CreateAssociationBatchInput) (*CreateAssociationBatchOutput, error)
Associates the specified configuration documents with the specified instances.
When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.
If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) CreateAssociationBatchRequest ¶
func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) (req *aws.Request, output *CreateAssociationBatchOutput)
CreateAssociationBatchRequest generates a request for the CreateAssociationBatch operation.
func (*SSM) CreateAssociationRequest ¶
func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *aws.Request, output *CreateAssociationOutput)
CreateAssociationRequest generates a request for the CreateAssociation operation.
func (*SSM) CreateDocument ¶
func (c *SSM) CreateDocument(input *CreateDocumentInput) (*CreateDocumentOutput, error)
Creates a configuration document.
After you create a configuration document, you can use CreateAssociation to associate it with one or more running instances.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) CreateDocumentRequest ¶
func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *aws.Request, output *CreateDocumentOutput)
CreateDocumentRequest generates a request for the CreateDocument operation.
func (*SSM) DeleteAssociation ¶
func (c *SSM) DeleteAssociation(input *DeleteAssociationInput) (*DeleteAssociationOutput, error)
Disassociates the specified configuration document from the specified instance.
When you disassociate a configuration document from an instance, it does not change the configuration of the instance. To change the configuration state of an instance after you disassociate a configuration document, you must create a new configuration document with the desired configuration and associate it with the instance.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) DeleteAssociationRequest ¶
func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *aws.Request, output *DeleteAssociationOutput)
DeleteAssociationRequest generates a request for the DeleteAssociation operation.
func (*SSM) DeleteDocument ¶
func (c *SSM) DeleteDocument(input *DeleteDocumentInput) (*DeleteDocumentOutput, error)
Deletes the specified configuration document.
You must use DeleteAssociation to disassociate all instances that are associated with the configuration document before you can delete it.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { svc := ssm.New(nil) params := &ssm.DeleteDocumentInput{ Name: aws.String("DocumentName"), // Required } resp, err := svc.DeleteDocument(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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) DeleteDocumentRequest ¶
func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *aws.Request, output *DeleteDocumentOutput)
DeleteDocumentRequest generates a request for the DeleteDocument operation.
func (*SSM) DescribeAssociation ¶
func (c *SSM) DescribeAssociation(input *DescribeAssociationInput) (*DescribeAssociationOutput, error)
Describes the associations for the specified configuration document or instance.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) DescribeAssociationRequest ¶
func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req *aws.Request, output *DescribeAssociationOutput)
DescribeAssociationRequest generates a request for the DescribeAssociation operation.
func (*SSM) DescribeDocument ¶
func (c *SSM) DescribeDocument(input *DescribeDocumentInput) (*DescribeDocumentOutput, error)
Describes the specified configuration document.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { svc := ssm.New(nil) params := &ssm.DescribeDocumentInput{ Name: aws.String("DocumentName"), // Required } resp, err := svc.DescribeDocument(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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) DescribeDocumentRequest ¶
func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *aws.Request, output *DescribeDocumentOutput)
DescribeDocumentRequest generates a request for the DescribeDocument operation.
func (*SSM) GetDocument ¶
func (c *SSM) GetDocument(input *GetDocumentInput) (*GetDocumentOutput, error)
Gets the contents of the specified configuration document.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { svc := ssm.New(nil) params := &ssm.GetDocumentInput{ Name: aws.String("DocumentName"), // Required } resp, err := svc.GetDocument(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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) GetDocumentRequest ¶
func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *aws.Request, output *GetDocumentOutput)
GetDocumentRequest generates a request for the GetDocument operation.
func (*SSM) ListAssociations ¶
func (c *SSM) ListAssociations(input *ListAssociationsInput) (*ListAssociationsOutput, error)
Lists the associations for the specified configuration document or instance.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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.Long(1), NextToken: aws.String("NextToken"), } resp, err := svc.ListAssociations(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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) ListAssociationsRequest ¶
func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *aws.Request, output *ListAssociationsOutput)
ListAssociationsRequest generates a request for the ListAssociations operation.
func (*SSM) ListDocuments ¶
func (c *SSM) ListDocuments(input *ListDocumentsInput) (*ListDocumentsOutput, error)
Describes one or more of your configuration documents.
Example ¶
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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.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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) ListDocumentsRequest ¶
func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *aws.Request, output *ListDocumentsOutput)
ListDocumentsRequest generates a request for the ListDocuments operation.
func (*SSM) UpdateAssociationStatus ¶
func (c *SSM) UpdateAssociationStatus(input *UpdateAssociationStatusInput) (*UpdateAssociationStatusOutput, error)
Updates the status of the configuration document associated with the specified instance.
Example ¶
package main import ( "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/service/ssm" ) func main() { 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 always return an // error which satisfies the awserr.Error interface. fmt.Println(err.Error()) } } // Pretty-print the response data. fmt.Println(awsutil.StringValue(resp)) }
Output:
func (*SSM) UpdateAssociationStatusRequest ¶
func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput) (req *aws.Request, output *UpdateAssociationStatusOutput)
UpdateAssociationStatusRequest generates a request for the UpdateAssociationStatus operation.
type UpdateAssociationStatusInput ¶
type UpdateAssociationStatusInput struct { // The association status. AssociationStatus *AssociationStatus `type:"structure" required:"true"` // The ID of the instance. InstanceID *string `locationName:"InstanceId" type:"string" required:"true"` // The name of the configuration document. Name *string `type:"string" required:"true"` // contains filtered or unexported fields }
type UpdateAssociationStatusOutput ¶
type UpdateAssociationStatusOutput struct { // Information about the association. AssociationDescription *AssociationDescription `type:"structure"` // contains filtered or unexported fields }