service.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package ecs
  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 Container Service (Amazon ECS) is a highly scalable, fast, container
  13. // management service that makes it easy to run, stop, and manage Docker containers
  14. // on a cluster of Amazon EC2 instances. Amazon ECS lets you launch and stop
  15. // container-enabled applications with simple API calls, allows you to get the
  16. // state of your cluster from a centralized service, and gives you access to
  17. // many familiar Amazon EC2 features like security groups, Amazon EBS volumes,
  18. // and IAM roles.
  19. //
  20. // You can use Amazon ECS to schedule the placement of containers across your
  21. // cluster based on your resource needs, isolation policies, and availability
  22. // requirements. Amazon EC2 Container Service eliminates the need for you to
  23. // operate your own cluster management and configuration management systems
  24. // or worry about scaling your management infrastructure.
  25. type ECS struct {
  26. *service.Service
  27. }
  28. // Used for custom service initialization logic
  29. var initService func(*service.Service)
  30. // Used for custom request initialization logic
  31. var initRequest func(*request.Request)
  32. // New returns a new ECS client.
  33. func New(config *aws.Config) *ECS {
  34. service := &service.Service{
  35. ServiceInfo: serviceinfo.ServiceInfo{
  36. Config: defaults.DefaultConfig.Merge(config),
  37. ServiceName: "ecs",
  38. APIVersion: "2014-11-13",
  39. JSONVersion: "1.1",
  40. TargetPrefix: "AmazonEC2ContainerServiceV20141113",
  41. },
  42. }
  43. service.Initialize()
  44. // Handlers
  45. service.Handlers.Sign.PushBack(v4.Sign)
  46. service.Handlers.Build.PushBack(jsonrpc.Build)
  47. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  48. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  49. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  50. // Run custom service initialization if present
  51. if initService != nil {
  52. initService(service)
  53. }
  54. return &ECS{service}
  55. }
  56. // newRequest creates a new request for a ECS operation and runs any
  57. // custom request initialization.
  58. func (c *ECS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  59. req := c.NewRequest(op, params, data)
  60. // Run custom request initialization if present
  61. if initRequest != nil {
  62. initRequest(req)
  63. }
  64. return req
  65. }