Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit ea4af64

Browse files
committed
add default api urls
1 parent 49ae45a commit ea4af64

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

gcore/provider.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ const (
2727
func Provider() *schema.Provider {
2828
return &schema.Provider{
2929
Schema: map[string]*schema.Schema{
30-
"user_name": &schema.Schema{
30+
"user_name": {
3131
Type: schema.TypeString,
3232
Optional: true,
3333
DefaultFunc: schema.EnvDefaultFunc("GCORE_USERNAME", ""),
3434
},
35-
"password": &schema.Schema{
35+
"password": {
3636
Type: schema.TypeString,
3737
Optional: true,
3838
DefaultFunc: schema.EnvDefaultFunc("GCORE_PASSWORD", ""),
@@ -50,37 +50,37 @@ func Provider() *schema.Provider {
5050
Description: "Should be set to true when you are gonna to use storage resource with permanent API-token only.",
5151
DefaultFunc: schema.EnvDefaultFunc("GCORE_PERMANENT_TOKEN", ""),
5252
},
53-
"gcore_platform": &schema.Schema{
53+
"gcore_platform": {
5454
Type: schema.TypeString,
5555
Optional: true,
5656
Description: "Platform ulr is used for generate jwt",
57-
DefaultFunc: schema.EnvDefaultFunc("GCORE_PLATFORM", ""),
57+
DefaultFunc: schema.EnvDefaultFunc("GCORE_PLATFORM", "https://api.gcdn.co"),
5858
},
59-
"gcore_api": &schema.Schema{
59+
"gcore_api": {
6060
Type: schema.TypeString,
6161
Optional: true,
6262
Description: "Region API",
63-
DefaultFunc: schema.EnvDefaultFunc("GCORE_API", ""),
63+
DefaultFunc: schema.EnvDefaultFunc("GCORE_API", "https://api.cloud.gcorelabs.com"),
6464
},
65-
"gcore_cdn_api": &schema.Schema{
65+
"gcore_cdn_api": {
6666
Type: schema.TypeString,
6767
Optional: true,
6868
Description: "CDN API",
6969
DefaultFunc: schema.EnvDefaultFunc("GCORE_CDN_API", ""),
7070
},
71-
"gcore_storage_api": &schema.Schema{
71+
"gcore_storage_api": {
7272
Type: schema.TypeString,
7373
Optional: true,
7474
Description: "Storage API",
75-
DefaultFunc: schema.EnvDefaultFunc("GCORE_STORAGE_API", ""),
75+
DefaultFunc: schema.EnvDefaultFunc("GCORE_STORAGE_API", "https://storage.gcorelabs.com/api"),
7676
},
7777
"gcore_dns_api": {
7878
Type: schema.TypeString,
7979
Optional: true,
8080
Description: "DNS API",
81-
DefaultFunc: schema.EnvDefaultFunc("GCORE_DNS_API", ""),
81+
DefaultFunc: schema.EnvDefaultFunc("GCORE_DNS_API", "https://dnsapi.gcorelabs.com"),
8282
},
83-
"gcore_client_id": &schema.Schema{
83+
"gcore_client_id": {
8484
Type: schema.TypeString,
8585
Optional: true,
8686
Description: "Client id",
@@ -143,7 +143,7 @@ func Provider() *schema.Provider {
143143
}
144144
}
145145

146-
func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
146+
func providerConfigure(_ context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
147147
username := d.Get("user_name").(string)
148148
password := d.Get("password").(string)
149149
permanentToken := d.Get(ProviderOptPermanentToken).(string)

0 commit comments

Comments
 (0)