14324: Azure driver for crunch-dispatch-cloud
[arvados.git] / lib / dispatchcloud / instance_set_proxy.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package dispatchcloud
6
7 import (
8         "context"
9
10         "git.curoverse.com/arvados.git/lib/cloud"
11         "git.curoverse.com/arvados.git/sdk/go/arvados"
12         "golang.org/x/crypto/ssh"
13 )
14
15 type instanceSetProxy struct {
16         cloud.InstanceSet
17 }
18
19 func (is *instanceSetProxy) Create(ctx context.Context, it arvados.InstanceType, id cloud.ImageID, tags cloud.InstanceTags, pk ssh.PublicKey) (cloud.Instance, error) {
20         // TODO: return if Create failed recently with a RateLimitError or QuotaError
21         return is.InstanceSet.Create(ctx, it, id, tags, pk)
22 }
23
24 func (is *instanceSetProxy) Instances(ctx context.Context, tags cloud.InstanceTags) ([]cloud.Instance, error) {
25         // TODO: return if Instances failed recently with a RateLimitError
26         return is.InstanceSet.Instances(ctx, tags)
27 }