diff --git a/.github/labeler-issue-triage.yml b/.github/labeler-issue-triage.yml index 02be616bacb3..a868ee29ee24 100644 --- a/.github/labeler-issue-triage.yml +++ b/.github/labeler-issue-triage.yml @@ -30,6 +30,9 @@ service/app-service: service/application-insights: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_application_insights((.|\n)*)###' +service/arc-resource-bridge: + - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_arc_resource_bridge_appliance((.|\n)*)###' + service/attestation: - '### (|New or )Affected Resource\(s\)\/Data Source\(s\)((.|\n)*)azurerm_attestation_provider((.|\n)*)###' diff --git a/.github/labeler-pull-request-triage.yml b/.github/labeler-pull-request-triage.yml index d02368e107e6..63360164cadd 100644 --- a/.github/labeler-pull-request-triage.yml +++ b/.github/labeler-pull-request-triage.yml @@ -28,6 +28,9 @@ service/app-service: service/application-insights: - internal/services/applicationinsights/**/* +service/arc-resource-bridge: + - internal/services/arcresourcebridge/**/* + service/attestation: - internal/services/attestation/**/* diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 3091b615091b..00d9e83827a3 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -10,6 +10,7 @@ var services = mapOf( "appconfiguration" to "App Configuration", "appservice" to "AppService", "applicationinsights" to "Application Insights", + "arcresourcebridge" to "Arc Resource Bridge", "arckubernetes" to "ArcKubernetes", "attestation" to "Attestation", "authorization" to "Authorization", diff --git a/internal/clients/client.go b/internal/clients/client.go index 2fe19fdc270f..42a84a9bfece 100644 --- a/internal/clients/client.go +++ b/internal/clients/client.go @@ -30,6 +30,7 @@ import ( applicationInsights "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights/client" appService "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice/client" arckubernetes "github.com/hashicorp/terraform-provider-azurerm/internal/services/arckubernetes/client" + arcResourceBridge "github.com/hashicorp/terraform-provider-azurerm/internal/services/arcresourcebridge/client" attestation "github.com/hashicorp/terraform-provider-azurerm/internal/services/attestation/client" authorization "github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization/client" automanage "github.com/hashicorp/terraform-provider-azurerm/internal/services/automanage/client" @@ -162,6 +163,7 @@ type Client struct { AppPlatform *appPlatform.Client AppService *appService.Client ArcKubernetes *arckubernetes.Client + ArcResourceBridge *arcResourceBridge.Client Attestation *attestation.Client Authorization *authorization.Client Automanage *automanage.Client @@ -314,6 +316,9 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error if client.ArcKubernetes, err = arckubernetes.NewClient(o); err != nil { return fmt.Errorf("building clients for ArcKubernetes: %+v", err) } + if client.ArcResourceBridge, err = arcResourceBridge.NewClient(o); err != nil { + return fmt.Errorf("building clients for Arc Resource Bridge: %+v", err) + } if client.Attestation, err = attestation.NewClient(o); err != nil { return fmt.Errorf("building clients for Attestation: %+v", err) } diff --git a/internal/provider/services.go b/internal/provider/services.go index d5bb4c99babe..251ee20d930b 100644 --- a/internal/provider/services.go +++ b/internal/provider/services.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/internal/services/applicationinsights" "github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice" "github.com/hashicorp/terraform-provider-azurerm/internal/services/arckubernetes" + "github.com/hashicorp/terraform-provider-azurerm/internal/services/arcresourcebridge" "github.com/hashicorp/terraform-provider-azurerm/internal/services/attestation" "github.com/hashicorp/terraform-provider-azurerm/internal/services/authorization" "github.com/hashicorp/terraform-provider-azurerm/internal/services/automanage" @@ -139,6 +140,7 @@ func SupportedTypedServices() []sdk.TypedServiceRegistration { applicationinsights.Registration{}, appservice.Registration{}, arckubernetes.Registration{}, + arcresourcebridge.Registration{}, authorization.Registration{}, automanage.Registration{}, automation.Registration{}, diff --git a/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource.go b/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource.go new file mode 100644 index 000000000000..997d31885379 --- /dev/null +++ b/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource.go @@ -0,0 +1,276 @@ +package arcresourcebridge + +import ( + "context" + "fmt" + "regexp" + "time" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-helpers/lang/response" + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonschema" + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/location" + "github.com/hashicorp/go-azure-helpers/resourcemanager/tags" + "github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" +) + +var _ sdk.Resource = ArcResourceBridgeApplianceResource{} + +type ArcResourceBridgeApplianceResource struct{} + +type ApplianceModel struct { + Name string `tfschema:"name"` + ResourceGroupName string `tfschema:"resource_group_name"` + Location string `tfschema:"location"` + Distro appliances.Distro `tfschema:"distro"` + Identity []identity.ModelSystemAssigned `tfschema:"identity"` + Provider appliances.Provider `tfschema:"infrastructure_provider"` + PublicKeyBase64 string `tfschema:"public_key_base64"` + Tags map[string]interface{} `tfschema:"tags"` +} + +func (r ArcResourceBridgeApplianceResource) Arguments() map[string]*schema.Schema { + return map[string]*schema.Schema{ + "name": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 260), + validation.StringMatch(regexp.MustCompile(`[^+#%&'?/,%\\]+$`), "any of '+', '#', '%', '&', ''', '?', '/', ',', '%', '&', '\\', are not allowed"), + ), + }, + + "resource_group_name": commonschema.ResourceGroupName(), + + "location": commonschema.Location(), + + "distro": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(appliances.DistroAKSEdge), + }, false), + }, + + "identity": commonschema.SystemAssignedIdentityRequiredForceNew(), + + "infrastructure_provider": { + Type: pluginsdk.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + string(appliances.ProviderHCI), + string(appliances.ProviderSCVMM), + string(appliances.ProviderVMWare), + }, false), + }, + + "public_key_base64": { + Type: pluginsdk.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validate.Base64EncodedString, + }, + + "tags": commonschema.Tags(), + } +} + +func (r ArcResourceBridgeApplianceResource) Attributes() map[string]*schema.Schema { + return map[string]*pluginsdk.Schema{} +} + +func (r ArcResourceBridgeApplianceResource) ModelObject() interface{} { + return &ArcResourceBridgeApplianceResource{} +} + +func (r ArcResourceBridgeApplianceResource) ResourceType() string { + return "azurerm_arc_resource_bridge_appliance" +} + +func (r ArcResourceBridgeApplianceResource) Create() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 60 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + var model ApplianceModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + client := metadata.Client.ArcResourceBridge.AppliancesClient + subscriptionId := metadata.Client.Account.SubscriptionId + + id := appliances.NewApplianceID(subscriptionId, model.ResourceGroupName, model.Name) + existing, err := client.Get(ctx, id) + if err != nil && !response.WasNotFound(existing.HttpResponse) { + return fmt.Errorf("checking for presence of existing %s: %+v", id, err) + } + if !response.WasNotFound(existing.HttpResponse) { + return metadata.ResourceRequiresImport(r.ResourceType(), id) + } + + identity, err := identity.ExpandSystemAssignedFromModel(model.Identity) + if err != nil { + return err + } + + parameters := appliances.Appliance{ + Location: location.Normalize(model.Location), + Properties: &appliances.ApplianceProperties{ + Distro: pointer.To(model.Distro), + InfrastructureConfig: &appliances.AppliancePropertiesInfrastructureConfig{ + Provider: pointer.To(model.Provider), + }, + }, + Tags: tags.Expand(model.Tags), + } + + parameters.Identity = identity + + if err := client.CreateOrUpdateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + + // since the public key could not be set during creation, update after creation + if model.PublicKeyBase64 != "" { + parameters.Properties.PublicKey = pointer.To(model.PublicKeyBase64) + + if err := client.CreateOrUpdateThenPoll(ctx, id, parameters); err != nil { + return fmt.Errorf("creating %s: %+v", id, err) + } + } + + metadata.SetID(id) + return nil + }, + } +} + +func (r ArcResourceBridgeApplianceResource) Update() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.ArcResourceBridge.AppliancesClient + + id, err := appliances.ParseApplianceID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + metadata.Logger.Infof("Decoding state for %s", *id) + var model ApplianceModel + if err := metadata.Decode(&model); err != nil { + return fmt.Errorf("decoding: %+v", err) + } + + resp, err := client.Get(ctx, *id) + if err != nil { + return fmt.Errorf("retrieving %s: %+v", *id, err) + } + + parameters := resp.Model + if parameters == nil { + return fmt.Errorf("retrieving %s: model was nil", *id) + } + + if metadata.ResourceData.HasChange("identity") { + identity, err := identity.ExpandSystemAssignedFromModel(model.Identity) + if err != nil { + return err + } + + parameters.Identity = identity + } + + if metadata.ResourceData.HasChange("tags") { + parameters.Tags = tags.Expand(model.Tags) + } + + if metadata.ResourceData.HasChanges("public_key_base64") { + if parameters.Properties == nil { + parameters.Properties = &appliances.ApplianceProperties{} + } + parameters.Properties.PublicKey = pointer.To(model.PublicKeyBase64) + } + + if err := client.CreateOrUpdateThenPoll(ctx, *id, *parameters); err != nil { + return fmt.Errorf("updating %s: %+v", id, err) + } + + return nil + }, + } +} + +func (r ArcResourceBridgeApplianceResource) Read() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 5 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + id, err := appliances.ParseApplianceID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + client := metadata.Client.ArcResourceBridge.AppliancesClient + + resp, err := client.Get(ctx, *id) + if err != nil { + if response.WasNotFound(resp.HttpResponse) { + return metadata.MarkAsGone(*id) + } + return fmt.Errorf("retrieving %q: %+v", *id, err) + } + + state := ApplianceModel{ + Name: id.ApplianceName, + ResourceGroupName: id.ResourceGroupName, + } + + if model := resp.Model; model != nil { + state.Location = location.Normalize(model.Location) + state.Identity = identity.FlattenSystemAssignedToModel(model.Identity) + state.Tags = tags.Flatten(model.Tags) + + if props := model.Properties; props != nil { + state.Distro = pointer.From(props.Distro) + state.PublicKeyBase64 = pointer.From(props.PublicKey) + + if infraConfig := props.InfrastructureConfig; infraConfig != nil { + state.Provider = pointer.From(infraConfig.Provider) + } + } + } + return metadata.Encode(&state) + }, + } +} + +func (r ArcResourceBridgeApplianceResource) Delete() sdk.ResourceFunc { + return sdk.ResourceFunc{ + Timeout: 30 * time.Minute, + Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { + client := metadata.Client.ArcResourceBridge.AppliancesClient + id, err := appliances.ParseApplianceID(metadata.ResourceData.Id()) + if err != nil { + return err + } + + if err := client.DeleteThenPoll(ctx, *id); err != nil { + return fmt.Errorf("deleting %s: %+v", *id, err) + } + + return nil + }, + } +} + +func (r ArcResourceBridgeApplianceResource) IDValidationFunc() pluginsdk.SchemaValidateFunc { + return appliances.ValidateApplianceID +} diff --git a/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource_test.go b/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource_test.go new file mode 100644 index 000000000000..e332808c1952 --- /dev/null +++ b/internal/services/arcresourcebridge/arc_resource_bridge_appliance_resource_test.go @@ -0,0 +1,207 @@ +package arcresourcebridge_test + +import ( + "context" + cryptoRand "crypto/rand" + "crypto/rsa" + "crypto/x509" + "encoding/base64" + "fmt" + "testing" + + "github.com/hashicorp/go-azure-helpers/lang/pointer" + "github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance" + "github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check" + "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" +) + +type ArcResourceBridgeApplianceResource struct{} + +func TestAccArcResourceBridgeAppliance_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_arc_resource_bridge_appliance", "test") + r := ArcResourceBridgeApplianceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccArcResourceBridgeAppliance_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_arc_resource_bridge_appliance", "test") + r := ArcResourceBridgeApplianceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.update(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.basic(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccArcResourceBridgeAppliance_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_arc_resource_bridge_appliance", "test") + r := ArcResourceBridgeApplianceResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data, r.generatePublicKey()), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + }) +} + +func TestAccArcResourceBridgeAppliance_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_arc_resource_bridge_appliance", "test") + r := ArcResourceBridgeApplianceResource{} + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.basic(data), + }, + { + Config: r.requiresImport(data), + ExpectError: acceptance.RequiresImportError("azurerm_arc_resource_bridge_appliance"), + }, + }) +} + +func (r ArcResourceBridgeApplianceResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) { + id, err := appliances.ParseApplianceID(state.ID) + if err != nil { + return nil, err + } + + client := clients.ArcResourceBridge.AppliancesClient + resp, err := client.Get(ctx, *id) + + if err != nil { + return nil, fmt.Errorf("retrieving %q: %+v", *id, err) + } + + return pointer.To(resp.Model != nil), nil +} + +func (r ArcResourceBridgeApplianceResource) basic(data acceptance.TestData) string { + return fmt.Sprintf(` + +%s + +resource "azurerm_arc_resource_bridge_appliance" "test" { + name = "acctestrcapplicance-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + distro = "AKSEdge" + infrastructure_provider = "VMWare" + identity { + type = "SystemAssigned" + } +} +`, r.template(data), data.RandomInteger) +} + +func (r ArcResourceBridgeApplianceResource) update(data acceptance.TestData) string { + return fmt.Sprintf(` + +%s + +resource "azurerm_arc_resource_bridge_appliance" "test" { + name = "acctestrcapplicance-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + distro = "AKSEdge" + infrastructure_provider = "VMWare" + identity { + type = "SystemAssigned" + } + tags = { + "hello" = "world" + } +} +`, r.template(data), data.RandomInteger) +} + +func (r ArcResourceBridgeApplianceResource) complete(data acceptance.TestData, publicKey string) string { + return fmt.Sprintf(` + +%s + +resource "azurerm_arc_resource_bridge_appliance" "test" { + name = "acctestrcapplicance-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + distro = "AKSEdge" + infrastructure_provider = "VMWare" + public_key_base64 = "%[3]s" + identity { + type = "SystemAssigned" + } + tags = { + "hello" = "world" + } +} +`, r.template(data), data.RandomInteger, publicKey) +} + +func (r ArcResourceBridgeApplianceResource) requiresImport(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s +resource "azurerm_arc_resource_bridge_appliance" "import" { + name = azurerm_arc_resource_bridge_appliance.test.name + location = azurerm_arc_resource_bridge_appliance.test.location + resource_group_name = azurerm_arc_resource_bridge_appliance.test.resource_group_name + distro = azurerm_arc_resource_bridge_appliance.test.distro + infrastructure_provider = azurerm_arc_resource_bridge_appliance.test.infrastructure_provider + identity { + type = "SystemAssigned" + } +} +`, r.basic(data), data.RandomInteger) +} + +func (r ArcResourceBridgeApplianceResource) template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestrg-appliances-%[1]d" + location = "%[2]s" +} +`, data.RandomInteger, data.Locations.Primary) +} + +func (r ArcResourceBridgeApplianceResource) generatePublicKey() string { + privateKey, err := rsa.GenerateKey(cryptoRand.Reader, 4096) + if err != nil { + return "" + } + return base64.StdEncoding.EncodeToString(x509.MarshalPKCS1PublicKey(&privateKey.PublicKey)) +} diff --git a/internal/services/arcresourcebridge/client/client.go b/internal/services/arcresourcebridge/client/client.go new file mode 100644 index 000000000000..1da72a063643 --- /dev/null +++ b/internal/services/arcresourcebridge/client/client.go @@ -0,0 +1,24 @@ +package client + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances" + "github.com/hashicorp/terraform-provider-azurerm/internal/common" +) + +type Client struct { + AppliancesClient *appliances.AppliancesClient +} + +func NewClient(o *common.ClientOptions) (*Client, error) { + appliancesClient, err := appliances.NewAppliancesClientWithBaseURI(o.Environment.ResourceManager) + if err != nil { + return nil, fmt.Errorf("building appliances Client: %+v", err) + } + o.Configure(appliancesClient.Client, o.Authorizers.ResourceManager) + + return &Client{ + AppliancesClient: appliancesClient, + }, nil +} diff --git a/internal/services/arcresourcebridge/registration.go b/internal/services/arcresourcebridge/registration.go new file mode 100644 index 000000000000..fef3dfe3f895 --- /dev/null +++ b/internal/services/arcresourcebridge/registration.go @@ -0,0 +1,33 @@ +package arcresourcebridge + +import ( + "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" +) + +var _ sdk.TypedServiceRegistrationWithAGitHubLabel = Registration{} + +type Registration struct{} + +func (r Registration) AssociatedGitHubLabel() string { + return "service/arc-resource-bridge" +} + +func (r Registration) Name() string { + return "Arc Resource Bridge" +} + +func (r Registration) DataSources() []sdk.DataSource { + return []sdk.DataSource{} +} + +func (r Registration) Resources() []sdk.Resource { + return []sdk.Resource{ + ArcResourceBridgeApplianceResource{}, + } +} + +func (r Registration) WebsiteCategories() []string { + return []string{ + "Arc Resource Bridge", + } +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/README.md b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/README.md new file mode 100644 index 000000000000..8d17fd3e3757 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/README.md @@ -0,0 +1,184 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances` Documentation + +The `appliances` SDK allows for interaction with the Azure Resource Manager Service `resourceconnector` (API Version `2022-10-27`). + +This readme covers example usages, but further information on [using this SDK can be found in the project root](https://github.com/hashicorp/go-azure-sdk/tree/main/docs). + +### Import Path + +```go +import "github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances" +``` + + +### Client Initialization + +```go +client := appliances.NewAppliancesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AppliancesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +payload := appliances.Appliance{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AppliancesClient.Delete` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AppliancesClient.Get` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +read, err := client.Get(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AppliancesClient.GetTelemetryConfig` + +```go +ctx := context.TODO() +id := appliances.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.GetTelemetryConfig(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AppliancesClient.GetUpgradeGraph` + +```go +ctx := context.TODO() +id := appliances.NewUpgradeGraphID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue", "upgradeGraphValue") + +read, err := client.GetUpgradeGraph(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AppliancesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := appliances.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AppliancesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := appliances.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AppliancesClient.ListClusterUserCredential` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +read, err := client.ListClusterUserCredential(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AppliancesClient.ListKeys` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +read, err := client.ListKeys(ctx, id, appliances.DefaultListKeysOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `AppliancesClient.Update` + +```go +ctx := context.TODO() +id := appliances.NewApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applianceValue") + +payload := appliances.PatchableAppliance{ + // ... +} + + +read, err := client.Update(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/client.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/client.go new file mode 100644 index 000000000000..c909b4585ece --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/client.go @@ -0,0 +1,26 @@ +package appliances + +import ( + "fmt" + + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AppliancesClient struct { + Client *resourcemanager.Client +} + +func NewAppliancesClientWithBaseURI(sdkApi sdkEnv.Api) (*AppliancesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "appliances", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating AppliancesClient: %+v", err) + } + + return &AppliancesClient{ + Client: client, + }, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/constants.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/constants.go new file mode 100644 index 000000000000..3b8487515b5b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/constants.go @@ -0,0 +1,264 @@ +package appliances + +import ( + "encoding/json" + "fmt" + "strings" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccessProfileType string + +const ( + AccessProfileTypeClusterCustomerUser AccessProfileType = "clusterCustomerUser" + AccessProfileTypeClusterUser AccessProfileType = "clusterUser" +) + +func PossibleValuesForAccessProfileType() []string { + return []string{ + string(AccessProfileTypeClusterCustomerUser), + string(AccessProfileTypeClusterUser), + } +} + +func (s *AccessProfileType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAccessProfileType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAccessProfileType(input string) (*AccessProfileType, error) { + vals := map[string]AccessProfileType{ + "clustercustomeruser": AccessProfileTypeClusterCustomerUser, + "clusteruser": AccessProfileTypeClusterUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AccessProfileType(input) + return &out, nil +} + +type Distro string + +const ( + DistroAKSEdge Distro = "AKSEdge" +) + +func PossibleValuesForDistro() []string { + return []string{ + string(DistroAKSEdge), + } +} + +func (s *Distro) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDistro(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDistro(input string) (*Distro, error) { + vals := map[string]Distro{ + "aksedge": DistroAKSEdge, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Distro(input) + return &out, nil +} + +type Provider string + +const ( + ProviderHCI Provider = "HCI" + ProviderSCVMM Provider = "SCVMM" + ProviderVMWare Provider = "VMWare" +) + +func PossibleValuesForProvider() []string { + return []string{ + string(ProviderHCI), + string(ProviderSCVMM), + string(ProviderVMWare), + } +} + +func (s *Provider) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvider(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvider(input string) (*Provider, error) { + vals := map[string]Provider{ + "hci": ProviderHCI, + "scvmm": ProviderSCVMM, + "vmware": ProviderVMWare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Provider(input) + return &out, nil +} + +type Status string + +const ( + StatusConnected Status = "Connected" + StatusConnecting Status = "Connecting" + StatusETCDSnapshotFailed Status = "ETCDSnapshotFailed" + StatusImageDeprovisioning Status = "ImageDeprovisioning" + StatusImageDownloaded Status = "ImageDownloaded" + StatusImageDownloading Status = "ImageDownloading" + StatusImagePending Status = "ImagePending" + StatusImageProvisioned Status = "ImageProvisioned" + StatusImageProvisioning Status = "ImageProvisioning" + StatusImageUnknown Status = "ImageUnknown" + StatusNone Status = "None" + StatusOffline Status = "Offline" + StatusPostUpgrade Status = "PostUpgrade" + StatusPreUpgrade Status = "PreUpgrade" + StatusPreparingForUpgrade Status = "PreparingForUpgrade" + StatusRunning Status = "Running" + StatusUpdatingCAPI Status = "UpdatingCAPI" + StatusUpdatingCloudOperator Status = "UpdatingCloudOperator" + StatusUpdatingCluster Status = "UpdatingCluster" + StatusUpgradeClusterExtensionFailedToDelete Status = "UpgradeClusterExtensionFailedToDelete" + StatusUpgradeComplete Status = "UpgradeComplete" + StatusUpgradeFailed Status = "UpgradeFailed" + StatusUpgradePrerequisitesCompleted Status = "UpgradePrerequisitesCompleted" + StatusUpgradingKVAIO Status = "UpgradingKVAIO" + StatusValidating Status = "Validating" + StatusValidatingETCDHealth Status = "ValidatingETCDHealth" + StatusValidatingImageDownload Status = "ValidatingImageDownload" + StatusValidatingImageUpload Status = "ValidatingImageUpload" + StatusValidatingSFSConnectivity Status = "ValidatingSFSConnectivity" + StatusWaitingForCloudOperator Status = "WaitingForCloudOperator" + StatusWaitingForHeartbeat Status = "WaitingForHeartbeat" + StatusWaitingForKVAIO Status = "WaitingForKVAIO" +) + +func PossibleValuesForStatus() []string { + return []string{ + string(StatusConnected), + string(StatusConnecting), + string(StatusETCDSnapshotFailed), + string(StatusImageDeprovisioning), + string(StatusImageDownloaded), + string(StatusImageDownloading), + string(StatusImagePending), + string(StatusImageProvisioned), + string(StatusImageProvisioning), + string(StatusImageUnknown), + string(StatusNone), + string(StatusOffline), + string(StatusPostUpgrade), + string(StatusPreUpgrade), + string(StatusPreparingForUpgrade), + string(StatusRunning), + string(StatusUpdatingCAPI), + string(StatusUpdatingCloudOperator), + string(StatusUpdatingCluster), + string(StatusUpgradeClusterExtensionFailedToDelete), + string(StatusUpgradeComplete), + string(StatusUpgradeFailed), + string(StatusUpgradePrerequisitesCompleted), + string(StatusUpgradingKVAIO), + string(StatusValidating), + string(StatusValidatingETCDHealth), + string(StatusValidatingImageDownload), + string(StatusValidatingImageUpload), + string(StatusValidatingSFSConnectivity), + string(StatusWaitingForCloudOperator), + string(StatusWaitingForHeartbeat), + string(StatusWaitingForKVAIO), + } +} + +func (s *Status) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStatus(input string) (*Status, error) { + vals := map[string]Status{ + "connected": StatusConnected, + "connecting": StatusConnecting, + "etcdsnapshotfailed": StatusETCDSnapshotFailed, + "imagedeprovisioning": StatusImageDeprovisioning, + "imagedownloaded": StatusImageDownloaded, + "imagedownloading": StatusImageDownloading, + "imagepending": StatusImagePending, + "imageprovisioned": StatusImageProvisioned, + "imageprovisioning": StatusImageProvisioning, + "imageunknown": StatusImageUnknown, + "none": StatusNone, + "offline": StatusOffline, + "postupgrade": StatusPostUpgrade, + "preupgrade": StatusPreUpgrade, + "preparingforupgrade": StatusPreparingForUpgrade, + "running": StatusRunning, + "updatingcapi": StatusUpdatingCAPI, + "updatingcloudoperator": StatusUpdatingCloudOperator, + "updatingcluster": StatusUpdatingCluster, + "upgradeclusterextensionfailedtodelete": StatusUpgradeClusterExtensionFailedToDelete, + "upgradecomplete": StatusUpgradeComplete, + "upgradefailed": StatusUpgradeFailed, + "upgradeprerequisitescompleted": StatusUpgradePrerequisitesCompleted, + "upgradingkvaio": StatusUpgradingKVAIO, + "validating": StatusValidating, + "validatingetcdhealth": StatusValidatingETCDHealth, + "validatingimagedownload": StatusValidatingImageDownload, + "validatingimageupload": StatusValidatingImageUpload, + "validatingsfsconnectivity": StatusValidatingSFSConnectivity, + "waitingforcloudoperator": StatusWaitingForCloudOperator, + "waitingforheartbeat": StatusWaitingForHeartbeat, + "waitingforkvaio": StatusWaitingForKVAIO, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Status(input) + return &out, nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go new file mode 100644 index 000000000000..c8eb093b3a03 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_appliance.go @@ -0,0 +1,127 @@ +package appliances + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = ApplianceId{} + +// ApplianceId is a struct representing the Resource ID for a Appliance +type ApplianceId struct { + SubscriptionId string + ResourceGroupName string + ApplianceName string +} + +// NewApplianceID returns a new ApplianceId struct +func NewApplianceID(subscriptionId string, resourceGroupName string, applianceName string) ApplianceId { + return ApplianceId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ApplianceName: applianceName, + } +} + +// ParseApplianceID parses 'input' into a ApplianceId +func ParseApplianceID(input string) (*ApplianceId, error) { + parser := resourceids.NewParserFromResourceIdType(ApplianceId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ApplianceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.ApplianceName, ok = parsed.Parsed["applianceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "applianceName", *parsed) + } + + return &id, nil +} + +// ParseApplianceIDInsensitively parses 'input' case-insensitively into a ApplianceId +// note: this method should only be used for API response data and not user input +func ParseApplianceIDInsensitively(input string) (*ApplianceId, error) { + parser := resourceids.NewParserFromResourceIdType(ApplianceId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := ApplianceId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.ApplianceName, ok = parsed.Parsed["applianceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "applianceName", *parsed) + } + + return &id, nil +} + +// ValidateApplianceID checks that 'input' can be parsed as a Appliance ID +func ValidateApplianceID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseApplianceID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Appliance ID +func (id ApplianceId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ResourceConnector/appliances/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplianceName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Appliance ID +func (id ApplianceId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftResourceConnector", "Microsoft.ResourceConnector", "Microsoft.ResourceConnector"), + resourceids.StaticSegment("staticAppliances", "appliances", "appliances"), + resourceids.UserSpecifiedSegment("applianceName", "applianceValue"), + } +} + +// String returns a human-readable description of this Appliance ID +func (id ApplianceId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Appliance Name: %q", id.ApplianceName), + } + return fmt.Sprintf("Appliance (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go new file mode 100644 index 000000000000..02d88d9c97c1 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/id_upgradegraph.go @@ -0,0 +1,140 @@ +package appliances + +import ( + "fmt" + "strings" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/resourceids" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ resourceids.ResourceId = UpgradeGraphId{} + +// UpgradeGraphId is a struct representing the Resource ID for a Upgrade Graph +type UpgradeGraphId struct { + SubscriptionId string + ResourceGroupName string + ApplianceName string + UpgradeGraphName string +} + +// NewUpgradeGraphID returns a new UpgradeGraphId struct +func NewUpgradeGraphID(subscriptionId string, resourceGroupName string, applianceName string, upgradeGraphName string) UpgradeGraphId { + return UpgradeGraphId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ApplianceName: applianceName, + UpgradeGraphName: upgradeGraphName, + } +} + +// ParseUpgradeGraphID parses 'input' into a UpgradeGraphId +func ParseUpgradeGraphID(input string) (*UpgradeGraphId, error) { + parser := resourceids.NewParserFromResourceIdType(UpgradeGraphId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := UpgradeGraphId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.ApplianceName, ok = parsed.Parsed["applianceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "applianceName", *parsed) + } + + if id.UpgradeGraphName, ok = parsed.Parsed["upgradeGraphName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "upgradeGraphName", *parsed) + } + + return &id, nil +} + +// ParseUpgradeGraphIDInsensitively parses 'input' case-insensitively into a UpgradeGraphId +// note: this method should only be used for API response data and not user input +func ParseUpgradeGraphIDInsensitively(input string) (*UpgradeGraphId, error) { + parser := resourceids.NewParserFromResourceIdType(UpgradeGraphId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + var ok bool + id := UpgradeGraphId{} + + if id.SubscriptionId, ok = parsed.Parsed["subscriptionId"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", *parsed) + } + + if id.ResourceGroupName, ok = parsed.Parsed["resourceGroupName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "resourceGroupName", *parsed) + } + + if id.ApplianceName, ok = parsed.Parsed["applianceName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "applianceName", *parsed) + } + + if id.UpgradeGraphName, ok = parsed.Parsed["upgradeGraphName"]; !ok { + return nil, resourceids.NewSegmentNotSpecifiedError(id, "upgradeGraphName", *parsed) + } + + return &id, nil +} + +// ValidateUpgradeGraphID checks that 'input' can be parsed as a Upgrade Graph ID +func ValidateUpgradeGraphID(input interface{}, key string) (warnings []string, errors []error) { + v, ok := input.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected %q to be a string", key)) + return + } + + if _, err := ParseUpgradeGraphID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Upgrade Graph ID +func (id UpgradeGraphId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ResourceConnector/appliances/%s/upgradeGraphs/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplianceName, id.UpgradeGraphName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Upgrade Graph ID +func (id UpgradeGraphId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticSubscriptions", "subscriptions", "subscriptions"), + resourceids.SubscriptionIdSegment("subscriptionId", "12345678-1234-9876-4563-123456789012"), + resourceids.StaticSegment("staticResourceGroups", "resourceGroups", "resourceGroups"), + resourceids.ResourceGroupSegment("resourceGroupName", "example-resource-group"), + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftResourceConnector", "Microsoft.ResourceConnector", "Microsoft.ResourceConnector"), + resourceids.StaticSegment("staticAppliances", "appliances", "appliances"), + resourceids.UserSpecifiedSegment("applianceName", "applianceValue"), + resourceids.StaticSegment("staticUpgradeGraphs", "upgradeGraphs", "upgradeGraphs"), + resourceids.UserSpecifiedSegment("upgradeGraphName", "upgradeGraphValue"), + } +} + +// String returns a human-readable description of this Upgrade Graph ID +func (id UpgradeGraphId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Appliance Name: %q", id.ApplianceName), + fmt.Sprintf("Upgrade Graph Name: %q", id.UpgradeGraphName), + } + return fmt.Sprintf("Upgrade Graph (%s)", strings.Join(components, "\n")) +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_createorupdate.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_createorupdate.go new file mode 100644 index 000000000000..3e65ee2b9d52 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_createorupdate.go @@ -0,0 +1,74 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// CreateOrUpdate ... +func (c AppliancesClient) CreateOrUpdate(ctx context.Context, id ApplianceId, input Appliance) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c AppliancesClient) CreateOrUpdateThenPoll(ctx context.Context, id ApplianceId, input Appliance) error { + result, err := c.CreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_delete.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_delete.go new file mode 100644 index 000000000000..cd9e813db837 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_delete.go @@ -0,0 +1,70 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/client/pollers" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c AppliancesClient) Delete(ctx context.Context, id ApplianceId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c AppliancesClient) DeleteThenPoll(ctx context.Context, id ApplianceId) error { + result, err := c.Delete(ctx, id) + if err != nil { + return fmt.Errorf("performing Delete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Delete: %+v", err) + } + + return nil +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_get.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_get.go new file mode 100644 index 000000000000..72c719318306 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_get.go @@ -0,0 +1,51 @@ +package appliances + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Appliance +} + +// Get ... +func (c AppliancesClient) Get(ctx context.Context, id ApplianceId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_gettelemetryconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_gettelemetryconfig.go new file mode 100644 index 000000000000..b379b7ee1150 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_gettelemetryconfig.go @@ -0,0 +1,53 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetTelemetryConfigOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ApplianceGetTelemetryConfigResult +} + +// GetTelemetryConfig ... +func (c AppliancesClient) GetTelemetryConfig(ctx context.Context, id commonids.SubscriptionId) (result GetTelemetryConfigOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ResourceConnector/telemetryconfig", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_getupgradegraph.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_getupgradegraph.go new file mode 100644 index 000000000000..8d8b3bee629b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_getupgradegraph.go @@ -0,0 +1,51 @@ +package appliances + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetUpgradeGraphOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *UpgradeGraph +} + +// GetUpgradeGraph ... +func (c AppliancesClient) GetUpgradeGraph(ctx context.Context, id UpgradeGraphId) (result GetUpgradeGraphOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbyresourcegroup.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbyresourcegroup.go new file mode 100644 index 000000000000..f60ee84ed5be --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbyresourcegroup.go @@ -0,0 +1,90 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Appliance +} + +type ListByResourceGroupCompleteResult struct { + Items []Appliance +} + +// ListByResourceGroup ... +func (c AppliancesClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ResourceConnector/appliances", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Appliance `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByResourceGroupComplete retrieves all the results into a single object +func (c AppliancesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ApplianceOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AppliancesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ApplianceOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Appliance, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListByResourceGroupCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbysubscription.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbysubscription.go new file mode 100644 index 000000000000..96e13e35442e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listbysubscription.go @@ -0,0 +1,90 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids" + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Appliance +} + +type ListBySubscriptionCompleteResult struct { + Items []Appliance +} + +// ListBySubscription ... +func (c AppliancesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ResourceConnector/appliances", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.ExecutePaged(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + var values struct { + Values *[]Appliance `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListBySubscriptionComplete retrieves all the results into a single object +func (c AppliancesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { + return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, ApplianceOperationPredicate{}) +} + +// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c AppliancesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplianceOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { + items := make([]Appliance, 0) + + resp, err := c.ListBySubscription(ctx, id) + if err != nil { + err = fmt.Errorf("loading results: %+v", err) + return + } + if resp.Model != nil { + for _, v := range *resp.Model { + if predicate.Matches(v) { + items = append(items, v) + } + } + } + + result = ListBySubscriptionCompleteResult{ + Items: items, + } + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listclusterusercredential.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listclusterusercredential.go new file mode 100644 index 000000000000..f78229f12866 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listclusterusercredential.go @@ -0,0 +1,52 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListClusterUserCredentialOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ApplianceListCredentialResults +} + +// ListClusterUserCredential ... +func (c AppliancesClient) ListClusterUserCredential(ctx context.Context, id ApplianceId) (result ListClusterUserCredentialOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listClusterUserCredential", id.ID()), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listkeys.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listkeys.go new file mode 100644 index 000000000000..934aad299db0 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_listkeys.go @@ -0,0 +1,80 @@ +package appliances + +import ( + "context" + "fmt" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListKeysOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ApplianceListKeysResults +} + +type ListKeysOperationOptions struct { + ArtifactType *string +} + +func DefaultListKeysOperationOptions() ListKeysOperationOptions { + return ListKeysOperationOptions{} +} + +func (o ListKeysOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListKeysOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListKeysOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.ArtifactType != nil { + out.Append("artifactType", fmt.Sprintf("%v", *o.ArtifactType)) + } + return &out +} + +// ListKeys ... +func (c AppliancesClient) ListKeys(ctx context.Context, id ApplianceId, options ListKeysOperationOptions) (result ListKeysOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listkeys", id.ID()), + OptionsObject: options, + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_update.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_update.go new file mode 100644 index 000000000000..11f8e1c5d32f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/method_update.go @@ -0,0 +1,55 @@ +package appliances + +import ( + "context" + "net/http" + + "github.com/hashicorp/go-azure-sdk/sdk/client" + "github.com/hashicorp/go-azure-sdk/sdk/odata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Appliance +} + +// Update ... +func (c AppliancesClient) Update(ctx context.Context, id ApplianceId, input PatchableAppliance) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: id.ID(), + } + + req, err := c.Client.NewRequest(ctx, opts) + if err != nil { + return + } + + if err = req.Marshal(input); err != nil { + return + } + + var resp *client.Response + resp, err = req.Execute(ctx) + if resp != nil { + result.OData = resp.OData + result.HttpResponse = resp.Response + } + if err != nil { + return + } + + if err = resp.Unmarshal(&result.Model); err != nil { + return + } + + return +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliance.go new file mode 100644 index 000000000000..3bffef71c23d --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliance.go @@ -0,0 +1,20 @@ +package appliances + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Appliance struct { + Id *string `json:"id,omitempty"` + Identity *identity.SystemAssigned `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ApplianceProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancecredentialkubeconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancecredentialkubeconfig.go new file mode 100644 index 000000000000..ba91ca3f35d6 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancecredentialkubeconfig.go @@ -0,0 +1,9 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceCredentialKubeconfig struct { + Name *AccessProfileType `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancegettelemetryconfigresult.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancegettelemetryconfigresult.go new file mode 100644 index 000000000000..51784d4d3349 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancegettelemetryconfigresult.go @@ -0,0 +1,8 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceGetTelemetryConfigResult struct { + TelemetryInstrumentationKey *string `json:"telemetryInstrumentationKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistcredentialresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistcredentialresults.go new file mode 100644 index 000000000000..925fa8556442 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistcredentialresults.go @@ -0,0 +1,9 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceListCredentialResults struct { + HybridConnectionConfig *HybridConnectionConfig `json:"hybridConnectionConfig,omitempty"` + Kubeconfigs *[]ApplianceCredentialKubeconfig `json:"kubeconfigs,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistkeysresults.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistkeysresults.go new file mode 100644 index 000000000000..be869370361c --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancelistkeysresults.go @@ -0,0 +1,10 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceListKeysResults struct { + ArtifactProfiles *map[string]ArtifactProfile `json:"artifactProfiles,omitempty"` + Kubeconfigs *[]ApplianceCredentialKubeconfig `json:"kubeconfigs,omitempty"` + SshKeys *map[string]SSHKey `json:"sshKeys,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_applianceproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_applianceproperties.go new file mode 100644 index 000000000000..ea46a7b2231b --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_applianceproperties.go @@ -0,0 +1,13 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceProperties struct { + Distro *Distro `json:"distro,omitempty"` + InfrastructureConfig *AppliancePropertiesInfrastructureConfig `json:"infrastructureConfig,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` + Status *Status `json:"status,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancepropertiesinfrastructureconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancepropertiesinfrastructureconfig.go new file mode 100644 index 000000000000..1301b177d046 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_appliancepropertiesinfrastructureconfig.go @@ -0,0 +1,8 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AppliancePropertiesInfrastructureConfig struct { + Provider *Provider `json:"provider,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_artifactprofile.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_artifactprofile.go new file mode 100644 index 000000000000..81f4faa9faeb --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_artifactprofile.go @@ -0,0 +1,8 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ArtifactProfile struct { + Endpoint *string `json:"endpoint,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_hybridconnectionconfig.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_hybridconnectionconfig.go new file mode 100644 index 000000000000..84aaa679766f --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_hybridconnectionconfig.go @@ -0,0 +1,11 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HybridConnectionConfig struct { + ExpirationTime *int64 `json:"expirationTime,omitempty"` + HybridConnectionName *string `json:"hybridConnectionName,omitempty"` + Relay *string `json:"relay,omitempty"` + Token *string `json:"token,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_patchableappliance.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_patchableappliance.go new file mode 100644 index 000000000000..2eed58c90089 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_patchableappliance.go @@ -0,0 +1,8 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PatchableAppliance struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_sshkey.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_sshkey.go new file mode 100644 index 000000000000..682a1195a236 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_sshkey.go @@ -0,0 +1,12 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SSHKey struct { + Certificate *string `json:"certificate,omitempty"` + CreationTimeStamp *int64 `json:"creationTimeStamp,omitempty"` + ExpirationTimeStamp *int64 `json:"expirationTimeStamp,omitempty"` + PrivateKey *string `json:"privateKey,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversion.go new file mode 100644 index 000000000000..1c4599e8f33e --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversion.go @@ -0,0 +1,9 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SupportedVersion struct { + Metadata *SupportedVersionMetadata `json:"metadata,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversion.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversion.go new file mode 100644 index 000000000000..a25fbf59ca00 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversion.go @@ -0,0 +1,10 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SupportedVersionCatalogVersion struct { + Data *SupportedVersionCatalogVersionData `json:"data,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversiondata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversiondata.go new file mode 100644 index 000000000000..53a8fe553b44 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversioncatalogversiondata.go @@ -0,0 +1,11 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SupportedVersionCatalogVersionData struct { + Audience *string `json:"audience,omitempty"` + Catalog *string `json:"catalog,omitempty"` + Offer *string `json:"offer,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversionmetadata.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversionmetadata.go new file mode 100644 index 000000000000..e6aab72141e9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_supportedversionmetadata.go @@ -0,0 +1,8 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SupportedVersionMetadata struct { + CatalogVersion *SupportedVersionCatalogVersion `json:"catalogVersion,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraph.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraph.go new file mode 100644 index 000000000000..aba238b13ca8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraph.go @@ -0,0 +1,10 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpgradeGraph struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *UpgradeGraphProperties `json:"properties,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraphproperties.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraphproperties.go new file mode 100644 index 000000000000..ba33a88bc712 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/model_upgradegraphproperties.go @@ -0,0 +1,9 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpgradeGraphProperties struct { + ApplianceVersion *string `json:"applianceVersion,omitempty"` + SupportedVersions *[]SupportedVersion `json:"supportedVersions,omitempty"` +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/predicates.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/predicates.go new file mode 100644 index 000000000000..748f0086d851 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/predicates.go @@ -0,0 +1,32 @@ +package appliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplianceOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p ApplianceOperationPredicate) Matches(input Appliance) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && *p.Location != input.Location { + return false + } + + if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { + return false + } + + if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { + return false + } + + return true +} diff --git a/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/version.go b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/version.go new file mode 100644 index 000000000000..d8fc28f3da58 --- /dev/null +++ b/vendor/github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances/version.go @@ -0,0 +1,12 @@ +package appliances + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-10-27" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/appliances/%s", defaultApiVersion) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4c2b36ed1a18..688513e8a396 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -802,6 +802,7 @@ github.com/hashicorp/go-azure-sdk/resource-manager/redisenterprise/2022-01-01/da github.com/hashicorp/go-azure-sdk/resource-manager/redisenterprise/2022-01-01/redisenterprise github.com/hashicorp/go-azure-sdk/resource-manager/relay/2021-11-01/hybridconnections github.com/hashicorp/go-azure-sdk/resource-manager/relay/2021-11-01/namespaces +github.com/hashicorp/go-azure-sdk/resource-manager/resourceconnector/2022-10-27/appliances github.com/hashicorp/go-azure-sdk/resource-manager/resources/2020-05-01/managementlocks github.com/hashicorp/go-azure-sdk/resource-manager/resources/2020-10-01/deploymentscripts github.com/hashicorp/go-azure-sdk/resource-manager/resources/2022-06-01/policyassignments diff --git a/website/allowed-subcategories b/website/allowed-subcategories index d0783de08aa6..cb7312f079d1 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -6,6 +6,7 @@ Analysis Services App Configuration App Service (Web Apps) Application Insights +Arc Resource Bridge ArcKubernetes Attestation Authorization diff --git a/website/docs/r/arc_resource_bridge_appliance.html.markdown b/website/docs/r/arc_resource_bridge_appliance.html.markdown new file mode 100644 index 000000000000..fe3c3bee875c --- /dev/null +++ b/website/docs/r/arc_resource_bridge_appliance.html.markdown @@ -0,0 +1,86 @@ +--- +subcategory: "Arc Resource Bridge" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_arc_resource_bridge_appliance" +description: |- + Manages an Arc Resource Bridge Appliance. +--- + +# azurerm_arc_resource_bridge_appliance + +Manages an Arc Resource Bridge Appliance. + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_arc_resource_bridge_appliance" "example" { + name = "example-appliance" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + distro = "AKSEdge" + infrastructure_provider = "VMWare" + + identity { + type = "SystemAssigned" + } + + tags = { + "hello" = "world" + } +} +``` + +## Arguments Reference + +The following arguments are supported: + +* `name` - (Required) The Name which should be used for this Arc Resource Bridge Appliance. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) Specifies the resource group where the Arc Resource Bridge Appliance exists. Changing this forces a new resource to be created. + +* `location` - (Required) The Azure Region where the Arc Resource Bridge Appliance should exist. Changing this forces a new resource to be created. + +* `distro` - (Required) Specifies a supported Fabric/Infrastructure for this Arc Resource Bridge Appliance. The possible value is `AKSEdge`. + +* `identity` - (Required) An `identity` block as defined below. Changing this forces a new resource to be created. + +* `infrastructure_provider`- (Required) The infrastructure provider about the connected Arc Resource Bridge Appliance. Possible values are `HCI`,`SCVMM` and `VMWare`. Changing this forces a new resource to be created. + +* `public_key_base64`- (Optional) The `public_key_base64` is an RSA public key in PKCS1 format encoded in base64. Changing this forces a new resource to be created. + +* `tags` - (Optional) A mapping of tags which should be assigned to the Arc Resource Bridge Appliance. + +--- + +An `identity` block supports the following: + +* `type` - (Required) Specifies the type of Managed Service Identity that should be configured on this Arc Resource Bridge Appliance. The only possible value is `SystemAssigned`. + + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Arc Resource Bridge Appliance. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: + +* `create` - (Defaults to 60 minutes) Used when creating the Arc Resource Bridge Appliance. +* `read` - (Defaults to 5 minutes) Used when retrieving the Arc Resource Bridge Appliance. +* `update` - (Defaults to 30 minutes) Used when updating the Arc Resource Bridge Appliance. +* `delete` - (Defaults to 30 minutes) Used when deleting the Arc Resource Bridge Appliance. + +## Import + +Arc Resource Bridge Appliance can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_arc_resource_bridge_appliance.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ResourceConnector/appliances/appliancesExample +```