ssm

package
v0.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package ssm provides a client for Amazon Simple Systems Management Service.

Index

Examples

Constants

View Source
const (
	// @enum AssociationFilterKey
	AssociationFilterKeyInstanceId = "InstanceId"
	// @enum AssociationFilterKey
	AssociationFilterKeyName = "Name"
)
View Source
const (
	// @enum AssociationStatusName
	AssociationStatusNamePending = "Pending"
	// @enum AssociationStatusName
	AssociationStatusNameSuccess = "Success"
	// @enum AssociationStatusName
	AssociationStatusNameFailed = "Failed"
)
View Source
const (
	// @enum DocumentStatus
	DocumentStatusCreating = "Creating"
	// @enum DocumentStatus
	DocumentStatusActive = "Active"
	// @enum DocumentStatus
	DocumentStatusDeleting = "Deleting"
)
View Source
const (
	// @enum Fault
	FaultClient = "Client"
	// @enum Fault
	FaultServer = "Server"
	// @enum Fault
	FaultUnknown = "Unknown"
)
View Source
const (
	// @enum DocumentFilterKey
	DocumentFilterKeyName = "Name"
)

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.

func (Association) GoString added in v0.6.5

func (s Association) GoString() string

GoString returns the string representation

func (Association) String added in v0.6.5

func (s Association) String() string

String returns the string representation

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.

func (AssociationDescription) GoString added in v0.6.5

func (s AssociationDescription) GoString() string

GoString returns the string representation

func (AssociationDescription) String added in v0.6.5

func (s AssociationDescription) String() string

String returns the string representation

type AssociationFilter

type AssociationFilter struct {
	// The name of the filter.
	Key *string `locationName:"key" type:"string" required:"true" enum:"AssociationFilterKey"`

	// The filter value.
	Value *string `locationName:"value" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Describes a filter.

func (AssociationFilter) GoString added in v0.6.5

func (s AssociationFilter) GoString() string

GoString returns the string representation

func (AssociationFilter) String added in v0.6.5

func (s AssociationFilter) String() string

String returns the string representation

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" enum:"AssociationStatusName"`
	// contains filtered or unexported fields
}

Describes an association status.

func (AssociationStatus) GoString added in v0.6.5

func (s AssociationStatus) GoString() string

GoString returns the string representation

func (AssociationStatus) String added in v0.6.5

func (s AssociationStatus) String() string

String returns the string representation

type CreateAssociationBatchInput

type CreateAssociationBatchInput struct {
	// One or more associations.
	Entries []*CreateAssociationBatchRequestEntry `locationNameList:"entries" type:"list" required:"true"`
	// contains filtered or unexported fields
}

func (CreateAssociationBatchInput) GoString added in v0.6.5

func (s CreateAssociationBatchInput) GoString() string

GoString returns the string representation

func (CreateAssociationBatchInput) String added in v0.6.5

String returns the string representation

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
}

func (CreateAssociationBatchOutput) GoString added in v0.6.5

func (s CreateAssociationBatchOutput) GoString() string

GoString returns the string representation

func (CreateAssociationBatchOutput) String added in v0.6.5

String returns the string representation

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.

func (CreateAssociationBatchRequestEntry) GoString added in v0.6.5

GoString returns the string representation

func (CreateAssociationBatchRequestEntry) String added in v0.6.5

String returns the string representation

type CreateAssociationInput

type CreateAssociationInput struct {
	// 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
}

func (CreateAssociationInput) GoString added in v0.6.5

func (s CreateAssociationInput) GoString() string

GoString returns the string representation

func (CreateAssociationInput) String added in v0.6.5

func (s CreateAssociationInput) String() string

String returns the string representation

type CreateAssociationOutput

type CreateAssociationOutput struct {
	// Information about the association.
	AssociationDescription *AssociationDescription `type:"structure"`
	// contains filtered or unexported fields
}

func (CreateAssociationOutput) GoString added in v0.6.5

func (s CreateAssociationOutput) GoString() string

GoString returns the string representation

func (CreateAssociationOutput) String added in v0.6.5

func (s CreateAssociationOutput) String() string

String returns the string representation

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
}

func (CreateDocumentInput) GoString added in v0.6.5

func (s CreateDocumentInput) GoString() string

GoString returns the string representation

func (CreateDocumentInput) String added in v0.6.5

func (s CreateDocumentInput) String() string

String returns the string representation

type CreateDocumentOutput

type CreateDocumentOutput struct {
	// Information about the configuration document.
	DocumentDescription *DocumentDescription `type:"structure"`
	// contains filtered or unexported fields
}

func (CreateDocumentOutput) GoString added in v0.6.5

func (s CreateDocumentOutput) GoString() string

GoString returns the string representation

func (CreateDocumentOutput) String added in v0.6.5

func (s CreateDocumentOutput) String() string

String returns the string representation

type DeleteAssociationInput

type DeleteAssociationInput struct {
	// 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
}

func (DeleteAssociationInput) GoString added in v0.6.5

func (s DeleteAssociationInput) GoString() string

GoString returns the string representation

func (DeleteAssociationInput) String added in v0.6.5

func (s DeleteAssociationInput) String() string

String returns the string representation

type DeleteAssociationOutput

type DeleteAssociationOutput struct {
	// contains filtered or unexported fields
}

func (DeleteAssociationOutput) GoString added in v0.6.5

func (s DeleteAssociationOutput) GoString() string

GoString returns the string representation

func (DeleteAssociationOutput) String added in v0.6.5

func (s DeleteAssociationOutput) String() string

String returns the string representation

type DeleteDocumentInput

type DeleteDocumentInput struct {
	// The name of the configuration document.
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteDocumentInput) GoString added in v0.6.5

func (s DeleteDocumentInput) GoString() string

GoString returns the string representation

func (DeleteDocumentInput) String added in v0.6.5

func (s DeleteDocumentInput) String() string

String returns the string representation

type DeleteDocumentOutput

type DeleteDocumentOutput struct {
	// contains filtered or unexported fields
}

func (DeleteDocumentOutput) GoString added in v0.6.5

func (s DeleteDocumentOutput) GoString() string

GoString returns the string representation

func (DeleteDocumentOutput) String added in v0.6.5

func (s DeleteDocumentOutput) String() string

String returns the string representation

type DescribeAssociationInput

type DescribeAssociationInput struct {
	// 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
}

func (DescribeAssociationInput) GoString added in v0.6.5

func (s DescribeAssociationInput) GoString() string

GoString returns the string representation

func (DescribeAssociationInput) String added in v0.6.5

func (s DescribeAssociationInput) String() string

String returns the string representation

type DescribeAssociationOutput

type DescribeAssociationOutput struct {
	// Information about the association.
	AssociationDescription *AssociationDescription `type:"structure"`
	// contains filtered or unexported fields
}

func (DescribeAssociationOutput) GoString added in v0.6.5

func (s DescribeAssociationOutput) GoString() string

GoString returns the string representation

func (DescribeAssociationOutput) String added in v0.6.5

func (s DescribeAssociationOutput) String() string

String returns the string representation

type DescribeDocumentInput

type DescribeDocumentInput struct {
	// The name of the configuration document.
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DescribeDocumentInput) GoString added in v0.6.5

func (s DescribeDocumentInput) GoString() string

GoString returns the string representation

func (DescribeDocumentInput) String added in v0.6.5

func (s DescribeDocumentInput) String() string

String returns the string representation

type DescribeDocumentOutput

type DescribeDocumentOutput struct {
	// Information about the configuration document.
	Document *DocumentDescription `type:"structure"`
	// contains filtered or unexported fields
}

func (DescribeDocumentOutput) GoString added in v0.6.5

func (s DescribeDocumentOutput) GoString() string

GoString returns the string representation

func (DescribeDocumentOutput) String added in v0.6.5

func (s DescribeDocumentOutput) String() string

String returns the string representation

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" enum:"DocumentStatus"`
	// contains filtered or unexported fields
}

Describes a configuration document.

func (DocumentDescription) GoString added in v0.6.5

func (s DocumentDescription) GoString() string

GoString returns the string representation

func (DocumentDescription) String added in v0.6.5

func (s DocumentDescription) String() string

String returns the string representation

type DocumentFilter

type DocumentFilter struct {
	// The name of the filter.
	Key *string `locationName:"key" type:"string" required:"true" enum:"DocumentFilterKey"`

	// The value of the filter.
	Value *string `locationName:"value" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Describes a filter.

func (DocumentFilter) GoString added in v0.6.5

func (s DocumentFilter) GoString() string

GoString returns the string representation

func (DocumentFilter) String added in v0.6.5

func (s DocumentFilter) String() string

String returns the string representation

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.

func (DocumentIdentifier) GoString added in v0.6.5

func (s DocumentIdentifier) GoString() string

GoString returns the string representation

func (DocumentIdentifier) String added in v0.6.5

func (s DocumentIdentifier) String() string

String returns the string representation

type FailedCreateAssociation

type FailedCreateAssociation struct {
	// The association.
	Entry *CreateAssociationBatchRequestEntry `type:"structure"`

	// The source of the failure.
	Fault *string `type:"string" enum:"Fault"`

	// A description of the failure.
	Message *string `type:"string"`
	// contains filtered or unexported fields
}

Describes a failed association.

func (FailedCreateAssociation) GoString added in v0.6.5

func (s FailedCreateAssociation) GoString() string

GoString returns the string representation

func (FailedCreateAssociation) String added in v0.6.5

func (s FailedCreateAssociation) String() string

String returns the string representation

type GetDocumentInput

type GetDocumentInput struct {
	// The name of the configuration document.
	Name *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (GetDocumentInput) GoString added in v0.6.5

func (s GetDocumentInput) GoString() string

GoString returns the string representation

func (GetDocumentInput) String added in v0.6.5

func (s GetDocumentInput) String() string

String returns the string representation

type GetDocumentOutput

type GetDocumentOutput struct {
	// The contents of the configuration document.
	Content *string `type:"string"`

	// The name of the configuration document.
	Name *string `type:"string"`
	// contains filtered or unexported fields
}

func (GetDocumentOutput) GoString added in v0.6.5

func (s GetDocumentOutput) GoString() string

GoString returns the string representation

func (GetDocumentOutput) String added in v0.6.5

func (s GetDocumentOutput) String() string

String returns the string representation

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
}

func (ListAssociationsInput) GoString added in v0.6.5

func (s ListAssociationsInput) GoString() string

GoString returns the string representation

func (ListAssociationsInput) String added in v0.6.5

func (s ListAssociationsInput) String() string

String returns the string representation

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
}

func (ListAssociationsOutput) GoString added in v0.6.5

func (s ListAssociationsOutput) GoString() string

GoString returns the string representation

func (ListAssociationsOutput) String added in v0.6.5

func (s ListAssociationsOutput) String() string

String returns the string representation

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
}

func (ListDocumentsInput) GoString added in v0.6.5

func (s ListDocumentsInput) GoString() string

GoString returns the string representation

func (ListDocumentsInput) String added in v0.6.5

func (s ListDocumentsInput) String() string

String returns the string representation

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
}

func (ListDocumentsOutput) GoString added in v0.6.5

func (s ListDocumentsOutput) GoString() string

GoString returns the string representation

func (ListDocumentsOutput) String added in v0.6.5

func (s ListDocumentsOutput) String() string

String returns the string representation

type SSM

type SSM struct {
	*service.Service
}

Amazon EC2 Simple Systems Manager (SSM) enables you to configure and manage your EC2 instances. You can create a configuration document and then associate it with one or more running instances.

You can use a configuration document to automate the following tasks for your Windows instances:

Join an AWS Directory

Install, repair, or uninstall software using an MSI package

Run PowerShell scripts

Configure CloudWatch Logs to monitor applications and systems

Note that configuration documents are not supported on Linux instances.

func New

func New(config *aws.Config) *SSM

New returns a new SSM client.

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.Prettify(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.Prettify(resp))
}
Output:

func (*SSM) CreateAssociationBatchRequest

func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) (req *service.Request, output *CreateAssociationBatchOutput)

CreateAssociationBatchRequest generates a request for the CreateAssociationBatch operation.

func (*SSM) CreateAssociationRequest

func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) CreateDocumentRequest

func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) DeleteAssociationRequest

func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) DeleteDocumentRequest

func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) DescribeAssociationRequest

func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) DescribeDocumentRequest

func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) GetDocumentRequest

func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *service.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.Int64(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.Prettify(resp))
}
Output:

func (*SSM) ListAssociationsRequest

func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *service.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.Int64(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.Prettify(resp))
}
Output:

func (*SSM) ListDocumentsRequest

func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *service.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.Prettify(resp))
}
Output:

func (*SSM) UpdateAssociationStatusRequest

func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput) (req *service.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
}

func (UpdateAssociationStatusInput) GoString added in v0.6.5

func (s UpdateAssociationStatusInput) GoString() string

GoString returns the string representation

func (UpdateAssociationStatusInput) String added in v0.6.5

String returns the string representation

type UpdateAssociationStatusOutput

type UpdateAssociationStatusOutput struct {
	// Information about the association.
	AssociationDescription *AssociationDescription `type:"structure"`
	// contains filtered or unexported fields
}

func (UpdateAssociationStatusOutput) GoString added in v0.6.5

GoString returns the string representation

func (UpdateAssociationStatusOutput) String added in v0.6.5

String returns the string representation

Directories

Path Synopsis
Package ssmiface provides an interface for the Amazon Simple Systems Management Service.
Package ssmiface provides an interface for the Amazon Simple Systems Management Service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL