This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
location_schema.go
70 lines (67 loc) · 2.57 KB
/
location_schema.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
package schemas
import (
"github.com/Azure/open-service-broker-azure/pkg/azure"
"github.com/Azure/open-service-broker-azure/pkg/service"
)
var (
azurePublicCloudLocationSchema = service.StringPropertySchema{
Title: "Location",
Description: "The Azure region in which to provision" +
" applicable resources.",
OneOf: []service.EnumValue{
{Value: "australiaeast", Title: "Australia East"},
{Value: "australiasoutheast", Title: "Australia Southeast"},
{Value: "brazilsouth", Title: "Brazil South"},
{Value: "canadacentral", Title: "Canada Central"},
{Value: "canadaeast", Title: "Canada East"},
{Value: "centralindia", Title: "Central India"},
{Value: "centralus", Title: "Central US"},
{Value: "eastasia", Title: "East Asia"},
{Value: "eastus", Title: "East US"},
{Value: "eastus2", Title: "East US 2"},
{Value: "japaneast", Title: "Japan East"},
{Value: "japanwest", Title: "Japan West"},
{Value: "koreacentral", Title: "Korea Central"},
{Value: "koreasouth", Title: "Korea South"},
{Value: "northcentralus", Title: "North Central US"},
{Value: "northeurope", Title: "North Europe"},
{Value: "southcentralus", Title: "South Central US"},
{Value: "southeastasia", Title: "Southeast Asia"},
{Value: "southindia", Title: "South India"},
{Value: "uksouth", Title: "UK South"},
{Value: "ukwest", Title: "UK West"},
{Value: "westcentralus", Title: "West Central US"},
{Value: "westeurope", Title: "West Europe"},
{Value: "westindia", Title: "West India"},
{Value: "westus", Title: "West US"},
{Value: "westus2", Title: "West US 2"},
},
}
azureChinaCloudLocationSchema = service.StringPropertySchema{
Title: "Location",
Description: "The Azure region in which to provision" +
" applicable resources.",
OneOf: []service.EnumValue{
{Value: "chinanorth2", Title: "China North 2"},
{Value: "chinanorth", Title: "China North"},
{Value: "chinaeast2", Title: "China East 2"},
{Value: "chinaeast", Title: "China East"},
},
}
)
// GetLocationSchema returns pointer to general StringPropertySchema
// of "location"
func GetLocationSchema() *service.StringPropertySchema {
environmentName := azure.GetEnvironmentName()
switch environmentName {
case "AzureChinaCloud":
return &azureChinaCloudLocationSchema
case "AzurePublicCloud":
return &azurePublicCloudLocationSchema
}
// We shouldn't run into here, this function is supposed
// to return at the `switch` statement. We return
// public location schema here so that the error can be
// reported when provisioning the resource.
return &azurePublicCloudLocationSchema
}