-
Notifications
You must be signed in to change notification settings - Fork 30
/
service.go
81 lines (66 loc) · 4.31 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package multai
import (
"context"
"github.com/spotinst/spotinst-sdk-go/spotinst"
"github.com/spotinst/spotinst-sdk-go/spotinst/client"
"github.com/spotinst/spotinst-sdk-go/spotinst/session"
)
// Service provides the API operation methods for making requests to endpoints
// of the Spotinst API. See this package's package overview docs for details on
// the service.
type Service interface {
ListLoadBalancers(context.Context, *ListLoadBalancersInput) (*ListLoadBalancersOutput, error)
CreateLoadBalancer(context.Context, *CreateLoadBalancerInput) (*CreateLoadBalancerOutput, error)
ReadLoadBalancer(context.Context, *ReadLoadBalancerInput) (*ReadLoadBalancerOutput, error)
UpdateLoadBalancer(context.Context, *UpdateLoadBalancerInput) (*UpdateLoadBalancerOutput, error)
DeleteLoadBalancer(context.Context, *DeleteLoadBalancerInput) (*DeleteLoadBalancerOutput, error)
ListListeners(context.Context, *ListListenersInput) (*ListListenersOutput, error)
CreateListener(context.Context, *CreateListenerInput) (*CreateListenerOutput, error)
ReadListener(context.Context, *ReadListenerInput) (*ReadListenerOutput, error)
UpdateListener(context.Context, *UpdateListenerInput) (*UpdateListenerOutput, error)
DeleteListener(context.Context, *DeleteListenerInput) (*DeleteListenerOutput, error)
ListRoutingRules(context.Context, *ListRoutingRulesInput) (*ListRoutingRulesOutput, error)
CreateRoutingRule(context.Context, *CreateRoutingRuleInput) (*CreateRoutingRuleOutput, error)
ReadRoutingRule(context.Context, *ReadRoutingRuleInput) (*ReadRoutingRuleOutput, error)
UpdateRoutingRule(context.Context, *UpdateRoutingRuleInput) (*UpdateRoutingRuleOutput, error)
DeleteRoutingRule(context.Context, *DeleteRoutingRuleInput) (*DeleteRoutingRuleOutput, error)
ListMiddlewares(context.Context, *ListMiddlewaresInput) (*ListMiddlewaresOutput, error)
CreateMiddleware(context.Context, *CreateMiddlewareInput) (*CreateMiddlewareOutput, error)
ReadMiddleware(context.Context, *ReadMiddlewareInput) (*ReadMiddlewareOutput, error)
UpdateMiddleware(context.Context, *UpdateMiddlewareInput) (*UpdateMiddlewareOutput, error)
DeleteMiddleware(context.Context, *DeleteMiddlewareInput) (*DeleteMiddlewareOutput, error)
ListTargetSets(context.Context, *ListTargetSetsInput) (*ListTargetSetsOutput, error)
CreateTargetSet(context.Context, *CreateTargetSetInput) (*CreateTargetSetOutput, error)
ReadTargetSet(context.Context, *ReadTargetSetInput) (*ReadTargetSetOutput, error)
UpdateTargetSet(context.Context, *UpdateTargetSetInput) (*UpdateTargetSetOutput, error)
DeleteTargetSet(context.Context, *DeleteTargetSetInput) (*DeleteTargetSetOutput, error)
ListTargets(context.Context, *ListTargetsInput) (*ListTargetsOutput, error)
CreateTarget(context.Context, *CreateTargetInput) (*CreateTargetOutput, error)
ReadTarget(context.Context, *ReadTargetInput) (*ReadTargetOutput, error)
UpdateTarget(context.Context, *UpdateTargetInput) (*UpdateTargetOutput, error)
DeleteTarget(context.Context, *DeleteTargetInput) (*DeleteTargetOutput, error)
ListDeployments(context.Context, *ListDeploymentsInput) (*ListDeploymentsOutput, error)
CreateDeployment(context.Context, *CreateDeploymentInput) (*CreateDeploymentOutput, error)
ReadDeployment(context.Context, *ReadDeploymentInput) (*ReadDeploymentOutput, error)
UpdateDeployment(context.Context, *UpdateDeploymentInput) (*UpdateDeploymentOutput, error)
DeleteDeployment(context.Context, *DeleteDeploymentInput) (*DeleteDeploymentOutput, error)
ListCertificates(context.Context, *ListCertificatesInput) (*ListCertificatesOutput, error)
CreateCertificate(context.Context, *CreateCertificateInput) (*CreateCertificateOutput, error)
ReadCertificate(context.Context, *ReadCertificateInput) (*ReadCertificateOutput, error)
UpdateCertificate(context.Context, *UpdateCertificateInput) (*UpdateCertificateOutput, error)
DeleteCertificate(context.Context, *DeleteCertificateInput) (*DeleteCertificateOutput, error)
ListRuntimes(context.Context, *ListRuntimesInput) (*ListRuntimesOutput, error)
ReadRuntime(context.Context, *ReadRuntimeInput) (*ReadRuntimeOutput, error)
}
type ServiceOp struct {
Client *client.Client
}
var _ Service = &ServiceOp{}
func New(sess *session.Session, cfgs ...*spotinst.Config) *ServiceOp {
cfg := &spotinst.Config{}
cfg.Merge(sess.Config)
cfg.Merge(cfgs...)
return &ServiceOp{
Client: client.New(sess.Config),
}
}