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/containerregistry/2023-07-01/registries Documentation

The registries SDK allows for interaction with the Azure Resource Manager Service containerregistry (API Version 2023-07-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/containerregistry/2023-07-01/registries"

Client Initialization

client := registries.NewRegistriesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: RegistriesClient.Create

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

payload := registries.Registry{
	// ...
}


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

Example Usage: RegistriesClient.Delete

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

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

Example Usage: RegistriesClient.GenerateCredentials

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

payload := registries.GenerateCredentialsParameters{
	// ...
}


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

Example Usage: RegistriesClient.Get

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

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: RegistriesClient.GetPrivateLinkResource

ctx := context.TODO()
id := registries.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue", "privateLinkResourceValue")

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

Example Usage: RegistriesClient.ImportImage

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

payload := registries.ImportImageParameters{
	// ...
}


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

Example Usage: RegistriesClient.List

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

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

Example Usage: RegistriesClient.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: RegistriesClient.ListCredentials

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

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

Example Usage: RegistriesClient.ListPrivateLinkResources

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

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

Example Usage: RegistriesClient.ListUsages

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

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

Example Usage: RegistriesClient.RegenerateCredential

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

payload := registries.RegenerateCredentialParameters{
	// ...
}


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

Example Usage: RegistriesClient.Update

ctx := context.TODO()
id := registries.NewRegistryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "registryValue")

payload := registries.RegistryUpdateParameters{
	// ...
}


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