Skip to content

Commit

Permalink
Merge pull request #3400 from hashicorp/f/common-id-for-hdinsight
Browse files Browse the repository at this point in the history
tools/importer-rest-api-specs: HDInsight Cluster is now a Common ID
  • Loading branch information
tombuildsstuff authored Dec 14, 2023
2 parents 65f6c5d + 58e7863 commit d0650ff
Show file tree
Hide file tree
Showing 2 changed files with 31 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 = commonIdHDInsightCluster{}

type commonIdHDInsightCluster struct{}

func (c commonIdHDInsightCluster) id() models.ParsedResourceId {
name := "HDInsightCluster"
return models.ParsedResourceId{
CommonAlias: &name,
Constants: map[string]resourcemanager.ConstantDetails{},
Segments: []resourcemanager.ResourceIdSegment{
models.StaticResourceIDSegment("subscriptions", "subscriptions"),
models.SubscriptionIDResourceIDSegment("subscriptionId"),
models.StaticResourceIDSegment("resourceGroups", "resourceGroups"),
models.ResourceGroupResourceIDSegment("resourceGroupName"),
models.StaticResourceIDSegment("providers", "providers"),
models.ResourceProviderResourceIDSegment("resourceProvider", "Microsoft.HDInsight"),
models.StaticResourceIDSegment("clusters", "clusters"),
models.UserSpecifiedResourceIDSegment("clusterName"),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ var commonIdTypes = []commonIdMatcher{
commonIdAutomationCompilationJob{}, // (@stephybun) CompilationJobId segment is defined in three different ways `jobId`, `compilationJobId` and `compilationJobName`
commonIdProvisioningService{}, // (@jackofallops): Inconsistent user specified fields in the swagger - `provisioningServices/{resourceName}` vs `provisioningServices/{provisioningServiceName}`

// HDInsight
commonIdHDInsightCluster{},

// Key Vault
commonIdKeyVault{},
commonIdKeyVaultKey{},
Expand Down

0 comments on commit d0650ff

Please sign in to comment.