func (az *AzureProvider) Create(ctx context.Context,
instanceType arvados.InstanceType,
imageId ImageID,
- newTags map[string]string) (Instance, error) {
+ newTags InstanceTags) (Instance, error) {
name, err := randutil.String(15, "abcdefghijklmnopqrstuvwxyz0123456789")
if err != nil {
return ai.instanceType
}
-func (ai *AzureInstance) SetTags(ctx context.Context, newTags map[string]string) error {
+func (ai *AzureInstance) SetTags(ctx context.Context, newTags InstanceTags) error {
tags := make(map[string]*string)
for k, v := range ai.vm.Tags {
return nil
}
-func (ai *AzureInstance) GetTags(ctx context.Context) (map[string]string, error) {
+func (ai *AzureInstance) GetTags(ctx context.Context) (InstanceTags, error) {
tags := make(map[string]string)
for k, v := range ai.vm.Tags {
error
}
-type InstanceTag string
+type InstanceTags map[string]string
type InstanceID string
type ImageID string
// Configured Arvados instance type
InstanceType() arvados.InstanceType
// Get tags
- GetTags(context.Context) (map[string]string, error)
+ GetTags(context.Context) (InstanceTags, error)
// Replace tags with the given tags
- SetTags(context.Context, map[string]string) error
+ SetTags(context.Context, InstanceTags) error
// Shut down the node
Destroy(context.Context) error
// SSH server hostname or IP address, or empty string if unknown pending creation.
}
type Provider interface {
- Create(context.Context, arvados.InstanceType, ImageID, map[string]string) (Instance, error)
+ Create(context.Context, arvados.InstanceType, ImageID, InstanceTags) (Instance, error)
Instances(context.Context) ([]Instance, error)
}