Skip to content

Commit

Permalink
Merge pull request #3176 from hashicorp/f/new-common-ids-kusto
Browse files Browse the repository at this point in the history
`tools/importer-rest-api-specs`: New Common IDs for Kusto Cluster and Kusto Database
  • Loading branch information
tombuildsstuff authored Jan 11, 2024
2 parents 1f3faf6 + 90f6498 commit 0027218
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 0027218

Please sign in to comment.