Skip to content

Commit

Permalink
tools/importer-rest-api-specs: adding Common IDs for App Service / Ap…
Browse files Browse the repository at this point in the history
…p Service Plan / App Service Environment
  • Loading branch information
tombuildsstuff committed Jul 25, 2023
1 parent cd392f6 commit d767bac
Show file tree
Hide file tree
Showing 4 changed files with 89 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 = commonIdAppService{}

type commonIdAppService struct{}

func (c commonIdAppService) id() models.ParsedResourceId {
name := "AppService"
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.Web"),
models.StaticResourceIDSegment("sites", "sites"),
models.UserSpecifiedResourceIDSegment("siteName"),
},
}
}
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 = commonIdAppServiceEnvironment{}

type commonIdAppServiceEnvironment struct{}

func (c commonIdAppServiceEnvironment) id() models.ParsedResourceId {
name := "AppServiceEnvironment"
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.Web"),
models.StaticResourceIDSegment("hostingEnvironments", "hostingEnvironments"),
models.UserSpecifiedResourceIDSegment("hostingEnvironmentName"),
},
}
}
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 = commonIdAppServicePlan{}

type commonIdAppServicePlan struct{}

func (c commonIdAppServicePlan) id() models.ParsedResourceId {
name := "AppServicePlan"
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.Web"),
models.StaticResourceIDSegment("serverFarms", "serverFarms"),
models.UserSpecifiedResourceIDSegment("serverFarmName"),
},
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ var commonIdTypes = []commonIdMatcher{
commonIdKeyVaultKeyVersion{},
commonIdKeyVaultPrivateEndpointConnection{},

// Web / App Service
commonIdAppService{},
commonIdAppServiceEnvironment{},
commonIdAppServicePlan{},

// Parent IDs
commonIdKubernetesCluster{},
}
Expand Down

0 comments on commit d767bac

Please sign in to comment.