package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev

# README

github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans Documentation

The appserviceplans SDK allows for interaction with the Azure Resource Manager Service web (API Version 2023-01-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/web/2023-01-01/appserviceplans"

Client Initialization

client := appserviceplans.NewAppServicePlansClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AppServicePlansClient.CreateOrUpdate

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

payload := appserviceplans.AppServicePlan{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: AppServicePlansClient.CreateOrUpdateVnetRoute

ctx := context.TODO()
id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "routeValue")

payload := appserviceplans.VnetRoute{
	// ...
}


read, err := client.CreateOrUpdateVnetRoute(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.Delete

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.Delete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.DeleteHybridConnection

ctx := context.TODO()
id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "hybridConnectionNamespaceValue", "relayValue")

read, err := client.DeleteHybridConnection(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.DeleteVnetRoute

ctx := context.TODO()
id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "routeValue")

read, err := client.DeleteVnetRoute(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.Get

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

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: AppServicePlansClient.GetHybridConnection

ctx := context.TODO()
id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "hybridConnectionNamespaceValue", "relayValue")

read, err := client.GetHybridConnection(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.GetHybridConnectionPlanLimit

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.GetHybridConnectionPlanLimit(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.GetRouteForVnet

ctx := context.TODO()
id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "routeValue")

read, err := client.GetRouteForVnet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.GetServerFarmSkus

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.GetServerFarmSkus(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.GetVnetFromServerFarm

ctx := context.TODO()
id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue")

read, err := client.GetVnetFromServerFarm(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.GetVnetGateway

ctx := context.TODO()
id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "gatewayValue")

read, err := client.GetVnetGateway(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.List(ctx, id, appserviceplans.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, appserviceplans.DefaultListOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServicePlansClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.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: AppServicePlansClient.ListCapabilities

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.ListCapabilities(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.ListHybridConnectionKeys

ctx := context.TODO()
id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "hybridConnectionNamespaceValue", "relayValue")

read, err := client.ListHybridConnectionKeys(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.ListHybridConnections

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

// alternatively `client.ListHybridConnections(ctx, id)` can be used to do batched pagination
items, err := client.ListHybridConnectionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServicePlansClient.ListRoutesForVnet

ctx := context.TODO()
id := appserviceplans.NewServerFarmVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue")

read, err := client.ListRoutesForVnet(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.ListUsages

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

// alternatively `client.ListUsages(ctx, id, appserviceplans.DefaultListUsagesOperationOptions())` can be used to do batched pagination
items, err := client.ListUsagesComplete(ctx, id, appserviceplans.DefaultListUsagesOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServicePlansClient.ListVnets

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.ListVnets(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.ListWebApps

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

// alternatively `client.ListWebApps(ctx, id, appserviceplans.DefaultListWebAppsOperationOptions())` can be used to do batched pagination
items, err := client.ListWebAppsComplete(ctx, id, appserviceplans.DefaultListWebAppsOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServicePlansClient.ListWebAppsByHybridConnection

ctx := context.TODO()
id := appserviceplans.NewHybridConnectionNamespaceRelayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "hybridConnectionNamespaceValue", "relayValue")

// alternatively `client.ListWebAppsByHybridConnection(ctx, id)` can be used to do batched pagination
items, err := client.ListWebAppsByHybridConnectionComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AppServicePlansClient.RebootWorker

ctx := context.TODO()
id := appserviceplans.NewWorkerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "workerValue")

read, err := client.RebootWorker(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.RestartWebApps

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

read, err := client.RestartWebApps(ctx, id, appserviceplans.DefaultRestartWebAppsOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.Update

ctx := context.TODO()
id := commonids.NewAppServicePlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue")

payload := appserviceplans.AppServicePlanPatchResource{
	// ...
}


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
}

Example Usage: AppServicePlansClient.UpdateVnetGateway

ctx := context.TODO()
id := appserviceplans.NewVirtualNetworkConnectionGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "gatewayValue")

payload := appserviceplans.VnetGateway{
	// ...
}


read, err := client.UpdateVnetGateway(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AppServicePlansClient.UpdateVnetRoute

ctx := context.TODO()
id := appserviceplans.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverFarmValue", "virtualNetworkConnectionValue", "routeValue")

payload := appserviceplans.VnetRoute{
	// ...
}


read, err := client.UpdateVnetRoute(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}