ssm

package
v0.9.17-0...-4944a94 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2015 License: Apache-2.0 Imports: 8 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 `min:"10" type:"string"`

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

Describes an association of a configuration document and an instance.

func (Association) GoString

func (s Association) GoString() string

GoString returns the string representation

func (Association) String

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 `min:"10" type:"string"`

	// The name of the configuration document.
	Name *string `min:"3" type:"string"`

	// The association status.
	Status *AssociationStatus `type:"structure"`
	// contains filtered or unexported fields
}

Describes an association.

func (AssociationDescription) GoString

func (s AssociationDescription) GoString() string

GoString returns the string representation

func (AssociationDescription) String

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" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Describes a filter.

func (AssociationFilter) GoString

func (s AssociationFilter) GoString() string

GoString returns the string representation

func (AssociationFilter) String

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

func (s AssociationStatus) GoString() string

GoString returns the string representation

func (AssociationStatus) String

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

func (s CreateAssociationBatchInput) GoString() string

GoString returns the string representation

func (CreateAssociationBatchInput) String

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

func (s CreateAssociationBatchOutput) GoString() string

GoString returns the string representation

func (CreateAssociationBatchOutput) String

String returns the string representation

type CreateAssociationBatchRequestEntry

type CreateAssociationBatchRequestEntry struct {
	// The ID of the instance.
	InstanceId *string `min:"10" type:"string"`

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

Describes the association of a configuration document and an instance.

func (CreateAssociationBatchRequestEntry) GoString

GoString returns the string representation

func (CreateAssociationBatchRequestEntry) String

String returns the string representation

type CreateAssociationInput

type CreateAssociationInput struct {
	// The ID of the instance.
	InstanceId *string `min:"10" type:"string" required:"true"`

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

func (CreateAssociationInput) GoString

func (s CreateAssociationInput) GoString() string

GoString returns the string representation

func (CreateAssociationInput) String

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

func (s CreateAssociationOutput) GoString() string

GoString returns the string representation

func (CreateAssociationOutput) String

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 `min:"1" type:"string" required:"true"`

	// A name for the configuration document.
	Name *string `min:"3" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CreateDocumentInput) GoString

func (s CreateDocumentInput) GoString() string

GoString returns the string representation

func (CreateDocumentInput) String

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

func (s CreateDocumentOutput) GoString() string

GoString returns the string representation

func (CreateDocumentOutput) String

func (s CreateDocumentOutput) String() string

String returns the string representation

type DeleteAssociationInput

type DeleteAssociationInput struct {
	// The ID of the instance.
	InstanceId *string `min:"10" type:"string" required:"true"`

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

func (DeleteAssociationInput) GoString

func (s DeleteAssociationInput) GoString() string

GoString returns the string representation

func (DeleteAssociationInput) String

func (s DeleteAssociationInput) String() string

String returns the string representation

type DeleteAssociationOutput

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

func (DeleteAssociationOutput) GoString

func (s DeleteAssociationOutput) GoString() string

GoString returns the string representation

func (DeleteAssociationOutput) String

func (s DeleteAssociationOutput) String() string

String returns the string representation

type DeleteDocumentInput

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

func (DeleteDocumentInput) GoString

func (s DeleteDocumentInput) GoString() string

GoString returns the string representation

func (DeleteDocumentInput) String

func (s DeleteDocumentInput) String() string

String returns the string representation

type DeleteDocumentOutput

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

func (DeleteDocumentOutput) GoString

func (s DeleteDocumentOutput) GoString() string

GoString returns the string representation

func (DeleteDocumentOutput) String

func (s DeleteDocumentOutput) String() string

String returns the string representation

type DescribeAssociationInput

type DescribeAssociationInput struct {
	// The ID of the instance.
	InstanceId *string `min:"10" type:"string" required:"true"`

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

func (DescribeAssociationInput) GoString

func (s DescribeAssociationInput) GoString() string

GoString returns the string representation

func (DescribeAssociationInput) String

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

func (s DescribeAssociationOutput) GoString() string

GoString returns the string representation

func (DescribeAssociationOutput) String

func (s DescribeAssociationOutput) String() string

String returns the string representation

type DescribeDocumentInput

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

func (DescribeDocumentInput) GoString

func (s DescribeDocumentInput) GoString() string

GoString returns the string representation

func (DescribeDocumentInput) String

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

func (s DescribeDocumentOutput) GoString() string

GoString returns the string representation

func (DescribeDocumentOutput) String

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 `min:"3" type:"string"`

	// The SHA1 hash of the document, which you can use for verification purposes.
	Sha1 *string `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

func (s DocumentDescription) GoString() string

GoString returns the string representation

func (DocumentDescription) String

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" min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

Describes a filter.

func (DocumentFilter) GoString

func (s DocumentFilter) GoString() string

GoString returns the string representation

func (DocumentFilter) String

func (s DocumentFilter) String() string

String returns the string representation

type DocumentIdentifier

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

Describes the name of a configuration document.

func (DocumentIdentifier) GoString

func (s DocumentIdentifier) GoString() string

GoString returns the string representation

func (DocumentIdentifier) String

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

func (s FailedCreateAssociation) GoString() string

GoString returns the string representation

func (FailedCreateAssociation) String

func (s FailedCreateAssociation) String() string

String returns the string representation

type GetDocumentInput

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

func (GetDocumentInput) GoString

func (s GetDocumentInput) GoString() string

GoString returns the string representation

func (GetDocumentInput) String

func (s GetDocumentInput) String() string

String returns the string representation

type GetDocumentOutput

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

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

func (GetDocumentOutput) GoString

func (s GetDocumentOutput) GoString() string

GoString returns the string representation

func (GetDocumentOutput) String

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" min:"1" 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 `min:"1" 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

func (s ListAssociationsInput) GoString() string

GoString returns the string representation

func (ListAssociationsInput) String

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

func (s ListAssociationsOutput) GoString() string

GoString returns the string representation

func (ListAssociationsOutput) String

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" min:"1" 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 `min:"1" 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

func (s ListDocumentsInput) GoString() string

GoString returns the string representation

func (ListDocumentsInput) String

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

func (s ListDocumentsOutput) GoString() string

GoString returns the string representation

func (ListDocumentsOutput) String

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/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 {
		// 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)
}
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/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 {
		// 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)
}
Output:

func (*SSM) CreateAssociationBatchRequest

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

CreateAssociationBatchRequest generates a request for the CreateAssociationBatch operation.

func (*SSM) CreateAssociationRequest

func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) CreateDocumentRequest

func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) DeleteAssociationRequest

func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *request.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/service/ssm"
)

func main() {
	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)
}
Output:

func (*SSM) DeleteDocumentRequest

func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) DescribeAssociationRequest

func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req *request.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/service/ssm"
)

func main() {
	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)
}
Output:

func (*SSM) DescribeDocumentRequest

func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *request.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/service/ssm"
)

func main() {
	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)
}
Output:

func (*SSM) GetDocumentRequest

func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) ListAssociationsRequest

func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) ListDocumentsRequest

func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *request.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/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 {
		// 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)
}
Output:

func (*SSM) UpdateAssociationStatusRequest

func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput) (req *request.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 `min:"10" type:"string" required:"true"`

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

func (UpdateAssociationStatusInput) GoString

func (s UpdateAssociationStatusInput) GoString() string

GoString returns the string representation

func (UpdateAssociationStatusInput) String

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

GoString returns the string representation

func (UpdateAssociationStatusOutput) String

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