Skip to content

Commit

Permalink
tools/importer-rest-api-specs: New Common IDs for Kusto Cluster and K…
Browse files Browse the repository at this point in the history
…usto Database

Dependent on hashicorp/go-azure-helpers#186
  • Loading branch information
tombuildsstuff committed Oct 16, 2023
1 parent 5f967ad commit 90f6498
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package resourceids

import (
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
"github.com/hashicorp/pandora/tools/sdk/resourcemanager"
)

var _ commonIdMatcher = commonIdKustoCluster{}

type commonIdKustoCluster struct{}

func (c commonIdKustoCluster) id() models.ParsedResourceId {
name := "KustoCluster"
return models.ParsedResourceId{
CommonAlias: &name,
Constants: map[string]resourcemanager.ConstantDetails{},
Segments: []resourcemanager.ResourceIdSegment{
models.StaticResourceIDSegment("staticSubscriptions", "subscriptions"),
models.SubscriptionIDResourceIDSegment("subscriptionId"),
models.StaticResourceIDSegment("staticResourceGroups", "resourceGroups"),
models.ResourceGroupResourceIDSegment("resourceGroupName"),
models.StaticResourceIDSegment("staticProviders", "providers"),
models.ResourceProviderResourceIDSegment("staticMicrosoftKusto", "Microsoft.Kusto"),
models.StaticResourceIDSegment("staticClusters", "clusters"),
models.UserSpecifiedResourceIDSegment("kustoClusterName"),
},
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package resourceids

import (
"github.com/hashicorp/pandora/tools/importer-rest-api-specs/models"
"github.com/hashicorp/pandora/tools/sdk/resourcemanager"
)

var _ commonIdMatcher = commonIdKustoDatabase{}

type commonIdKustoDatabase struct{}

func (c commonIdKustoDatabase) id() models.ParsedResourceId {
name := "KustoDatabase"
return models.ParsedResourceId{
CommonAlias: &name,
Constants: map[string]resourcemanager.ConstantDetails{},
Segments: []resourcemanager.ResourceIdSegment{
models.StaticResourceIDSegment("staticSubscriptions", "subscriptions"),
models.SubscriptionIDResourceIDSegment("subscriptionId"),
models.StaticResourceIDSegment("staticResourceGroups", "resourceGroups"),
models.ResourceGroupResourceIDSegment("resourceGroupName"),
models.StaticResourceIDSegment("staticProviders", "providers"),
models.ResourceProviderResourceIDSegment("staticMicrosoftKusto", "Microsoft.Kusto"),
models.StaticResourceIDSegment("staticClusters", "clusters"),
models.UserSpecifiedResourceIDSegment("kustoClusterName"),
models.StaticResourceIDSegment("staticDatabases", "databases"),
models.UserSpecifiedResourceIDSegment("kustoDatabaseName"),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ var commonIdTypes = []commonIdMatcher{
commonIdVirtualNetwork{},
commonIdVPNConnection{},

// Kusto
commonIdKustoCluster{},
commonIdKustoDatabase{},

// RP Specific
commonIdCloudServicesIPConfiguration{},
commonIdCloudServicesPublicIPAddress{},
Expand Down

0 comments on commit 90f6498

Please sign in to comment.