Skip to content

Commit

Permalink
add code
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-zhenhua committed Aug 2, 2022
1 parent dff3c08 commit 1d056eb
Show file tree
Hide file tree
Showing 35 changed files with 2,280 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/labeler-pull-request-triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ service/cost-management:
service/custom-resource-provider:
- internal/services/customproviders/**/*

service/dashboard:
- internal/services/dashboard/**/*

service/data-factory:
- internal/services/datafactory/**/*

Expand Down
1 change: 1 addition & 0 deletions .teamcity/components/generated/services.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var services = mapOf(
"costmanagement" to "Cost Management",
"customproviders" to "Custom Providers",
"dns" to "DNS",
"dashboard" to "Dashboard",
"datafactory" to "Data Factory",
"datashare" to "Data Share",
"databricks" to "DataBricks",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/google/go-cmp v0.5.8
github.com/google/uuid v1.1.2
github.com/hashicorp/go-azure-helpers v0.37.0
github.com/hashicorp/go-azure-sdk v0.20220725.1163004
github.com/hashicorp/go-azure-sdk v0.20220728.1092823
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/go-version v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv
github.com/hashicorp/go-azure-helpers v0.12.0/go.mod h1:Zc3v4DNeX6PDdy7NljlYpnrdac1++qNW0I4U+ofGwpg=
github.com/hashicorp/go-azure-helpers v0.37.0 h1:6UOoQ9esE4MJ4wHJr21qU81IJQ9zsXQ9FbANYUbeE4U=
github.com/hashicorp/go-azure-helpers v0.37.0/go.mod h1:gcutZ/Hf/O7YN9M3UIvyZ9l0Rxv7Yrc9x5sSfM9cuSw=
github.com/hashicorp/go-azure-sdk v0.20220725.1163004 h1:F6fxwMrEBiroVssWLY3/fIEJ4E6qJQfL1jvsnTYkHpU=
github.com/hashicorp/go-azure-sdk v0.20220725.1163004/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo=
github.com/hashicorp/go-azure-sdk v0.20220728.1092823 h1:+X1Lxb2oBQjRdV7KbhLsS/CS7LS5m/upl5rg4lzGeGI=
github.com/hashicorp/go-azure-sdk v0.20220728.1092823/go.mod h1:yjQPw8DCOtQR8E8+FNaTxF6yz+tyQGkDNiVAGCNoLOo=
github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU=
github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg=
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
Expand Down
3 changes: 3 additions & 0 deletions internal/clients/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
cosmosdb "github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos/client"
costmanagement "github.com/hashicorp/terraform-provider-azurerm/internal/services/costmanagement/client"
customproviders "github.com/hashicorp/terraform-provider-azurerm/internal/services/customproviders/client"
dashboard "github.com/hashicorp/terraform-provider-azurerm/internal/services/dashboard/client"
datamigration "github.com/hashicorp/terraform-provider-azurerm/internal/services/databasemigration/client"
databoxedge "github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge/client"
databricks "github.com/hashicorp/terraform-provider-azurerm/internal/services/databricks/client"
Expand Down Expand Up @@ -145,6 +146,7 @@ type Client struct {
Cosmos *cosmosdb.Client
CostManagement *costmanagement.Client
CustomProviders *customproviders.Client
Dashboard *dashboard.Client
DatabaseMigration *datamigration.Client
DataBricks *databricks.Client
DataboxEdge *databoxedge.Client
Expand Down Expand Up @@ -260,6 +262,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error
client.Cosmos = cosmosdb.NewClient(o)
client.CostManagement = costmanagement.NewClient(o)
client.CustomProviders = customproviders.NewClient(o)
client.Dashboard = dashboard.NewClient(o)
client.DatabaseMigration = datamigration.NewClient(o)
client.DataBricks = databricks.NewClient(o)
client.DataboxEdge = databoxedge.NewClient(o)
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cosmos"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/costmanagement"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/customproviders"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/dashboard"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databasemigration"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databoxedge"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/databricks"
Expand Down Expand Up @@ -123,6 +124,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration {
consumption.Registration{},
containers.Registration{},
costmanagement.Registration{},
dashboard.Registration{},
disks.Registration{},
domainservices.Registration{},
eventhub.Registration{},
Expand Down Expand Up @@ -169,6 +171,7 @@ func SupportedUntypedServices() []sdk.UntypedServiceRegistration {
consumption.Registration{},
cosmos.Registration{},
customproviders.Registration{},
dashboard.Registration{},
databricks.Registration{},
datadog.Registration{},
datafactory.Registration{},
Expand Down
20 changes: 20 additions & 0 deletions internal/services/dashboard/client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package client

import (
"github.com/hashicorp/go-azure-sdk/resource-manager/dashboard/2022-08-01/grafanaresource"
"github.com/hashicorp/terraform-provider-azurerm/internal/common"
)

type Client struct {
GrafanaResourceClient *grafanaresource.GrafanaResourceClient
}

func NewClient(o *common.ClientOptions) *Client {

grafanaResourceClient := grafanaresource.NewGrafanaResourceClientWithBaseURI(o.ResourceManagerEndpoint)
o.ConfigureClient(&grafanaResourceClient.Client, o.ResourceManagerAuthorizer)

return &Client{
GrafanaResourceClient: &grafanaResourceClient,
}
}
Loading

0 comments on commit 1d056eb

Please sign in to comment.