service.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package ssm
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/defaults"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/aws/service"
  8. "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
  9. "github.com/aws/aws-sdk-go/internal/protocol/jsonrpc"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // Amazon EC2 Simple Systems Manager (SSM) enables you to configure and manage
  13. // your EC2 instances. You can create a configuration document and then associate
  14. // it with one or more running instances.
  15. //
  16. // You can use a configuration document to automate the following tasks for
  17. // your Windows instances:
  18. //
  19. // Join an AWS Directory
  20. //
  21. // Install, repair, or uninstall software using an MSI package
  22. //
  23. // Run PowerShell scripts
  24. //
  25. // Configure CloudWatch Logs to monitor applications and systems
  26. //
  27. // Note that configuration documents are not supported on Linux instances.
  28. type SSM struct {
  29. *service.Service
  30. }
  31. // Used for custom service initialization logic
  32. var initService func(*service.Service)
  33. // Used for custom request initialization logic
  34. var initRequest func(*request.Request)
  35. // New returns a new SSM client.
  36. func New(config *aws.Config) *SSM {
  37. service := &service.Service{
  38. ServiceInfo: serviceinfo.ServiceInfo{
  39. Config: defaults.DefaultConfig.Merge(config),
  40. ServiceName: "ssm",
  41. APIVersion: "2014-11-06",
  42. JSONVersion: "1.1",
  43. TargetPrefix: "AmazonSSM",
  44. },
  45. }
  46. service.Initialize()
  47. // Handlers
  48. service.Handlers.Sign.PushBack(v4.Sign)
  49. service.Handlers.Build.PushBack(jsonrpc.Build)
  50. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  51. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  52. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  53. // Run custom service initialization if present
  54. if initService != nil {
  55. initService(service)
  56. }
  57. return &SSM{service}
  58. }
  59. // newRequest creates a new request for a SSM operation and runs any
  60. // custom request initialization.
  61. func (c *SSM) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  62. req := c.NewRequest(op, params, data)
  63. // Run custom request initialization if present
  64. if initRequest != nil {
  65. initRequest(req)
  66. }
  67. return req
  68. }