forked from rexray/rexray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azureud.go
111 lines (81 loc) · 3.33 KB
/
azureud.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package azureud
import (
gofigCore "github.com/akutz/gofig"
gofig "github.com/akutz/gofig/types"
)
const (
// Name is the provider's name.
Name = "azureud"
// TagDelimiter separates tags from volume or snapshot names
TagDelimiter = "/"
// DefaultUseHTTPS - Use https prefix by default
// or not for Azure URI's
DefaultUseHTTPS = true
// TenantIDKey is an Active Directory ID from Azure
TenantIDKey = "tenantID"
// ClientIDKey is an Application ID from Azure
ClientIDKey = "clientID"
// ClientSecretKey is a secret of the application
ClientSecretKey = "clientSecret"
// CertPathKey is a path to application certificate in case of
// authorization via certificate
CertPathKey = "certPath"
// StorageAccountKey is a name of storage account
StorageAccountKey = "storageAccount"
// StorageAccessKey is an access key of storage account
StorageAccessKey = "storageAccessKey"
// TODO: add option to pass StorageURI
// SubscriptionIDKey is an ID of subscription
SubscriptionIDKey = "subscriptionID"
// ResourceGroupKey is a name of resource group
ResourceGroupKey = "resourceGroup"
// ContainerKey is a name of container in the storage account
// ('vhds' by default)
ContainerKey = "container"
// UseHTTPSKey is a flag about use https or not for making Azure URI's
UseHTTPSKey = "useHTTPS"
// TagKey is a tag key
TagKey = "tag"
)
const (
// ConfigAzure is a config key
ConfigAzure = Name
// ConfigAzureSubscriptionIDKey is a config key
ConfigAzureSubscriptionIDKey = ConfigAzure + "." + SubscriptionIDKey
// ConfigAzureResourceGroupKey is a config key
ConfigAzureResourceGroupKey = ConfigAzure + "." + ResourceGroupKey
// ConfigAzureTenantIDKey is a config key
ConfigAzureTenantIDKey = ConfigAzure + "." + TenantIDKey
// ConfigAzureStorageAccountKey is a config key
ConfigAzureStorageAccountKey = ConfigAzure + "." + StorageAccountKey
// ConfigAzureStorageAccessKey is a config key
ConfigAzureStorageAccessKey = ConfigAzure + "." + StorageAccessKey
// ConfigAzureContainerKey is a config key
ConfigAzureContainerKey = ConfigAzure + "." + ContainerKey
// ConfigAzureClientIDKey is a config key
ConfigAzureClientIDKey = ConfigAzure + "." + ClientIDKey
// ConfigAzureClientSecretKey is a config key
ConfigAzureClientSecretKey = ConfigAzure + "." + ClientSecretKey
// ConfigAzureCertPathKey is a config key
ConfigAzureCertPathKey = ConfigAzure + "." + CertPathKey
// ConfigAzureUseHTTPSKey is a config key
ConfigAzureUseHTTPSKey = ConfigAzure + "." + UseHTTPSKey
// ConfigAzureTagKey is a config key
ConfigAzureTagKey = ConfigAzure + "." + TagKey
)
func init() {
r := gofigCore.NewRegistration("AzureUnmanagedDisk")
r.Key(gofig.String, "", "", "", ConfigAzureSubscriptionIDKey)
r.Key(gofig.String, "", "", "", ConfigAzureResourceGroupKey)
r.Key(gofig.String, "", "", "", ConfigAzureTenantIDKey)
r.Key(gofig.String, "", "", "", ConfigAzureStorageAccountKey)
r.Key(gofig.String, "", "", "", ConfigAzureStorageAccessKey)
r.Key(gofig.String, "", "vhds", "", ConfigAzureContainerKey)
r.Key(gofig.String, "", "", "", ConfigAzureClientIDKey)
r.Key(gofig.String, "", "", "", ConfigAzureClientSecretKey)
r.Key(gofig.String, "", "", "", ConfigAzureCertPathKey)
r.Key(gofig.Bool, "", DefaultUseHTTPS, "", ConfigAzureUseHTTPSKey)
r.Key(gofig.String, "", "",
"Tag prefix for Azure naming", ConfigAzureTagKey)
gofigCore.Register(r)
}