Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/importer-rest-api-specs: New Common IDs for Kusto Cluster and Kusto Database #3176

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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