armcontainerregistry

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 15 Imported by: 19

README

Azure Container Registry Module for Go

PkgGoDev

The armcontainerregistry module provides operations for working with Azure Container Registry.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Container Registry module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Container Registry. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Container Registry module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armcontainerregistry.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armcontainerregistry.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewImportPipelinesClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

More sample code

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Container Registry label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action - The action of IP ACL rule.

const (
	ActionAllow Action = "Allow"
)

func PossibleActionValues

func PossibleActionValues() []Action

PossibleActionValues returns the possible values for the Action const type.

type ActionsRequired

type ActionsRequired string

ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.

const (
	ActionsRequiredNone     ActionsRequired = "None"
	ActionsRequiredRecreate ActionsRequired = "Recreate"
)

func PossibleActionsRequiredValues

func PossibleActionsRequiredValues() []ActionsRequired

PossibleActionsRequiredValues returns the possible values for the ActionsRequired const type.

type Actor

type Actor struct {
	// The subject or username associated with the request context that generated the event.
	Name *string
}

Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request.

func (Actor) MarshalJSON added in v0.7.0

func (a Actor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Actor.

func (*Actor) UnmarshalJSON added in v0.7.0

func (a *Actor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Actor.

type AgentPool

type AgentPool struct {
	// REQUIRED; The location of the resource. This cannot be changed after the resource is created.
	Location *string

	// The properties associated with the agent pool
	Properties *AgentPoolProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

AgentPool - The agentpool that has the ARM resource and properties. The agentpool will have all information to create an agent pool.

func (AgentPool) MarshalJSON

func (a AgentPool) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPool.

func (*AgentPool) UnmarshalJSON added in v0.7.0

func (a *AgentPool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPool.

type AgentPoolListResult

type AgentPoolListResult struct {
	// The URI that can be used to request the next set of paged results.
	NextLink *string

	// The collection value.
	Value []*AgentPool
}

AgentPoolListResult - The collection of agent pools.

func (AgentPoolListResult) MarshalJSON

func (a AgentPoolListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPoolListResult.

func (*AgentPoolListResult) UnmarshalJSON added in v0.7.0

func (a *AgentPoolListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolListResult.

type AgentPoolProperties

type AgentPoolProperties struct {
	// The count of agent machine
	Count *int32

	// The OS of agent machine
	OS *OS

	// The Tier of agent machine
	Tier *string

	// The Virtual Network Subnet Resource Id of the agent machine
	VirtualNetworkSubnetResourceID *string

	// READ-ONLY; The provisioning state of this agent pool
	ProvisioningState *ProvisioningState
}

AgentPoolProperties - The properties of agent pool.

func (AgentPoolProperties) MarshalJSON added in v0.7.0

func (a AgentPoolProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPoolProperties.

func (*AgentPoolProperties) UnmarshalJSON added in v0.7.0

func (a *AgentPoolProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolProperties.

type AgentPoolPropertiesUpdateParameters

type AgentPoolPropertiesUpdateParameters struct {
	// The count of agent machine
	Count *int32
}

func (AgentPoolPropertiesUpdateParameters) MarshalJSON added in v0.7.0

func (a AgentPoolPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPoolPropertiesUpdateParameters.

func (*AgentPoolPropertiesUpdateParameters) UnmarshalJSON added in v0.7.0

func (a *AgentPoolPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolPropertiesUpdateParameters.

type AgentPoolQueueStatus

type AgentPoolQueueStatus struct {
	// The number of pending runs in the queue
	Count *int32
}

AgentPoolQueueStatus - The QueueStatus of Agent Pool

func (AgentPoolQueueStatus) MarshalJSON added in v0.7.0

func (a AgentPoolQueueStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPoolQueueStatus.

func (*AgentPoolQueueStatus) UnmarshalJSON added in v0.7.0

func (a *AgentPoolQueueStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolQueueStatus.

type AgentPoolUpdateParameters

type AgentPoolUpdateParameters struct {
	// The properties associated with the agent pool
	Properties *AgentPoolPropertiesUpdateParameters

	// The ARM resource tags.
	Tags map[string]*string
}

AgentPoolUpdateParameters - The parameters for updating an agent pool.

func (AgentPoolUpdateParameters) MarshalJSON

func (a AgentPoolUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentPoolUpdateParameters.

func (*AgentPoolUpdateParameters) UnmarshalJSON added in v0.7.0

func (a *AgentPoolUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentPoolUpdateParameters.

type AgentPoolsClient

type AgentPoolsClient struct {
	// contains filtered or unexported fields
}

AgentPoolsClient contains the methods for the AgentPools group. Don't use this type directly, use NewAgentPoolsClient() instead.

func NewAgentPoolsClient

func NewAgentPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentPoolsClient, error)

NewAgentPoolsClient creates a new instance of AgentPoolsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*AgentPoolsClient) BeginCreate

func (client *AgentPoolsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool, options *AgentPoolsClientBeginCreateOptions) (*runtime.Poller[AgentPoolsClientCreateResponse], error)

BeginCreate - Creates an agent pool for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • agentPoolName - The name of the agent pool.
  • agentPool - The parameters of an agent pool that needs to scheduled.
  • options - AgentPoolsClientBeginCreateOptions contains the optional parameters for the AgentPoolsClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAgentPoolsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myAgentPool", armcontainerregistry.AgentPool{
		Location: to.Ptr("WESTUS"),
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
		Properties: &armcontainerregistry.AgentPoolProperties{
			Count: to.Ptr[int32](1),
			OS:    to.Ptr(armcontainerregistry.OSLinux),
			Tier:  to.Ptr("S1"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AgentPool = armcontainerregistry.AgentPool{
	// 	Name: to.Ptr("myAgentPool"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"),
	// 	ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"),
	// 	Location: to.Ptr("WESTUS"),
	// 	Properties: &armcontainerregistry.AgentPoolProperties{
	// 		Count: to.Ptr[int32](1),
	// 		OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Tier: to.Ptr("S1"),
	// 	},
	// }
}
Output:

func (*AgentPoolsClient) BeginDelete

func (client *AgentPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientBeginDeleteOptions) (*runtime.Poller[AgentPoolsClientDeleteResponse], error)

BeginDelete - Deletes a specified agent pool resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • agentPoolName - The name of the agent pool.
  • options - AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAgentPoolsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myAgentPool", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*AgentPoolsClient) BeginUpdate

func (client *AgentPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters, options *AgentPoolsClientBeginUpdateOptions) (*runtime.Poller[AgentPoolsClientUpdateResponse], error)

BeginUpdate - Updates an agent pool with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • agentPoolName - The name of the agent pool.
  • updateParameters - The parameters for updating an agent pool.
  • options - AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAgentPoolsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myAgentPool", armcontainerregistry.AgentPoolUpdateParameters{
		Properties: &armcontainerregistry.AgentPoolPropertiesUpdateParameters{
			Count: to.Ptr[int32](1),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AgentPool = armcontainerregistry.AgentPool{
	// 	Name: to.Ptr("myAgentPool"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"),
	// 	ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"),
	// 	Location: to.Ptr("WESTUS"),
	// 	Properties: &armcontainerregistry.AgentPoolProperties{
	// 		Count: to.Ptr[int32](1),
	// 		OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Tier: to.Ptr("S1"),
	// 	},
	// }
}
Output:

func (*AgentPoolsClient) Get

func (client *AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientGetOptions) (AgentPoolsClientGetResponse, error)

Get - Gets the detailed information for a given agent pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • agentPoolName - The name of the agent pool.
  • options - AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAgentPoolsClient().Get(ctx, "myResourceGroup", "myRegistry", "myAgentPool", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AgentPool = armcontainerregistry.AgentPool{
	// 	Name: to.Ptr("myAgentPool"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"),
	// 	ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"),
	// 	Location: to.Ptr("WESTUS"),
	// 	Properties: &armcontainerregistry.AgentPoolProperties{
	// 		Count: to.Ptr[int32](1),
	// 		OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Tier: to.Ptr("S1"),
	// 	},
	// }
}
Output:

func (*AgentPoolsClient) GetQueueStatus

func (client *AgentPoolsClient) GetQueueStatus(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, options *AgentPoolsClientGetQueueStatusOptions) (AgentPoolsClientGetQueueStatusResponse, error)

GetQueueStatus - Gets the count of queued runs for a given agent pool. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • agentPoolName - The name of the agent pool.
  • options - AgentPoolsClientGetQueueStatusOptions contains the optional parameters for the AgentPoolsClient.GetQueueStatus method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsGetQueueStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAgentPoolsClient().GetQueueStatus(ctx, "myResourceGroup", "myRegistry", "myAgentPool", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.AgentPoolQueueStatus = armcontainerregistry.AgentPoolQueueStatus{
	// 	Count: to.Ptr[int32](10),
	// }
}
Output:

func (*AgentPoolsClient) NewListPager added in v0.5.0

func (client *AgentPoolsClient) NewListPager(resourceGroupName string, registryName string, options *AgentPoolsClientListOptions) *runtime.Pager[AgentPoolsClientListResponse]

NewListPager - Lists all the agent pools for a specified container registry.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • options - AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/AgentPoolsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAgentPoolsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.AgentPoolListResult = armcontainerregistry.AgentPoolListResult{
		// 	Value: []*armcontainerregistry.AgentPool{
		// 		{
		// 			Name: to.Ptr("myAgentPool"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/agentPools"),
		// 			ID: to.Ptr("/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourceGroups/huanwudfwestgroup/providers/Microsoft.ContainerRegistry/registries/huanglidfwest01/agentPools/testagent26"),
		// 			Location: to.Ptr("WESTUS"),
		// 			Properties: &armcontainerregistry.AgentPoolProperties{
		// 				Count: to.Ptr[int32](1),
		// 				OS: to.Ptr(armcontainerregistry.OSLinux),
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				Tier: to.Ptr("S1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type AgentPoolsClientBeginCreateOptions added in v0.3.0

type AgentPoolsClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

AgentPoolsClientBeginCreateOptions contains the optional parameters for the AgentPoolsClient.BeginCreate method.

type AgentPoolsClientBeginDeleteOptions added in v0.3.0

type AgentPoolsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

AgentPoolsClientBeginDeleteOptions contains the optional parameters for the AgentPoolsClient.BeginDelete method.

type AgentPoolsClientBeginUpdateOptions added in v0.3.0

type AgentPoolsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

AgentPoolsClientBeginUpdateOptions contains the optional parameters for the AgentPoolsClient.BeginUpdate method.

type AgentPoolsClientCreateResponse added in v0.3.0

type AgentPoolsClientCreateResponse struct {
	// The agentpool that has the ARM resource and properties.
	// The agentpool will have all information to create an agent pool.
	AgentPool
}

AgentPoolsClientCreateResponse contains the response from method AgentPoolsClient.BeginCreate.

type AgentPoolsClientDeleteResponse added in v0.3.0

type AgentPoolsClientDeleteResponse struct {
}

AgentPoolsClientDeleteResponse contains the response from method AgentPoolsClient.BeginDelete.

type AgentPoolsClientGetOptions added in v0.3.0

type AgentPoolsClientGetOptions struct {
}

AgentPoolsClientGetOptions contains the optional parameters for the AgentPoolsClient.Get method.

type AgentPoolsClientGetQueueStatusOptions added in v0.3.0

type AgentPoolsClientGetQueueStatusOptions struct {
}

AgentPoolsClientGetQueueStatusOptions contains the optional parameters for the AgentPoolsClient.GetQueueStatus method.

type AgentPoolsClientGetQueueStatusResponse added in v0.3.0

type AgentPoolsClientGetQueueStatusResponse struct {
	// The QueueStatus of Agent Pool
	AgentPoolQueueStatus
}

AgentPoolsClientGetQueueStatusResponse contains the response from method AgentPoolsClient.GetQueueStatus.

type AgentPoolsClientGetResponse added in v0.3.0

type AgentPoolsClientGetResponse struct {
	// The agentpool that has the ARM resource and properties.
	// The agentpool will have all information to create an agent pool.
	AgentPool
}

AgentPoolsClientGetResponse contains the response from method AgentPoolsClient.Get.

type AgentPoolsClientListOptions added in v0.3.0

type AgentPoolsClientListOptions struct {
}

AgentPoolsClientListOptions contains the optional parameters for the AgentPoolsClient.NewListPager method.

type AgentPoolsClientListResponse added in v0.3.0

type AgentPoolsClientListResponse struct {
	// The collection of agent pools.
	AgentPoolListResult
}

AgentPoolsClientListResponse contains the response from method AgentPoolsClient.NewListPager.

type AgentPoolsClientUpdateResponse added in v0.3.0

type AgentPoolsClientUpdateResponse struct {
	// The agentpool that has the ARM resource and properties.
	// The agentpool will have all information to create an agent pool.
	AgentPool
}

AgentPoolsClientUpdateResponse contains the response from method AgentPoolsClient.BeginUpdate.

type AgentProperties

type AgentProperties struct {
	// The CPU configuration in terms of number of cores required for the run.
	CPU *int32
}

AgentProperties - The properties that determine the run agent configuration.

func (AgentProperties) MarshalJSON added in v0.7.0

func (a AgentProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AgentProperties.

func (*AgentProperties) UnmarshalJSON added in v0.7.0

func (a *AgentProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AgentProperties.

type Architecture

type Architecture string

Architecture - The OS architecture.

const (
	ArchitectureAmd64                 Architecture = "amd64"
	ArchitectureArm                   Architecture = "arm"
	ArchitectureArm64                 Architecture = "arm64"
	ArchitectureThreeHundredEightySix Architecture = "386"
	ArchitectureX86                   Architecture = "x86"
)

func PossibleArchitectureValues

func PossibleArchitectureValues() []Architecture

PossibleArchitectureValues returns the possible values for the Architecture const type.

type Argument

type Argument struct {
	// REQUIRED; The name of the argument.
	Name *string

	// REQUIRED; The value of the argument.
	Value *string

	// Flag to indicate whether the argument represents a secret and want to be removed from build logs.
	IsSecret *bool
}

Argument - The properties of a run argument.

func (Argument) MarshalJSON added in v0.7.0

func (a Argument) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Argument.

func (*Argument) UnmarshalJSON added in v0.7.0

func (a *Argument) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Argument.

type AuthCredential added in v0.7.0

type AuthCredential struct {
	// The name of the credential.
	Name *CredentialName

	// KeyVault Secret URI for accessing the password.
	PasswordSecretIdentifier *string

	// KeyVault Secret URI for accessing the username.
	UsernameSecretIdentifier *string

	// READ-ONLY; This provides data pertaining to the health of the auth credential.
	CredentialHealth *CredentialHealth
}

AuthCredential - Authentication credential stored for an upstream.

func (AuthCredential) MarshalJSON added in v0.7.0

func (a AuthCredential) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AuthCredential.

func (*AuthCredential) UnmarshalJSON added in v0.7.0

func (a *AuthCredential) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AuthCredential.

type AuthInfo

type AuthInfo struct {
	// REQUIRED; The access token used to access the source control provider.
	Token *string

	// REQUIRED; The type of Auth token.
	TokenType *TokenType

	// Time in seconds that the token remains valid
	ExpiresIn *int32

	// The refresh token used to refresh the access token.
	RefreshToken *string

	// The scope of the access token.
	Scope *string
}

AuthInfo - The authorization properties for accessing the source code repository.

func (AuthInfo) MarshalJSON added in v0.7.0

func (a AuthInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AuthInfo.

func (*AuthInfo) UnmarshalJSON added in v0.7.0

func (a *AuthInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfo.

type AuthInfoUpdateParameters

type AuthInfoUpdateParameters struct {
	// Time in seconds that the token remains valid
	ExpiresIn *int32

	// The refresh token used to refresh the access token.
	RefreshToken *string

	// The scope of the access token.
	Scope *string

	// The access token used to access the source control provider.
	Token *string

	// The type of Auth token.
	TokenType *TokenType
}

AuthInfoUpdateParameters - The authorization properties for accessing the source code repository.

func (AuthInfoUpdateParameters) MarshalJSON added in v0.7.0

func (a AuthInfoUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AuthInfoUpdateParameters.

func (*AuthInfoUpdateParameters) UnmarshalJSON added in v0.7.0

func (a *AuthInfoUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfoUpdateParameters.

type BaseImageDependency

type BaseImageDependency struct {
	// The sha256-based digest of the image manifest.
	Digest *string

	// The registry login server.
	Registry *string

	// The repository name.
	Repository *string

	// The tag name.
	Tag *string

	// The type of the base image dependency.
	Type *BaseImageDependencyType
}

BaseImageDependency - Properties that describe a base image dependency.

func (BaseImageDependency) MarshalJSON added in v0.7.0

func (b BaseImageDependency) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BaseImageDependency.

func (*BaseImageDependency) UnmarshalJSON added in v0.7.0

func (b *BaseImageDependency) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageDependency.

type BaseImageDependencyType

type BaseImageDependencyType string

BaseImageDependencyType - The type of the base image dependency.

const (
	BaseImageDependencyTypeBuildTime BaseImageDependencyType = "BuildTime"
	BaseImageDependencyTypeRunTime   BaseImageDependencyType = "RunTime"
)

func PossibleBaseImageDependencyTypeValues

func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType

PossibleBaseImageDependencyTypeValues returns the possible values for the BaseImageDependencyType const type.

type BaseImageTrigger

type BaseImageTrigger struct {
	// REQUIRED; The type of the auto trigger for base image dependency updates.
	BaseImageTriggerType *BaseImageTriggerType

	// REQUIRED; The name of the trigger.
	Name *string

	// The current status of trigger.
	Status *TriggerStatus

	// The endpoint URL for receiving update triggers.
	UpdateTriggerEndpoint *string

	// Type of Payload body for Base image update triggers.
	UpdateTriggerPayloadType *UpdateTriggerPayloadType
}

BaseImageTrigger - The trigger based on base image dependency.

func (BaseImageTrigger) MarshalJSON added in v0.7.0

func (b BaseImageTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BaseImageTrigger.

func (*BaseImageTrigger) UnmarshalJSON added in v0.7.0

func (b *BaseImageTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTrigger.

type BaseImageTriggerType

type BaseImageTriggerType string

BaseImageTriggerType - The type of the auto trigger for base image dependency updates.

const (
	BaseImageTriggerTypeAll     BaseImageTriggerType = "All"
	BaseImageTriggerTypeRuntime BaseImageTriggerType = "Runtime"
)

func PossibleBaseImageTriggerTypeValues

func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType

PossibleBaseImageTriggerTypeValues returns the possible values for the BaseImageTriggerType const type.

type BaseImageTriggerUpdateParameters

type BaseImageTriggerUpdateParameters struct {
	// REQUIRED; The name of the trigger.
	Name *string

	// The type of the auto trigger for base image dependency updates.
	BaseImageTriggerType *BaseImageTriggerType

	// The current status of trigger.
	Status *TriggerStatus

	// The endpoint URL for receiving update triggers.
	UpdateTriggerEndpoint *string

	// Type of Payload body for Base image update triggers.
	UpdateTriggerPayloadType *UpdateTriggerPayloadType
}

BaseImageTriggerUpdateParameters - The properties for updating base image dependency trigger.

func (BaseImageTriggerUpdateParameters) MarshalJSON added in v0.7.0

func (b BaseImageTriggerUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type BaseImageTriggerUpdateParameters.

func (*BaseImageTriggerUpdateParameters) UnmarshalJSON added in v0.7.0

func (b *BaseImageTriggerUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type BaseImageTriggerUpdateParameters.

type CacheRule added in v0.7.0

type CacheRule struct {
	// The properties of the cache rule.
	Properties *CacheRuleProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

CacheRule - An object that represents a cache rule for a container registry.

func (CacheRule) MarshalJSON added in v0.7.0

func (c CacheRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CacheRule.

func (*CacheRule) UnmarshalJSON added in v0.7.0

func (c *CacheRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CacheRule.

type CacheRuleProperties added in v0.7.0

type CacheRuleProperties struct {
	// The ARM resource ID of the credential store which is associated with the cache rule.
	CredentialSetResourceID *string

	// Source repository pulled from upstream.
	SourceRepository *string

	// Target repository specified in docker pull command. Eg: docker pull myregistry.azurecr.io/{targetRepository}:{tag}
	TargetRepository *string

	// READ-ONLY; The creation date of the cache rule.
	CreationDate *time.Time

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

CacheRuleProperties - The properties of a cache rule.

func (CacheRuleProperties) MarshalJSON added in v0.7.0

func (c CacheRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CacheRuleProperties.

func (*CacheRuleProperties) UnmarshalJSON added in v0.7.0

func (c *CacheRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleProperties.

type CacheRuleUpdateParameters added in v0.7.0

type CacheRuleUpdateParameters struct {
	// The properties of the cache rule update parameters.
	Properties *CacheRuleUpdateProperties
}

CacheRuleUpdateParameters - The parameters for updating a cache rule.

func (CacheRuleUpdateParameters) MarshalJSON added in v0.7.0

func (c CacheRuleUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateParameters.

func (*CacheRuleUpdateParameters) UnmarshalJSON added in v0.7.0

func (c *CacheRuleUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateParameters.

type CacheRuleUpdateProperties added in v0.7.0

type CacheRuleUpdateProperties struct {
	// The ARM resource ID of the credential store which is associated with the Cache rule.
	CredentialSetResourceID *string
}

CacheRuleUpdateProperties - The parameters for updating cache rule properties.

func (CacheRuleUpdateProperties) MarshalJSON added in v0.7.0

func (c CacheRuleUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CacheRuleUpdateProperties.

func (*CacheRuleUpdateProperties) UnmarshalJSON added in v0.7.0

func (c *CacheRuleUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CacheRuleUpdateProperties.

type CacheRulesClient added in v0.7.0

type CacheRulesClient struct {
	// contains filtered or unexported fields
}

CacheRulesClient contains the methods for the CacheRules group. Don't use this type directly, use NewCacheRulesClient() instead.

func NewCacheRulesClient added in v0.7.0

func NewCacheRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CacheRulesClient, error)

NewCacheRulesClient creates a new instance of CacheRulesClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CacheRulesClient) BeginCreate added in v0.7.0

func (client *CacheRulesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, cacheRuleCreateParameters CacheRule, options *CacheRulesClientBeginCreateOptions) (*runtime.Poller[CacheRulesClientCreateResponse], error)

BeginCreate - Creates a cache rule for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • cacheRuleName - The name of the cache rule.
  • cacheRuleCreateParameters - The parameters for creating a cache rule.
  • options - CacheRulesClientBeginCreateOptions contains the optional parameters for the CacheRulesClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCacheRulesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRule{
		Properties: &armcontainerregistry.CacheRuleProperties{
			CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
			SourceRepository:        to.Ptr("docker.io/library/hello-world"),
			TargetRepository:        to.Ptr("cached-docker-hub/hello-world"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CacheRule = armcontainerregistry.CacheRule{
	// 	Name: to.Ptr("myCacheRule"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"),
	// 	Properties: &armcontainerregistry.CacheRuleProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()),
	// 		CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		SourceRepository: to.Ptr("docker.io/library/hello-world"),
	// 		TargetRepository: to.Ptr("cached-docker-hub/hello-world"),
	// 	},
	// }
}
Output:

func (*CacheRulesClient) BeginDelete added in v0.7.0

func (client *CacheRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, options *CacheRulesClientBeginDeleteOptions) (*runtime.Poller[CacheRulesClientDeleteResponse], error)

BeginDelete - Deletes a cache rule resource from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • cacheRuleName - The name of the cache rule.
  • options - CacheRulesClientBeginDeleteOptions contains the optional parameters for the CacheRulesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCacheRulesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*CacheRulesClient) BeginUpdate added in v0.7.0

func (client *CacheRulesClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, cacheRuleUpdateParameters CacheRuleUpdateParameters, options *CacheRulesClientBeginUpdateOptions) (*runtime.Poller[CacheRulesClientUpdateResponse], error)

BeginUpdate - Updates a cache rule for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • cacheRuleName - The name of the cache rule.
  • cacheRuleUpdateParameters - The parameters for updating a cache rule.
  • options - CacheRulesClientBeginUpdateOptions contains the optional parameters for the CacheRulesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCacheRulesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myCacheRule", armcontainerregistry.CacheRuleUpdateParameters{
		Properties: &armcontainerregistry.CacheRuleUpdateProperties{
			CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CacheRule = armcontainerregistry.CacheRule{
	// 	Name: to.Ptr("myCacheRule"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"),
	// 	Properties: &armcontainerregistry.CacheRuleProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()),
	// 		CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet2"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		SourceRepository: to.Ptr("docker.io/library/hello-world"),
	// 		TargetRepository: to.Ptr("cached-docker-hub/hello-world"),
	// 	},
	// }
}
Output:

func (*CacheRulesClient) Get added in v0.7.0

func (client *CacheRulesClient) Get(ctx context.Context, resourceGroupName string, registryName string, cacheRuleName string, options *CacheRulesClientGetOptions) (CacheRulesClientGetResponse, error)

Get - Gets the properties of the specified cache rule resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • cacheRuleName - The name of the cache rule.
  • options - CacheRulesClientGetOptions contains the optional parameters for the CacheRulesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCacheRulesClient().Get(ctx, "myResourceGroup", "myRegistry", "myCacheRule", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CacheRule = armcontainerregistry.CacheRule{
	// 	Name: to.Ptr("myCacheRule"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"),
	// 	Properties: &armcontainerregistry.CacheRuleProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()),
	// 		CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		SourceRepository: to.Ptr("docker.io/library/hello-world"),
	// 		TargetRepository: to.Ptr("cached-docker-hub/hello-world"),
	// 	},
	// }
}
Output:

func (*CacheRulesClient) NewListPager added in v0.7.0

func (client *CacheRulesClient) NewListPager(resourceGroupName string, registryName string, options *CacheRulesClientListOptions) *runtime.Pager[CacheRulesClientListResponse]

NewListPager - Lists all cache rule resources for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - CacheRulesClientListOptions contains the optional parameters for the CacheRulesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CacheRuleList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCacheRulesClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.CacheRulesListResult = armcontainerregistry.CacheRulesListResult{
		// 	Value: []*armcontainerregistry.CacheRule{
		// 		{
		// 			Name: to.Ptr("myCacheRule"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/cacheRules"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/cacheRules/myCacheRule"),
		// 			Properties: &armcontainerregistry.CacheRuleProperties{
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:33.837Z"); return t}()),
		// 				CredentialSetResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				SourceRepository: to.Ptr("docker.io/library/hello-world"),
		// 				TargetRepository: to.Ptr("cached-docker-hub/hello-world"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type CacheRulesClientBeginCreateOptions added in v0.7.0

type CacheRulesClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CacheRulesClientBeginCreateOptions contains the optional parameters for the CacheRulesClient.BeginCreate method.

type CacheRulesClientBeginDeleteOptions added in v0.7.0

type CacheRulesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CacheRulesClientBeginDeleteOptions contains the optional parameters for the CacheRulesClient.BeginDelete method.

type CacheRulesClientBeginUpdateOptions added in v0.7.0

type CacheRulesClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CacheRulesClientBeginUpdateOptions contains the optional parameters for the CacheRulesClient.BeginUpdate method.

type CacheRulesClientCreateResponse added in v0.7.0

type CacheRulesClientCreateResponse struct {
	// An object that represents a cache rule for a container registry.
	CacheRule
}

CacheRulesClientCreateResponse contains the response from method CacheRulesClient.BeginCreate.

type CacheRulesClientDeleteResponse added in v0.7.0

type CacheRulesClientDeleteResponse struct {
}

CacheRulesClientDeleteResponse contains the response from method CacheRulesClient.BeginDelete.

type CacheRulesClientGetOptions added in v0.7.0

type CacheRulesClientGetOptions struct {
}

CacheRulesClientGetOptions contains the optional parameters for the CacheRulesClient.Get method.

type CacheRulesClientGetResponse added in v0.7.0

type CacheRulesClientGetResponse struct {
	// An object that represents a cache rule for a container registry.
	CacheRule
}

CacheRulesClientGetResponse contains the response from method CacheRulesClient.Get.

type CacheRulesClientListOptions added in v0.7.0

type CacheRulesClientListOptions struct {
}

CacheRulesClientListOptions contains the optional parameters for the CacheRulesClient.NewListPager method.

type CacheRulesClientListResponse added in v0.7.0

type CacheRulesClientListResponse struct {
	// The result of a request to list cache rules for a container registry.
	CacheRulesListResult
}

CacheRulesClientListResponse contains the response from method CacheRulesClient.NewListPager.

type CacheRulesClientUpdateResponse added in v0.7.0

type CacheRulesClientUpdateResponse struct {
	// An object that represents a cache rule for a container registry.
	CacheRule
}

CacheRulesClientUpdateResponse contains the response from method CacheRulesClient.BeginUpdate.

type CacheRulesListResult added in v0.7.0

type CacheRulesListResult struct {
	// If provided, client must use NextLink URI to request next list of cache rules.
	NextLink *string

	// The list of cache rules.
	Value []*CacheRule
}

CacheRulesListResult - The result of a request to list cache rules for a container registry.

func (CacheRulesListResult) MarshalJSON added in v0.7.0

func (c CacheRulesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CacheRulesListResult.

func (*CacheRulesListResult) UnmarshalJSON added in v0.7.0

func (c *CacheRulesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CacheRulesListResult.

type CallbackConfig

type CallbackConfig struct {
	// REQUIRED; The service URI for the webhook to post notifications.
	ServiceURI *string

	// Custom headers that will be added to the webhook notifications.
	CustomHeaders map[string]*string
}

CallbackConfig - The configuration of service URI and custom headers for the webhook.

func (CallbackConfig) MarshalJSON

func (c CallbackConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CallbackConfig.

func (*CallbackConfig) UnmarshalJSON added in v0.7.0

func (c *CallbackConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CallbackConfig.

type ClientFactory added in v1.0.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory added in v1.0.0

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAgentPoolsClient added in v1.0.0

func (c *ClientFactory) NewAgentPoolsClient() *AgentPoolsClient

NewAgentPoolsClient creates a new instance of AgentPoolsClient.

func (*ClientFactory) NewCacheRulesClient added in v1.1.0

func (c *ClientFactory) NewCacheRulesClient() *CacheRulesClient

NewCacheRulesClient creates a new instance of CacheRulesClient.

func (*ClientFactory) NewCredentialSetsClient added in v1.1.0

func (c *ClientFactory) NewCredentialSetsClient() *CredentialSetsClient

NewCredentialSetsClient creates a new instance of CredentialSetsClient.

func (*ClientFactory) NewOperationsClient added in v1.0.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient added in v1.0.0

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewRegistriesClient added in v1.0.0

func (c *ClientFactory) NewRegistriesClient() *RegistriesClient

NewRegistriesClient creates a new instance of RegistriesClient.

func (*ClientFactory) NewReplicationsClient added in v1.0.0

func (c *ClientFactory) NewReplicationsClient() *ReplicationsClient

NewReplicationsClient creates a new instance of ReplicationsClient.

func (*ClientFactory) NewRunsClient added in v1.0.0

func (c *ClientFactory) NewRunsClient() *RunsClient

NewRunsClient creates a new instance of RunsClient.

func (*ClientFactory) NewScopeMapsClient added in v1.0.0

func (c *ClientFactory) NewScopeMapsClient() *ScopeMapsClient

NewScopeMapsClient creates a new instance of ScopeMapsClient.

func (*ClientFactory) NewTaskRunsClient added in v1.0.0

func (c *ClientFactory) NewTaskRunsClient() *TaskRunsClient

NewTaskRunsClient creates a new instance of TaskRunsClient.

func (*ClientFactory) NewTasksClient added in v1.0.0

func (c *ClientFactory) NewTasksClient() *TasksClient

NewTasksClient creates a new instance of TasksClient.

func (*ClientFactory) NewTokensClient added in v1.0.0

func (c *ClientFactory) NewTokensClient() *TokensClient

NewTokensClient creates a new instance of TokensClient.

func (*ClientFactory) NewWebhooksClient added in v1.0.0

func (c *ClientFactory) NewWebhooksClient() *WebhooksClient

NewWebhooksClient creates a new instance of WebhooksClient.

type ConnectionStatus

type ConnectionStatus string

ConnectionStatus - The private link service connection status.

const (
	ConnectionStatusApproved     ConnectionStatus = "Approved"
	ConnectionStatusDisconnected ConnectionStatus = "Disconnected"
	ConnectionStatusPending      ConnectionStatus = "Pending"
	ConnectionStatusRejected     ConnectionStatus = "Rejected"
)

func PossibleConnectionStatusValues

func PossibleConnectionStatusValues() []ConnectionStatus

PossibleConnectionStatusValues returns the possible values for the ConnectionStatus const type.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type CredentialHealth added in v0.7.0

type CredentialHealth struct {
	// Error code representing the health check error.
	ErrorCode *string

	// Descriptive message representing the health check error.
	ErrorMessage *string

	// The health status of credential.
	Status *CredentialHealthStatus
}

CredentialHealth - The health of the auth credential.

func (CredentialHealth) MarshalJSON added in v0.7.0

func (c CredentialHealth) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialHealth.

func (*CredentialHealth) UnmarshalJSON added in v0.7.0

func (c *CredentialHealth) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialHealth.

type CredentialHealthStatus added in v0.7.0

type CredentialHealthStatus string

CredentialHealthStatus - The health status of credential.

const (
	CredentialHealthStatusHealthy   CredentialHealthStatus = "Healthy"
	CredentialHealthStatusUnhealthy CredentialHealthStatus = "Unhealthy"
)

func PossibleCredentialHealthStatusValues added in v0.7.0

func PossibleCredentialHealthStatusValues() []CredentialHealthStatus

PossibleCredentialHealthStatusValues returns the possible values for the CredentialHealthStatus const type.

type CredentialName added in v0.7.0

type CredentialName string

CredentialName - The name of the credential.

const (
	CredentialNameCredential1 CredentialName = "Credential1"
)

func PossibleCredentialNameValues added in v0.7.0

func PossibleCredentialNameValues() []CredentialName

PossibleCredentialNameValues returns the possible values for the CredentialName const type.

type CredentialSet added in v0.7.0

type CredentialSet struct {
	// Identities associated with the resource. This is used to access the KeyVault secrets.
	Identity *IdentityProperties

	// The properties of the credential set.
	Properties *CredentialSetProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

CredentialSet - An object that represents a credential set resource for a container registry.

func (CredentialSet) MarshalJSON added in v0.7.0

func (c CredentialSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialSet.

func (*CredentialSet) UnmarshalJSON added in v0.7.0

func (c *CredentialSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSet.

type CredentialSetListResult added in v0.7.0

type CredentialSetListResult struct {
	// The URI that can be used to request the next list of credential sets.
	NextLink *string

	// The list of credential sets. Since this list may be incomplete, the nextLink field should be used to request the next list
	// of credential sets.
	Value []*CredentialSet
}

CredentialSetListResult - The result of a request to list credential sets for a container registry.

func (CredentialSetListResult) MarshalJSON added in v0.7.0

func (c CredentialSetListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialSetListResult.

func (*CredentialSetListResult) UnmarshalJSON added in v0.7.0

func (c *CredentialSetListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetListResult.

type CredentialSetProperties added in v0.7.0

type CredentialSetProperties struct {
	// List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential.
	AuthCredentials []*AuthCredential

	// The credentials are stored for this upstream or login server.
	LoginServer *string

	// READ-ONLY; The creation date of credential store resource.
	CreationDate *time.Time

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

CredentialSetProperties - The properties of a credential set resource.

func (CredentialSetProperties) MarshalJSON added in v0.7.0

func (c CredentialSetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialSetProperties.

func (*CredentialSetProperties) UnmarshalJSON added in v0.7.0

func (c *CredentialSetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetProperties.

type CredentialSetUpdateParameters added in v0.7.0

type CredentialSetUpdateParameters struct {
	// Identities associated with the resource. This is used to access the KeyVault secrets.
	Identity *IdentityProperties

	// The properties of the credential set update parameters
	Properties *CredentialSetUpdateProperties
}

CredentialSetUpdateParameters - The parameters for updating a credential set

func (CredentialSetUpdateParameters) MarshalJSON added in v0.7.0

func (c CredentialSetUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateParameters.

func (*CredentialSetUpdateParameters) UnmarshalJSON added in v0.7.0

func (c *CredentialSetUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateParameters.

type CredentialSetUpdateProperties added in v0.7.0

type CredentialSetUpdateProperties struct {
	// List of authentication credentials stored for an upstream. Usually consists of a primary and an optional secondary credential.
	AuthCredentials []*AuthCredential
}

CredentialSetUpdateProperties - The parameters for updating credential set properties.

func (CredentialSetUpdateProperties) MarshalJSON added in v0.7.0

func (c CredentialSetUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialSetUpdateProperties.

func (*CredentialSetUpdateProperties) UnmarshalJSON added in v0.7.0

func (c *CredentialSetUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialSetUpdateProperties.

type CredentialSetsClient added in v0.7.0

type CredentialSetsClient struct {
	// contains filtered or unexported fields
}

CredentialSetsClient contains the methods for the CredentialSets group. Don't use this type directly, use NewCredentialSetsClient() instead.

func NewCredentialSetsClient added in v0.7.0

func NewCredentialSetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CredentialSetsClient, error)

NewCredentialSetsClient creates a new instance of CredentialSetsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*CredentialSetsClient) BeginCreate added in v0.7.0

func (client *CredentialSetsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, credentialSetCreateParameters CredentialSet, options *CredentialSetsClientBeginCreateOptions) (*runtime.Poller[CredentialSetsClientCreateResponse], error)

BeginCreate - Creates a credential set for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • credentialSetName - The name of the credential set.
  • credentialSetCreateParameters - The parameters for creating a credential set.
  • options - CredentialSetsClientBeginCreateOptions contains the optional parameters for the CredentialSetsClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCredentialSetsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSet{
		Identity: &armcontainerregistry.IdentityProperties{
			Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
		},
		Properties: &armcontainerregistry.CredentialSetProperties{
			AuthCredentials: []*armcontainerregistry.AuthCredential{
				{
					Name:                     to.Ptr(armcontainerregistry.CredentialNameCredential1),
					PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"),
					UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"),
				}},
			LoginServer: to.Ptr("docker.io"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CredentialSet = armcontainerregistry.CredentialSet{
	// 	Name: to.Ptr("myCredentialSet"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// 	Properties: &armcontainerregistry.CredentialSetProperties{
	// 		AuthCredentials: []*armcontainerregistry.AuthCredential{
	// 			{
	// 				Name: to.Ptr(armcontainerregistry.CredentialNameCredential1),
	// 				CredentialHealth: &armcontainerregistry.CredentialHealth{
	// 					Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy),
	// 				},
	// 				PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"),
	// 				UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"),
	// 		}},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()),
	// 		LoginServer: to.Ptr("docker.io"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*CredentialSetsClient) BeginDelete added in v0.7.0

func (client *CredentialSetsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, options *CredentialSetsClientBeginDeleteOptions) (*runtime.Poller[CredentialSetsClientDeleteResponse], error)

BeginDelete - Deletes a credential set from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • credentialSetName - The name of the credential set.
  • options - CredentialSetsClientBeginDeleteOptions contains the optional parameters for the CredentialSetsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCredentialSetsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*CredentialSetsClient) BeginUpdate added in v0.7.0

func (client *CredentialSetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, credentialSetUpdateParameters CredentialSetUpdateParameters, options *CredentialSetsClientBeginUpdateOptions) (*runtime.Poller[CredentialSetsClientUpdateResponse], error)

BeginUpdate - Updates a credential set for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • credentialSetName - The name of the credential set.
  • credentialSetUpdateParameters - The parameters for updating a credential set.
  • options - CredentialSetsClientBeginUpdateOptions contains the optional parameters for the CredentialSetsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewCredentialSetsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", armcontainerregistry.CredentialSetUpdateParameters{
		Properties: &armcontainerregistry.CredentialSetUpdateProperties{
			AuthCredentials: []*armcontainerregistry.AuthCredential{
				{
					Name:                     to.Ptr(armcontainerregistry.CredentialNameCredential1),
					PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"),
					UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"),
				}},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CredentialSet = armcontainerregistry.CredentialSet{
	// 	Name: to.Ptr("myCredentialSet"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// 	Properties: &armcontainerregistry.CredentialSetProperties{
	// 		AuthCredentials: []*armcontainerregistry.AuthCredential{
	// 			{
	// 				Name: to.Ptr(armcontainerregistry.CredentialNameCredential1),
	// 				CredentialHealth: &armcontainerregistry.CredentialHealth{
	// 					Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy),
	// 				},
	// 				PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password2"),
	// 				UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username2"),
	// 		}},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()),
	// 		LoginServer: to.Ptr("docker.io"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*CredentialSetsClient) Get added in v0.7.0

func (client *CredentialSetsClient) Get(ctx context.Context, resourceGroupName string, registryName string, credentialSetName string, options *CredentialSetsClientGetOptions) (CredentialSetsClientGetResponse, error)

Get - Gets the properties of the specified credential set resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • credentialSetName - The name of the credential set.
  • options - CredentialSetsClientGetOptions contains the optional parameters for the CredentialSetsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewCredentialSetsClient().Get(ctx, "myResourceGroup", "myRegistry", "myCredentialSet", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CredentialSet = armcontainerregistry.CredentialSet{
	// 	Name: to.Ptr("myCredentialSet"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 		TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// 	},
	// 	Properties: &armcontainerregistry.CredentialSetProperties{
	// 		AuthCredentials: []*armcontainerregistry.AuthCredential{
	// 			{
	// 				Name: to.Ptr(armcontainerregistry.CredentialNameCredential1),
	// 				CredentialHealth: &armcontainerregistry.CredentialHealth{
	// 					Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy),
	// 				},
	// 				PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"),
	// 				UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"),
	// 		}},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()),
	// 		LoginServer: to.Ptr("docker.io"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*CredentialSetsClient) NewListPager added in v0.7.0

func (client *CredentialSetsClient) NewListPager(resourceGroupName string, registryName string, options *CredentialSetsClientListOptions) *runtime.Pager[CredentialSetsClientListResponse]

NewListPager - Lists all credential set resources for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - CredentialSetsClientListOptions contains the optional parameters for the CredentialSetsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/CredentialSetList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewCredentialSetsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.CredentialSetListResult = armcontainerregistry.CredentialSetListResult{
		// 	Value: []*armcontainerregistry.CredentialSet{
		// 		{
		// 			Name: to.Ptr("myCredentialSet"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/credentialSets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/credentialSets/myCredentialSet"),
		// 			Identity: &armcontainerregistry.IdentityProperties{
		// 				Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 				TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			},
		// 			Properties: &armcontainerregistry.CredentialSetProperties{
		// 				AuthCredentials: []*armcontainerregistry.AuthCredential{
		// 					{
		// 						Name: to.Ptr(armcontainerregistry.CredentialNameCredential1),
		// 						CredentialHealth: &armcontainerregistry.CredentialHealth{
		// 							Status: to.Ptr(armcontainerregistry.CredentialHealthStatusHealthy),
		// 						},
		// 						PasswordSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/password"),
		// 						UsernameSecretIdentifier: to.Ptr("https://myvault.vault.azure.net/secrets/username"),
		// 				}},
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-07T18:20:08.012Z"); return t}()),
		// 				LoginServer: to.Ptr("docker.io"),
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type CredentialSetsClientBeginCreateOptions added in v0.7.0

type CredentialSetsClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CredentialSetsClientBeginCreateOptions contains the optional parameters for the CredentialSetsClient.BeginCreate method.

type CredentialSetsClientBeginDeleteOptions added in v0.7.0

type CredentialSetsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CredentialSetsClientBeginDeleteOptions contains the optional parameters for the CredentialSetsClient.BeginDelete method.

type CredentialSetsClientBeginUpdateOptions added in v0.7.0

type CredentialSetsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

CredentialSetsClientBeginUpdateOptions contains the optional parameters for the CredentialSetsClient.BeginUpdate method.

type CredentialSetsClientCreateResponse added in v0.7.0

type CredentialSetsClientCreateResponse struct {
	// An object that represents a credential set resource for a container registry.
	CredentialSet
}

CredentialSetsClientCreateResponse contains the response from method CredentialSetsClient.BeginCreate.

type CredentialSetsClientDeleteResponse added in v0.7.0

type CredentialSetsClientDeleteResponse struct {
}

CredentialSetsClientDeleteResponse contains the response from method CredentialSetsClient.BeginDelete.

type CredentialSetsClientGetOptions added in v0.7.0

type CredentialSetsClientGetOptions struct {
}

CredentialSetsClientGetOptions contains the optional parameters for the CredentialSetsClient.Get method.

type CredentialSetsClientGetResponse added in v0.7.0

type CredentialSetsClientGetResponse struct {
	// An object that represents a credential set resource for a container registry.
	CredentialSet
}

CredentialSetsClientGetResponse contains the response from method CredentialSetsClient.Get.

type CredentialSetsClientListOptions added in v0.7.0

type CredentialSetsClientListOptions struct {
}

CredentialSetsClientListOptions contains the optional parameters for the CredentialSetsClient.NewListPager method.

type CredentialSetsClientListResponse added in v0.7.0

type CredentialSetsClientListResponse struct {
	// The result of a request to list credential sets for a container registry.
	CredentialSetListResult
}

CredentialSetsClientListResponse contains the response from method CredentialSetsClient.NewListPager.

type CredentialSetsClientUpdateResponse added in v0.7.0

type CredentialSetsClientUpdateResponse struct {
	// An object that represents a credential set resource for a container registry.
	CredentialSet
}

CredentialSetsClientUpdateResponse contains the response from method CredentialSetsClient.BeginUpdate.

type Credentials

type Credentials struct {
	// Describes the credential parameters for accessing other custom registries. The key for the dictionary item will be the
	// registry login server (myregistry.azurecr.io) and the value of the item will be
	// the registry credentials for accessing the registry.
	CustomRegistries map[string]*CustomRegistryCredentials

	// Describes the credential parameters for accessing the source registry.
	SourceRegistry *SourceRegistryCredentials
}

Credentials - The parameters that describes a set of credentials that will be used when a run is invoked.

func (Credentials) MarshalJSON

func (c Credentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Credentials.

func (*Credentials) UnmarshalJSON added in v0.7.0

func (c *Credentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Credentials.

type CustomRegistryCredentials

type CustomRegistryCredentials struct {
	// Indicates the managed identity assigned to the custom credential. If a user-assigned identity this value is the Client
	// ID. If a system-assigned identity, the value will be system. In the case of a
	// system-assigned identity, the Client ID will be determined by the runner. This identity may be used to authenticate to
	// key vault to retrieve credentials or it may be the only source of authentication
	// used for accessing the registry.
	Identity *string

	// The password for logging into the custom registry. The password is a secret object that allows multiple ways of providing
	// the value for it.
	Password *SecretObject

	// The username for logging into the custom registry.
	UserName *SecretObject
}

CustomRegistryCredentials - Describes the credentials that will be used to access a custom registry during a run.

func (CustomRegistryCredentials) MarshalJSON added in v0.7.0

func (c CustomRegistryCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CustomRegistryCredentials.

func (*CustomRegistryCredentials) UnmarshalJSON added in v0.7.0

func (c *CustomRegistryCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CustomRegistryCredentials.

type DefaultAction

type DefaultAction string

DefaultAction - The default action of allow or deny when no other rules match.

const (
	DefaultActionAllow DefaultAction = "Allow"
	DefaultActionDeny  DefaultAction = "Deny"
)

func PossibleDefaultActionValues

func PossibleDefaultActionValues() []DefaultAction

PossibleDefaultActionValues returns the possible values for the DefaultAction const type.

type DockerBuildRequest

type DockerBuildRequest struct {
	// REQUIRED; The Docker file path relative to the source location.
	DockerFilePath *string

	// REQUIRED; The platform properties against which the run has to happen.
	Platform *PlatformProperties

	// REQUIRED; The type of the run request.
	Type *string

	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The collection of override arguments to be used when executing the run.
	Arguments []*Argument

	// The properties that describes a set of credentials that will be used when this run is invoked.
	Credentials *Credentials

	// The fully qualified image names including the repository and tag.
	ImageNames []*string

	// The value that indicates whether archiving is enabled for the run or not.
	IsArchiveEnabled *bool

	// The value of this property indicates whether the image built should be pushed to the registry or not.
	IsPushEnabled *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// The value of this property indicates whether the image cache is enabled or not.
	NoCache *bool

	// The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL,
	// the relative path should be obtained from calling listBuildSourceUploadUrl API.
	SourceLocation *string

	// The name of the target build stage for the docker build.
	Target *string

	// Run timeout in seconds.
	Timeout *int32
}

DockerBuildRequest - The parameters for a docker quick build.

func (*DockerBuildRequest) GetRunRequest added in v0.3.0

func (d *DockerBuildRequest) GetRunRequest() *RunRequest

GetRunRequest implements the RunRequestClassification interface for type DockerBuildRequest.

func (DockerBuildRequest) MarshalJSON

func (d DockerBuildRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DockerBuildRequest.

func (*DockerBuildRequest) UnmarshalJSON

func (d *DockerBuildRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildRequest.

type DockerBuildStep

type DockerBuildStep struct {
	// REQUIRED; The Docker file path relative to the source context.
	DockerFilePath *string

	// REQUIRED; The type of the step.
	Type *StepType

	// The collection of override arguments to be used when executing this build step.
	Arguments []*Argument

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// The fully qualified image names including the repository and tag.
	ImageNames []*string

	// The value of this property indicates whether the image built should be pushed to the registry or not.
	IsPushEnabled *bool

	// The value of this property indicates whether the image cache is enabled or not.
	NoCache *bool

	// The name of the target build stage for the docker build.
	Target *string

	// READ-ONLY; List of base image dependencies for a step.
	BaseImageDependencies []*BaseImageDependency
}

DockerBuildStep - The Docker build step.

func (*DockerBuildStep) GetTaskStepProperties added in v0.3.0

func (d *DockerBuildStep) GetTaskStepProperties() *TaskStepProperties

GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type DockerBuildStep.

func (DockerBuildStep) MarshalJSON

func (d DockerBuildStep) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DockerBuildStep.

func (*DockerBuildStep) UnmarshalJSON

func (d *DockerBuildStep) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStep.

type DockerBuildStepUpdateParameters

type DockerBuildStepUpdateParameters struct {
	// REQUIRED; The type of the step.
	Type *StepType

	// The collection of override arguments to be used when executing this build step.
	Arguments []*Argument

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// The Docker file path relative to the source context.
	DockerFilePath *string

	// The fully qualified image names including the repository and tag.
	ImageNames []*string

	// The value of this property indicates whether the image built should be pushed to the registry or not.
	IsPushEnabled *bool

	// The value of this property indicates whether the image cache is enabled or not.
	NoCache *bool

	// The name of the target build stage for the docker build.
	Target *string
}

DockerBuildStepUpdateParameters - The properties for updating a docker build step.

func (*DockerBuildStepUpdateParameters) GetTaskStepUpdateParameters added in v0.3.0

func (d *DockerBuildStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters

GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type DockerBuildStepUpdateParameters.

func (DockerBuildStepUpdateParameters) MarshalJSON

func (d DockerBuildStepUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DockerBuildStepUpdateParameters.

func (*DockerBuildStepUpdateParameters) UnmarshalJSON

func (d *DockerBuildStepUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DockerBuildStepUpdateParameters.

type EncodedTaskRunRequest

type EncodedTaskRunRequest struct {
	// REQUIRED; Base64 encoded value of the template/definition file content.
	EncodedTaskContent *string

	// REQUIRED; The platform properties against which the run has to happen.
	Platform *PlatformProperties

	// REQUIRED; The type of the run request.
	Type *string

	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The properties that describes a set of credentials that will be used when this run is invoked.
	Credentials *Credentials

	// Base64 encoded value of the parameters/values file content.
	EncodedValuesContent *string

	// The value that indicates whether archiving is enabled for the run or not.
	IsArchiveEnabled *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL,
	// the relative path should be obtained from calling listBuildSourceUploadUrl API.
	SourceLocation *string

	// Run timeout in seconds.
	Timeout *int32

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue
}

EncodedTaskRunRequest - The parameters for a quick task run request.

func (*EncodedTaskRunRequest) GetRunRequest added in v0.3.0

func (e *EncodedTaskRunRequest) GetRunRequest() *RunRequest

GetRunRequest implements the RunRequestClassification interface for type EncodedTaskRunRequest.

func (EncodedTaskRunRequest) MarshalJSON

func (e EncodedTaskRunRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncodedTaskRunRequest.

func (*EncodedTaskRunRequest) UnmarshalJSON

func (e *EncodedTaskRunRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskRunRequest.

type EncodedTaskStep

type EncodedTaskStep struct {
	// REQUIRED; Base64 encoded value of the template/definition file content.
	EncodedTaskContent *string

	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// Base64 encoded value of the parameters/values file content.
	EncodedValuesContent *string

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue

	// READ-ONLY; List of base image dependencies for a step.
	BaseImageDependencies []*BaseImageDependency
}

EncodedTaskStep - The properties of a encoded task step.

func (*EncodedTaskStep) GetTaskStepProperties added in v0.3.0

func (e *EncodedTaskStep) GetTaskStepProperties() *TaskStepProperties

GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type EncodedTaskStep.

func (EncodedTaskStep) MarshalJSON

func (e EncodedTaskStep) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncodedTaskStep.

func (*EncodedTaskStep) UnmarshalJSON

func (e *EncodedTaskStep) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStep.

type EncodedTaskStepUpdateParameters

type EncodedTaskStepUpdateParameters struct {
	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// Base64 encoded value of the template/definition file content.
	EncodedTaskContent *string

	// Base64 encoded value of the parameters/values file content.
	EncodedValuesContent *string

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue
}

EncodedTaskStepUpdateParameters - The properties for updating encoded task step.

func (*EncodedTaskStepUpdateParameters) GetTaskStepUpdateParameters added in v0.3.0

func (e *EncodedTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters

GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type EncodedTaskStepUpdateParameters.

func (EncodedTaskStepUpdateParameters) MarshalJSON

func (e EncodedTaskStepUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncodedTaskStepUpdateParameters.

func (*EncodedTaskStepUpdateParameters) UnmarshalJSON

func (e *EncodedTaskStepUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncodedTaskStepUpdateParameters.

type EncryptionProperty

type EncryptionProperty struct {
	// Key vault properties.
	KeyVaultProperties *KeyVaultProperties

	// Indicates whether or not the encryption is enabled for container registry.
	Status *EncryptionStatus
}

func (EncryptionProperty) MarshalJSON added in v0.7.0

func (e EncryptionProperty) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncryptionProperty.

func (*EncryptionProperty) UnmarshalJSON added in v0.7.0

func (e *EncryptionProperty) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProperty.

type EncryptionStatus

type EncryptionStatus string

EncryptionStatus - Indicates whether or not the encryption is enabled for container registry.

const (
	EncryptionStatusDisabled EncryptionStatus = "disabled"
	EncryptionStatusEnabled  EncryptionStatus = "enabled"
)

func PossibleEncryptionStatusValues

func PossibleEncryptionStatusValues() []EncryptionStatus

PossibleEncryptionStatusValues returns the possible values for the EncryptionStatus const type.

type Event

type Event struct {
	// The event request message sent to the service URI.
	EventRequestMessage *EventRequestMessage

	// The event response message received from the service URI.
	EventResponseMessage *EventResponseMessage

	// The event ID.
	ID *string
}

Event - The event for a webhook.

func (Event) MarshalJSON added in v0.7.0

func (e Event) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Event.

func (*Event) UnmarshalJSON added in v0.7.0

func (e *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Event.

type EventContent

type EventContent struct {
	// The action that encompasses the provided event.
	Action *string

	// The agent that initiated the event. For most situations, this could be from the authorization context of the request.
	Actor *Actor

	// The event ID.
	ID *string

	// The request that generated the event.
	Request *Request

	// The registry node that generated the event. Put differently, while the actor initiates the event, the source generates
	// it.
	Source *Source

	// The target of the event.
	Target *Target

	// The time at which the event occurred.
	Timestamp *time.Time
}

EventContent - The content of the event request message.

func (EventContent) MarshalJSON

func (e EventContent) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EventContent.

func (*EventContent) UnmarshalJSON

func (e *EventContent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EventContent.

type EventInfo

type EventInfo struct {
	// The event ID.
	ID *string
}

EventInfo - The basic information of an event.

func (EventInfo) MarshalJSON added in v0.7.0

func (e EventInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EventInfo.

func (*EventInfo) UnmarshalJSON added in v0.7.0

func (e *EventInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EventInfo.

type EventListResult

type EventListResult struct {
	// The URI that can be used to request the next list of events.
	NextLink *string

	// The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events.
	Value []*Event
}

EventListResult - The result of a request to list events for a webhook.

func (EventListResult) MarshalJSON

func (e EventListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EventListResult.

func (*EventListResult) UnmarshalJSON added in v0.7.0

func (e *EventListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EventListResult.

type EventRequestMessage

type EventRequestMessage struct {
	// The content of the event request message.
	Content *EventContent

	// The headers of the event request message.
	Headers map[string]*string

	// The HTTP method used to send the event request message.
	Method *string

	// The URI used to send the event request message.
	RequestURI *string

	// The HTTP message version.
	Version *string
}

EventRequestMessage - The event request message sent to the service URI.

func (EventRequestMessage) MarshalJSON

func (e EventRequestMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EventRequestMessage.

func (*EventRequestMessage) UnmarshalJSON added in v0.7.0

func (e *EventRequestMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EventRequestMessage.

type EventResponseMessage

type EventResponseMessage struct {
	// The content of the event response message.
	Content *string

	// The headers of the event response message.
	Headers map[string]*string

	// The reason phrase of the event response message.
	ReasonPhrase *string

	// The status code of the event response message.
	StatusCode *string

	// The HTTP message version.
	Version *string
}

EventResponseMessage - The event response message received from the service URI.

func (EventResponseMessage) MarshalJSON

func (e EventResponseMessage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EventResponseMessage.

func (*EventResponseMessage) UnmarshalJSON added in v0.7.0

func (e *EventResponseMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EventResponseMessage.

type ExportPolicy

type ExportPolicy struct {
	// The value that indicates whether the policy is enabled or not.
	Status *ExportPolicyStatus
}

ExportPolicy - The export policy for a container registry.

func (ExportPolicy) MarshalJSON added in v0.7.0

func (e ExportPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ExportPolicy.

func (*ExportPolicy) UnmarshalJSON added in v0.7.0

func (e *ExportPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ExportPolicy.

type ExportPolicyStatus

type ExportPolicyStatus string

ExportPolicyStatus - The value that indicates whether the policy is enabled or not.

const (
	ExportPolicyStatusDisabled ExportPolicyStatus = "disabled"
	ExportPolicyStatusEnabled  ExportPolicyStatus = "enabled"
)

func PossibleExportPolicyStatusValues

func PossibleExportPolicyStatusValues() []ExportPolicyStatus

PossibleExportPolicyStatusValues returns the possible values for the ExportPolicyStatus const type.

type FileTaskRunRequest

type FileTaskRunRequest struct {
	// REQUIRED; The platform properties against which the run has to happen.
	Platform *PlatformProperties

	// REQUIRED; The template/definition file path relative to the source.
	TaskFilePath *string

	// REQUIRED; The type of the run request.
	Type *string

	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The properties that describes a set of credentials that will be used when this run is invoked.
	Credentials *Credentials

	// The value that indicates whether archiving is enabled for the run or not.
	IsArchiveEnabled *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. If it is relative URL,
	// the relative path should be obtained from calling listBuildSourceUploadUrl API.
	SourceLocation *string

	// Run timeout in seconds.
	Timeout *int32

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue

	// The values/parameters file path relative to the source.
	ValuesFilePath *string
}

FileTaskRunRequest - The request parameters for a scheduling run against a task file.

func (*FileTaskRunRequest) GetRunRequest added in v0.3.0

func (f *FileTaskRunRequest) GetRunRequest() *RunRequest

GetRunRequest implements the RunRequestClassification interface for type FileTaskRunRequest.

func (FileTaskRunRequest) MarshalJSON

func (f FileTaskRunRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FileTaskRunRequest.

func (*FileTaskRunRequest) UnmarshalJSON

func (f *FileTaskRunRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskRunRequest.

type FileTaskStep

type FileTaskStep struct {
	// REQUIRED; The task template/definition file path relative to the source context.
	TaskFilePath *string

	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue

	// The task values/parameters file path relative to the source context.
	ValuesFilePath *string

	// READ-ONLY; List of base image dependencies for a step.
	BaseImageDependencies []*BaseImageDependency
}

FileTaskStep - The properties of a task step.

func (*FileTaskStep) GetTaskStepProperties added in v0.3.0

func (f *FileTaskStep) GetTaskStepProperties() *TaskStepProperties

GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type FileTaskStep.

func (FileTaskStep) MarshalJSON

func (f FileTaskStep) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FileTaskStep.

func (*FileTaskStep) UnmarshalJSON

func (f *FileTaskStep) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStep.

type FileTaskStepUpdateParameters

type FileTaskStepUpdateParameters struct {
	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// The task template/definition file path relative to the source context.
	TaskFilePath *string

	// The collection of overridable values that can be passed when running a task.
	Values []*SetValue

	// The values/parameters file path relative to the source context.
	ValuesFilePath *string
}

FileTaskStepUpdateParameters - The properties of updating a task step.

func (*FileTaskStepUpdateParameters) GetTaskStepUpdateParameters added in v0.3.0

func (f *FileTaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters

GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type FileTaskStepUpdateParameters.

func (FileTaskStepUpdateParameters) MarshalJSON

func (f FileTaskStepUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type FileTaskStepUpdateParameters.

func (*FileTaskStepUpdateParameters) UnmarshalJSON

func (f *FileTaskStepUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type FileTaskStepUpdateParameters.

type GenerateCredentialsParameters

type GenerateCredentialsParameters struct {
	// The expiry date of the generated credentials after which the credentials become invalid.
	Expiry *time.Time

	// Specifies name of the password which should be regenerated if any -- password1 or password2.
	Name *TokenPasswordName

	// The resource ID of the token for which credentials have to be generated.
	TokenID *string
}

GenerateCredentialsParameters - The parameters used to generate credentials for a specified token or user of a container registry.

func (GenerateCredentialsParameters) MarshalJSON

func (g GenerateCredentialsParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsParameters.

func (*GenerateCredentialsParameters) UnmarshalJSON

func (g *GenerateCredentialsParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsParameters.

type GenerateCredentialsResult

type GenerateCredentialsResult struct {
	// The list of passwords for a container registry.
	Passwords []*TokenPassword

	// The username for a container registry.
	Username *string
}

GenerateCredentialsResult - The response from the GenerateCredentials operation.

func (GenerateCredentialsResult) MarshalJSON

func (g GenerateCredentialsResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type GenerateCredentialsResult.

func (*GenerateCredentialsResult) UnmarshalJSON added in v0.7.0

func (g *GenerateCredentialsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type GenerateCredentialsResult.

type IPRule

type IPRule struct {
	// REQUIRED; Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.
	IPAddressOrRange *string

	// The action of IP ACL rule.
	Action *Action
}

IPRule - IP rule with specific IP or IP range in CIDR format.

func (IPRule) MarshalJSON added in v0.7.0

func (i IPRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IPRule.

func (*IPRule) UnmarshalJSON added in v0.7.0

func (i *IPRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.

type IdentityProperties

type IdentityProperties struct {
	// The identity type.
	Type *ResourceIdentityType

	// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource
	// ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]*UserIdentityProperties

	// READ-ONLY; The principal ID of resource identity.
	PrincipalID *string

	// READ-ONLY; The tenant ID of resource.
	TenantID *string
}

IdentityProperties - Managed identity for the resource.

func (IdentityProperties) MarshalJSON

func (i IdentityProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IdentityProperties.

func (*IdentityProperties) UnmarshalJSON added in v0.7.0

func (i *IdentityProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProperties.

type ImageDescriptor

type ImageDescriptor struct {
	// The sha256-based digest of the image manifest.
	Digest *string

	// The registry login server.
	Registry *string

	// The repository name.
	Repository *string

	// The tag name.
	Tag *string
}

ImageDescriptor - Properties for a registry image.

func (ImageDescriptor) MarshalJSON added in v0.7.0

func (i ImageDescriptor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageDescriptor.

func (*ImageDescriptor) UnmarshalJSON added in v0.7.0

func (i *ImageDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageDescriptor.

type ImageUpdateTrigger

type ImageUpdateTrigger struct {
	// The unique ID of the trigger.
	ID *string

	// The list of image updates that caused the build.
	Images []*ImageDescriptor

	// The timestamp when the image update happened.
	Timestamp *time.Time
}

ImageUpdateTrigger - The image update trigger that caused a build.

func (ImageUpdateTrigger) MarshalJSON

func (i ImageUpdateTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImageUpdateTrigger.

func (*ImageUpdateTrigger) UnmarshalJSON

func (i *ImageUpdateTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImageUpdateTrigger.

type ImportImageParameters

type ImportImageParameters struct {
	// REQUIRED; The source of the image.
	Source *ImportSource

	// When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation
	// before any copying begins.
	Mode *ImportMode

	// List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also
	// omitted).
	TargetTags []*string

	// List of strings of repository names to do a manifest only copy. No tag will be created.
	UntaggedTargetRepositories []*string
}

func (ImportImageParameters) MarshalJSON

func (i ImportImageParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImportImageParameters.

func (*ImportImageParameters) UnmarshalJSON added in v0.7.0

func (i *ImportImageParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImportImageParameters.

type ImportMode

type ImportMode string

ImportMode - When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins.

const (
	ImportModeForce   ImportMode = "Force"
	ImportModeNoForce ImportMode = "NoForce"
)

func PossibleImportModeValues

func PossibleImportModeValues() []ImportMode

PossibleImportModeValues returns the possible values for the ImportMode const type.

type ImportSource

type ImportSource struct {
	// REQUIRED; Repository name of the source image. Specify an image by repository ('hello-world'). This will use the 'latest'
	// tag. Specify an image by tag ('hello-world:latest'). Specify an image by sha256-based
	// manifest digest ('hello-world@sha256:abc123').
	SourceImage *string

	// Credentials used when importing from a registry uri.
	Credentials *ImportSourceCredentials

	// The address of the source registry (e.g. 'mcr.microsoft.com').
	RegistryURI *string

	// The resource identifier of the source Azure Container Registry.
	ResourceID *string
}

func (ImportSource) MarshalJSON added in v0.7.0

func (i ImportSource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImportSource.

func (*ImportSource) UnmarshalJSON added in v0.7.0

func (i *ImportSource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImportSource.

type ImportSourceCredentials

type ImportSourceCredentials struct {
	// REQUIRED; The password used to authenticate with the source registry.
	Password *string

	// The username to authenticate with the source registry.
	Username *string
}

func (ImportSourceCredentials) MarshalJSON added in v0.7.0

func (i ImportSourceCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ImportSourceCredentials.

func (*ImportSourceCredentials) UnmarshalJSON added in v0.7.0

func (i *ImportSourceCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ImportSourceCredentials.

type KeyVaultProperties

type KeyVaultProperties struct {
	// The client id of the identity which will be used to access key vault.
	Identity *string

	// Key vault uri to access the encryption key.
	KeyIdentifier *string

	// READ-ONLY; Auto key rotation status for a CMK enabled registry.
	KeyRotationEnabled *bool

	// READ-ONLY; Timestamp of the last successful key rotation.
	LastKeyRotationTimestamp *time.Time

	// READ-ONLY; The fully qualified key identifier that includes the version of the key that is actually used for encryption.
	VersionedKeyIdentifier *string
}

func (KeyVaultProperties) MarshalJSON

func (k KeyVaultProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties.

func (*KeyVaultProperties) UnmarshalJSON

func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties.

type LastModifiedByType

type LastModifiedByType string

LastModifiedByType - The type of identity that last modified the resource.

const (
	LastModifiedByTypeApplication     LastModifiedByType = "Application"
	LastModifiedByTypeKey             LastModifiedByType = "Key"
	LastModifiedByTypeManagedIdentity LastModifiedByType = "ManagedIdentity"
	LastModifiedByTypeUser            LastModifiedByType = "User"
)

func PossibleLastModifiedByTypeValues

func PossibleLastModifiedByTypeValues() []LastModifiedByType

PossibleLastModifiedByTypeValues returns the possible values for the LastModifiedByType const type.

type NetworkRuleBypassOptions

type NetworkRuleBypassOptions string

NetworkRuleBypassOptions - Whether to allow trusted Azure services to access a network restricted registry.

const (
	NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices"
	NetworkRuleBypassOptionsNone          NetworkRuleBypassOptions = "None"
)

func PossibleNetworkRuleBypassOptionsValues

func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions

PossibleNetworkRuleBypassOptionsValues returns the possible values for the NetworkRuleBypassOptions const type.

type NetworkRuleSet

type NetworkRuleSet struct {
	// REQUIRED; The default action of allow or deny when no other rules match.
	DefaultAction *DefaultAction

	// The IP ACL rules.
	IPRules []*IPRule
}

NetworkRuleSet - The network rule set for a container registry.

func (NetworkRuleSet) MarshalJSON

func (n NetworkRuleSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.

func (*NetworkRuleSet) UnmarshalJSON added in v0.7.0

func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.

type OS

type OS string

OS - The OS of agent machine

const (
	OSLinux   OS = "Linux"
	OSWindows OS = "Windows"
)

func PossibleOSValues

func PossibleOSValues() []OS

PossibleOSValues returns the possible values for the OS const type.

type OperationDefinition

type OperationDefinition struct {
	// The display information for the container registry operation.
	Display *OperationDisplayDefinition

	// This property indicates if the operation is an action or a data action ref: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations
	IsDataAction *bool

	// Operation name: {provider}/{resource}/{operation}.
	Name *string

	// The origin information of the container registry operation.
	Origin *string

	// The properties information for the container registry operation.
	Properties *OperationPropertiesDefinition
}

OperationDefinition - The definition of a container registry operation.

func (OperationDefinition) MarshalJSON added in v0.7.0

func (o OperationDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDefinition.

func (*OperationDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDefinition.

type OperationDisplayDefinition

type OperationDisplayDefinition struct {
	// The description for the operation.
	Description *string

	// The operation that users can perform.
	Operation *string

	// The resource provider name: Microsoft.ContainerRegistry.
	Provider *string

	// The resource on which the operation is performed.
	Resource *string
}

OperationDisplayDefinition - The display information for a container registry operation.

func (OperationDisplayDefinition) MarshalJSON added in v0.7.0

func (o OperationDisplayDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplayDefinition.

func (*OperationDisplayDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationDisplayDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayDefinition.

type OperationListResult

type OperationListResult struct {
	// The URI that can be used to request the next list of container registry operations.
	NextLink *string

	// The list of container registry operations. Since this list may be incomplete, the nextLink field should be used to request
	// the next list of operations.
	Value []*OperationDefinition
}

OperationListResult - The result of a request to list container registry operations.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.7.0

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationLogSpecificationDefinition

type OperationLogSpecificationDefinition struct {
	// Log blob duration.
	BlobDuration *string

	// Log display name.
	DisplayName *string

	// Log name.
	Name *string
}

OperationLogSpecificationDefinition - The definition of Azure Monitoring log.

func (OperationLogSpecificationDefinition) MarshalJSON added in v0.7.0

func (o OperationLogSpecificationDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationLogSpecificationDefinition.

func (*OperationLogSpecificationDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationLogSpecificationDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogSpecificationDefinition.

type OperationMetricSpecificationDefinition

type OperationMetricSpecificationDefinition struct {
	// Metric aggregation type.
	AggregationType *string

	// Metric description.
	DisplayDescription *string

	// Metric display name.
	DisplayName *string

	// Internal metric name.
	InternalMetricName *string

	// Metric name.
	Name *string

	// Metric unit.
	Unit *string
}

OperationMetricSpecificationDefinition - The definition of Azure Monitoring metric.

func (OperationMetricSpecificationDefinition) MarshalJSON added in v0.7.0

func (o OperationMetricSpecificationDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationMetricSpecificationDefinition.

func (*OperationMetricSpecificationDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationMetricSpecificationDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricSpecificationDefinition.

type OperationPropertiesDefinition

type OperationPropertiesDefinition struct {
	// The definition of Azure Monitoring service.
	ServiceSpecification *OperationServiceSpecificationDefinition
}

OperationPropertiesDefinition - The definition of Azure Monitoring properties.

func (OperationPropertiesDefinition) MarshalJSON added in v0.7.0

func (o OperationPropertiesDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationPropertiesDefinition.

func (*OperationPropertiesDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationPropertiesDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationPropertiesDefinition.

type OperationServiceSpecificationDefinition

type OperationServiceSpecificationDefinition struct {
	// A list of Azure Monitoring log definitions.
	LogSpecifications []*OperationLogSpecificationDefinition

	// A list of Azure Monitoring metrics definition.
	MetricSpecifications []*OperationMetricSpecificationDefinition
}

OperationServiceSpecificationDefinition - The definition of Azure Monitoring list.

func (OperationServiceSpecificationDefinition) MarshalJSON

func (o OperationServiceSpecificationDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecificationDefinition.

func (*OperationServiceSpecificationDefinition) UnmarshalJSON added in v0.7.0

func (o *OperationServiceSpecificationDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecificationDefinition.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager added in v0.5.0

NewListPager - Lists all of the available Azure Container Registry REST API operations.

Generated from API version 2023-07-01

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/OperationList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.OperationListResult = armcontainerregistry.OperationListResult{
		// 	Value: []*armcontainerregistry.OperationDefinition{
		// 		{
		// 			Name: to.Ptr("Microsoft.ContainerRegistry/locations/deleteVirtualNetworkOrSubnets/action"),
		// 			Display: &armcontainerregistry.OperationDisplayDefinition{
		// 				Description: to.Ptr("Notifies Microsoft.ContainerRegistry that virtual network or subnet is being deleted"),
		// 				Operation: to.Ptr("Delete virtual network or subnets notifications"),
		// 				Provider: to.Ptr("Microsoft ContainerRegistry"),
		// 				Resource: to.Ptr(""),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.3.0

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse added in v0.3.0

type OperationsClientListResponse struct {
	// The result of a request to list container registry operations.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OverrideTaskStepProperties

type OverrideTaskStepProperties struct {
	// Gets or sets the collection of override arguments to be used when executing a build step.
	Arguments []*Argument

	// The source context against which run has to be queued.
	ContextPath *string

	// The file against which run has to be queued.
	File *string

	// The name of the target build stage for the docker build.
	Target *string

	// Base64 encoded update trigger token that will be attached with the base image trigger webhook.
	UpdateTriggerToken *string

	// The collection of overridable values that can be passed when running a Task.
	Values []*SetValue
}

func (OverrideTaskStepProperties) MarshalJSON

func (o OverrideTaskStepProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OverrideTaskStepProperties.

func (*OverrideTaskStepProperties) UnmarshalJSON added in v0.7.0

func (o *OverrideTaskStepProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OverrideTaskStepProperties.

type PasswordName

type PasswordName string

PasswordName - The password name.

const (
	PasswordNamePassword  PasswordName = "password"
	PasswordNamePassword2 PasswordName = "password2"
)

func PossiblePasswordNameValues

func PossiblePasswordNameValues() []PasswordName

PossiblePasswordNameValues returns the possible values for the PasswordName const type.

type PlatformProperties

type PlatformProperties struct {
	// REQUIRED; The operating system type required for the run.
	OS *OS

	// The OS architecture.
	Architecture *Architecture

	// Variant of the CPU.
	Variant *Variant
}

PlatformProperties - The platform properties against which the run has to happen.

func (PlatformProperties) MarshalJSON added in v0.7.0

func (p PlatformProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PlatformProperties.

func (*PlatformProperties) UnmarshalJSON added in v0.7.0

func (p *PlatformProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PlatformProperties.

type PlatformUpdateParameters

type PlatformUpdateParameters struct {
	// The OS architecture.
	Architecture *Architecture

	// The operating system type required for the run.
	OS *OS

	// Variant of the CPU.
	Variant *Variant
}

PlatformUpdateParameters - The properties for updating the platform configuration.

func (PlatformUpdateParameters) MarshalJSON added in v0.7.0

func (p PlatformUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PlatformUpdateParameters.

func (*PlatformUpdateParameters) UnmarshalJSON added in v0.7.0

func (p *PlatformUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PlatformUpdateParameters.

type Policies

type Policies struct {
	// The export policy for a container registry.
	ExportPolicy *ExportPolicy

	// The quarantine policy for a container registry.
	QuarantinePolicy *QuarantinePolicy

	// The retention policy for a container registry.
	RetentionPolicy *RetentionPolicy

	// The content trust policy for a container registry.
	TrustPolicy *TrustPolicy
}

Policies - The policies for a container registry.

func (Policies) MarshalJSON added in v0.7.0

func (p Policies) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Policies.

func (*Policies) UnmarshalJSON added in v0.7.0

func (p *Policies) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Policies.

type PolicyStatus

type PolicyStatus string

PolicyStatus - The value that indicates whether the policy is enabled or not.

const (
	PolicyStatusDisabled PolicyStatus = "disabled"
	PolicyStatusEnabled  PolicyStatus = "enabled"
)

func PossiblePolicyStatusValues

func PossiblePolicyStatusValues() []PolicyStatus

PossiblePolicyStatusValues returns the possible values for the PolicyStatus const type.

type PrivateEndpoint

type PrivateEndpoint struct {
	// This is private endpoint resource created with Microsoft.Network resource provider.
	ID *string
}

PrivateEndpoint - The Private Endpoint resource.

func (PrivateEndpoint) MarshalJSON added in v0.7.0

func (p PrivateEndpoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint.

func (*PrivateEndpoint) UnmarshalJSON added in v0.7.0

func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint.

type PrivateEndpointConnection

type PrivateEndpointConnection struct {
	// The properties of a private endpoint connection.
	Properties *PrivateEndpointConnectionProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

PrivateEndpointConnection - An object that represents a private endpoint connection for a container registry.

func (PrivateEndpointConnection) MarshalJSON added in v0.7.0

func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON added in v0.7.0

func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// The URI that can be used to request the next list of private endpoint connections.
	NextLink *string

	// The list of private endpoint connections. Since this list may be incomplete, the nextLink field should be used to request
	// the next list of private endpoint connections.
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - The result of a request to list private endpoint connections for a container registry.

func (PrivateEndpointConnectionListResult) MarshalJSON

func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON added in v0.7.0

func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// The resource of private endpoint.
	PrivateEndpoint *PrivateEndpoint

	// A collection of information about the state of the connection between service consumer and provider.
	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState

	// READ-ONLY; The provisioning state of private endpoint connection resource.
	ProvisioningState *ProvisioningState
}

PrivateEndpointConnectionProperties - The properties of a private endpoint connection.

func (PrivateEndpointConnectionProperties) MarshalJSON added in v0.7.0

func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON added in v0.7.0

func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionsClient

type PrivateEndpointConnectionsClient struct {
	// contains filtered or unexported fields
}

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateEndpointConnectionsClient) BeginCreateOrUpdate

func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Update the state of specified private endpoint connection associated with the container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • privateEndpointConnection - The parameters for creating a private endpoint connection.
  • options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionCreateOrUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myRegistry", "myConnection", armcontainerregistry.PrivateEndpointConnection{
		Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{
			PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{
				Description: to.Ptr("Auto-Approved"),
				Status:      to.Ptr(armcontainerregistry.ConnectionStatusApproved),
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{
	// 	Name: to.Ptr("myConnection"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"),
	// 	Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("Auto-Approved"),
	// 			ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone),
	// 			Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) BeginDelete

func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)

BeginDelete - Deletes the specified private endpoint connection associated with the container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myConnection", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Get the specified private endpoint connection associated with the container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • privateEndpointConnectionName - The name of the private endpoint connection.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "myResourceGroup", "myRegistry", "myConnection", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateEndpointConnection = armcontainerregistry.PrivateEndpointConnection{
	// 	Name: to.Ptr("myConnection"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"),
	// 	Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{
	// 		PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{
	// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"),
	// 		},
	// 		PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{
	// 			Description: to.Ptr("Auto-Approved"),
	// 			ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone),
	// 			Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListPager added in v0.5.0

NewListPager - List all private endpoint connections in a container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/PrivateEndpointConnectionList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PrivateEndpointConnectionListResult = armcontainerregistry.PrivateEndpointConnectionListResult{
		// 	Value: []*armcontainerregistry.PrivateEndpointConnection{
		// 		{
		// 			Name: to.Ptr("myConnection"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateEndpointConnections"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateEndpointConnections/myConnection"),
		// 			Properties: &armcontainerregistry.PrivateEndpointConnectionProperties{
		// 				PrivateEndpoint: &armcontainerregistry.PrivateEndpoint{
		// 					ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/peexample01"),
		// 				},
		// 				PrivateLinkServiceConnectionState: &armcontainerregistry.PrivateLinkServiceConnectionState{
		// 					Description: to.Ptr("Auto-Approved"),
		// 					ActionsRequired: to.Ptr(armcontainerregistry.ActionsRequiredNone),
		// 					Status: to.Ptr(armcontainerregistry.ConnectionStatusApproved),
		// 				},
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 			},
		// 	}},
		// }
	}
}
Output:

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions added in v0.3.0

type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate method.

type PrivateEndpointConnectionsClientBeginDeleteOptions added in v0.3.0

type PrivateEndpointConnectionsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete method.

type PrivateEndpointConnectionsClientCreateOrUpdateResponse added in v0.3.0

type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct {
	// An object that represents a private endpoint connection for a container registry.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate.

type PrivateEndpointConnectionsClientDeleteResponse added in v0.3.0

type PrivateEndpointConnectionsClientDeleteResponse struct {
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete.

type PrivateEndpointConnectionsClientGetOptions added in v0.3.0

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse added in v0.3.0

type PrivateEndpointConnectionsClientGetResponse struct {
	// An object that represents a private endpoint connection for a container registry.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListOptions added in v0.3.0

type PrivateEndpointConnectionsClientListOptions struct {
}

PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListPager method.

type PrivateEndpointConnectionsClientListResponse added in v0.3.0

type PrivateEndpointConnectionsClientListResponse struct {
	// The result of a request to list private endpoint connections for a container registry.
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager.

type PrivateLinkResource

type PrivateLinkResource struct {
	// The resource ID.
	ID *string

	// The name of the resource.
	Name *string

	// A resource that supports private link capabilities.
	Properties *PrivateLinkResourceProperties

	// READ-ONLY; The resource type is private link resource.
	Type *string
}

PrivateLinkResource - A resource that supports private link capabilities.

func (PrivateLinkResource) MarshalJSON added in v0.7.0

func (p PrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON added in v0.7.0

func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceListResult

type PrivateLinkResourceListResult struct {
	// The URI that can be used to request the next list of private link resources.
	NextLink *string

	// The list of private link resources. Since this list may be incomplete, the nextLink field should be used to request the
	// next list of private link resources.
	Value []*PrivateLinkResource
}

PrivateLinkResourceListResult - The result of a request to list private link resources for a container registry.

func (PrivateLinkResourceListResult) MarshalJSON

func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult.

func (*PrivateLinkResourceListResult) UnmarshalJSON added in v0.7.0

func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// The private link resource group id.
	GroupID *string

	// The private link resource required member names.
	RequiredMembers []*string

	// The private link resource Private link DNS zone name.
	RequiredZoneNames []*string
}

PrivateLinkResourceProperties - The properties of a private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON added in v0.7.0

func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkServiceConnectionState

type PrivateLinkServiceConnectionState struct {
	// A message indicating if changes on the service provider require any updates on the consumer.
	ActionsRequired *ActionsRequired

	// The description for connection status. For example if connection is rejected it can indicate reason for rejection.
	Description *string

	// The private link service connection status.
	Status *ConnectionStatus
}

PrivateLinkServiceConnectionState - The state of a private link service connection.

func (PrivateLinkServiceConnectionState) MarshalJSON added in v0.7.0

func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState.

func (*PrivateLinkServiceConnectionState) UnmarshalJSON added in v0.7.0

func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning state of this agent pool

const (
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateCreating  ProvisioningState = "Creating"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type PublicNetworkAccess

type PublicNetworkAccess string

PublicNetworkAccess - Whether or not public network access is allowed for the container registry.

const (
	PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled"
	PublicNetworkAccessEnabled  PublicNetworkAccess = "Enabled"
)

func PossiblePublicNetworkAccessValues

func PossiblePublicNetworkAccessValues() []PublicNetworkAccess

PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.

type QuarantinePolicy

type QuarantinePolicy struct {
	// The value that indicates whether the policy is enabled or not.
	Status *PolicyStatus
}

QuarantinePolicy - The quarantine policy for a container registry.

func (QuarantinePolicy) MarshalJSON added in v0.7.0

func (q QuarantinePolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuarantinePolicy.

func (*QuarantinePolicy) UnmarshalJSON added in v0.7.0

func (q *QuarantinePolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuarantinePolicy.

type RegenerateCredentialParameters

type RegenerateCredentialParameters struct {
	// REQUIRED; Specifies name of the password which should be regenerated -- password or password2.
	Name *PasswordName
}

RegenerateCredentialParameters - The parameters used to regenerate the login credential.

func (RegenerateCredentialParameters) MarshalJSON added in v0.7.0

func (r RegenerateCredentialParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegenerateCredentialParameters.

func (*RegenerateCredentialParameters) UnmarshalJSON added in v0.7.0

func (r *RegenerateCredentialParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateCredentialParameters.

type RegistriesClient

type RegistriesClient struct {
	// contains filtered or unexported fields
}

RegistriesClient contains the methods for the Registries group. Don't use this type directly, use NewRegistriesClient() instead.

func NewRegistriesClient

func NewRegistriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegistriesClient, error)

NewRegistriesClient creates a new instance of RegistriesClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*RegistriesClient) BeginCreate

func (client *RegistriesClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, registry Registry, options *RegistriesClientBeginCreateOptions) (*runtime.Poller[RegistriesClientCreateResponse], error)

BeginCreate - Creates a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • registry - The parameters for creating a container registry.
  • options - RegistriesClientBeginCreateOptions contains the optional parameters for the RegistriesClient.BeginCreate method.
Example (RegistryCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
		Properties: &armcontainerregistry.RegistryProperties{
			AdminUserEnabled: to.Ptr(true),
		},
		SKU: &armcontainerregistry.SKU{
			Name: to.Ptr(armcontainerregistry.SKUNameStandard),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Registry = armcontainerregistry.Registry{
	// 	Name: to.Ptr("myRegistry"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.RegistryProperties{
	// 		AdminUserEnabled: to.Ptr(true),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
	// 		DataEndpointEnabled: to.Ptr(false),
	// 		DataEndpointHostNames: []*string{
	// 		},
	// 		Encryption: &armcontainerregistry.EncryptionProperty{
	// 			Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
	// 		},
	// 		LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
	// 		NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
	// 		NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
	// 			DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
	// 			IPRules: []*armcontainerregistry.IPRule{
	// 			},
	// 		},
	// 		Policies: &armcontainerregistry.Policies{
	// 			ExportPolicy: &armcontainerregistry.ExportPolicy{
	// 				Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
	// 			},
	// 			QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			RetentionPolicy: &armcontainerregistry.RetentionPolicy{
	// 				Days: to.Ptr[int32](7),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			TrustPolicy: &armcontainerregistry.TrustPolicy{
	// 				Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 		},
	// 		PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// 	SKU: &armcontainerregistry.SKU{
	// 		Name: to.Ptr(armcontainerregistry.SKUNameStandard),
	// 		Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
	// 	},
	// }
}
Output:

Example (RegistryCreateZoneRedundant)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCreateZoneRedundant.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.Registry{
		Location: to.Ptr("westus"),
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
		Properties: &armcontainerregistry.RegistryProperties{
			ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled),
		},
		SKU: &armcontainerregistry.SKU{
			Name: to.Ptr(armcontainerregistry.SKUNameStandard),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Registry = armcontainerregistry.Registry{
	// 	Name: to.Ptr("myRegistry"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.RegistryProperties{
	// 		AdminUserEnabled: to.Ptr(false),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
	// 		DataEndpointEnabled: to.Ptr(false),
	// 		DataEndpointHostNames: []*string{
	// 		},
	// 		Encryption: &armcontainerregistry.EncryptionProperty{
	// 			Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
	// 		},
	// 		LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
	// 		NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
	// 		NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
	// 			DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
	// 			IPRules: []*armcontainerregistry.IPRule{
	// 			},
	// 		},
	// 		Policies: &armcontainerregistry.Policies{
	// 			ExportPolicy: &armcontainerregistry.ExportPolicy{
	// 				Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
	// 			},
	// 			QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			RetentionPolicy: &armcontainerregistry.RetentionPolicy{
	// 				Days: to.Ptr[int32](7),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			TrustPolicy: &armcontainerregistry.TrustPolicy{
	// 				Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 		},
	// 		PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled),
	// 	},
	// 	SKU: &armcontainerregistry.SKU{
	// 		Name: to.Ptr(armcontainerregistry.SKUNameStandard),
	// 		Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
	// 	},
	// }
}
Output:

func (*RegistriesClient) BeginDelete

func (client *RegistriesClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientBeginDeleteOptions) (*runtime.Poller[RegistriesClientDeleteResponse], error)

BeginDelete - Deletes a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*RegistriesClient) BeginGenerateCredentials

func (client *RegistriesClient) BeginGenerateCredentials(ctx context.Context, resourceGroupName string, registryName string, generateCredentialsParameters GenerateCredentialsParameters, options *RegistriesClientBeginGenerateCredentialsOptions) (*runtime.Poller[RegistriesClientGenerateCredentialsResponse], error)

BeginGenerateCredentials - Generate keys for a token of a specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • generateCredentialsParameters - The parameters for generating credentials.
  • options - RegistriesClientBeginGenerateCredentialsOptions contains the optional parameters for the RegistriesClient.BeginGenerateCredentials method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGenerateCredentials.json

package main

import (
	"context"
	"log"

	"time"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginGenerateCredentials(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.GenerateCredentialsParameters{
		Expiry:  to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t }()),
		TokenID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.GenerateCredentialsResult = armcontainerregistry.GenerateCredentialsResult{
	// 	Passwords: []*armcontainerregistry.TokenPassword{
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword1),
	// 			Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 		},
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.TokenPasswordNamePassword2),
	// 			Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T15:59:59.070Z"); return t}()),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 	}},
	// 	Username: to.Ptr("myToken"),
	// }
}
Output:

func (*RegistriesClient) BeginImportImage

func (client *RegistriesClient) BeginImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters, options *RegistriesClientBeginImportImageOptions) (*runtime.Poller[RegistriesClientImportImageResponse], error)

BeginImportImage - Copies an image to this container registry from the specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • parameters - The parameters specifying the image to copy and the source container registry.
  • options - RegistriesClientBeginImportImageOptions contains the optional parameters for the RegistriesClient.BeginImportImage method.
Example (ImportImageByManifestDigest)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageByManifestDigest.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{
		Mode: to.Ptr(armcontainerregistry.ImportModeForce),
		Source: &armcontainerregistry.ImportSource{
			ResourceID:  to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"),
			SourceImage: to.Ptr("sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000"),
		},
		TargetTags: []*string{
			to.Ptr("targetRepository:targetTag")},
		UntaggedTargetRepositories: []*string{
			to.Ptr("targetRepository1")},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

Example (ImportImageByTag)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageByTag.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{
		Mode: to.Ptr(armcontainerregistry.ImportModeForce),
		Source: &armcontainerregistry.ImportSource{
			ResourceID:  to.Ptr("/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry"),
			SourceImage: to.Ptr("sourceRepository:sourceTag"),
		},
		TargetTags: []*string{
			to.Ptr("targetRepository:targetTag")},
		UntaggedTargetRepositories: []*string{
			to.Ptr("targetRepository1")},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

Example (ImportImageFromPublicRegistry)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ImportImageFromPublicRegistry.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginImportImage(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.ImportImageParameters{
		Mode: to.Ptr(armcontainerregistry.ImportModeForce),
		Source: &armcontainerregistry.ImportSource{
			RegistryURI: to.Ptr("registry.hub.docker.com"),
			SourceImage: to.Ptr("library/hello-world"),
		},
		TargetTags: []*string{
			to.Ptr("targetRepository:targetTag")},
		UntaggedTargetRepositories: []*string{
			to.Ptr("targetRepository1")},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*RegistriesClient) BeginScheduleRun

func (client *RegistriesClient) BeginScheduleRun(ctx context.Context, resourceGroupName string, registryName string, runRequest RunRequestClassification, options *RegistriesClientBeginScheduleRunOptions) (*runtime.Poller[RegistriesClientScheduleRunResponse], error)

BeginScheduleRun - Schedules a new run based on the request parameters and add it to the run queue. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • runRequest - The parameters of a run that needs to scheduled.
  • options - RegistriesClientBeginScheduleRunOptions contains the optional parameters for the RegistriesClient.BeginScheduleRun method.
Example (RegistriesScheduleRun)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{
		Type:             to.Ptr("DockerBuildRequest"),
		IsArchiveEnabled: to.Ptr(true),
		AgentConfiguration: &armcontainerregistry.AgentProperties{
			CPU: to.Ptr[int32](2),
		},
		Arguments: []*armcontainerregistry.Argument{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
		DockerFilePath: to.Ptr("DockerFile"),
		ImageNames: []*string{
			to.Ptr("azurerest:testtag")},
		IsPushEnabled: to.Ptr(true),
		NoCache:       to.Ptr(true),
		Platform: &armcontainerregistry.PlatformProperties{
			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
			OS:           to.Ptr(armcontainerregistry.OSLinux),
		},
		SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunEncodedTaskRun)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_EncodedTaskRun.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.EncodedTaskRunRequest{
		Type: to.Ptr("EncodedTaskRunRequest"),
		AgentConfiguration: &armcontainerregistry.AgentProperties{
			CPU: to.Ptr[int32](2),
		},
		EncodedTaskContent:   to.Ptr("c3RlcHM6Cnt7IGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAncHJvZCcgfX0KICAtIHJ1bjogcHJvZCBzZXR1cAp7eyBlbHNlIGlmIFZhbHVlcy5lbnZpcm9ubWVudCA9PSAnc3RhZ2luZycgfX0KICAtIHJ1bjogc3RhZ2luZyBzZXR1cAp7eyBlbHNlIH19CiAgLSBydW46IGRlZmF1bHQgc2V0dXAKe3sgZW5kIH19CgogIC0gcnVuOiBidWlsZCAtdCBGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0gLgoKcHVzaDogWydGYW5jeVRoaW5nOnt7LlZhbHVlcy5lbnZpcm9ubWVudH19LXt7LlZhbHVlcy52ZXJzaW9ufX0nXQ=="),
		EncodedValuesContent: to.Ptr("ZW52aXJvbm1lbnQ6IHByb2QKdmVyc2lvbjogMQ=="),
		Platform: &armcontainerregistry.PlatformProperties{
			OS: to.Ptr(armcontainerregistry.OSLinux),
		},
		Values: []*armcontainerregistry.SetValue{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunFileTaskRun)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTaskRun.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{
		Type: to.Ptr("FileTaskRunRequest"),
		AgentConfiguration: &armcontainerregistry.AgentProperties{
			CPU: to.Ptr[int32](2),
		},
		Platform: &armcontainerregistry.PlatformProperties{
			OS: to.Ptr(armcontainerregistry.OSLinux),
		},
		SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
		TaskFilePath:   to.Ptr("acb.yaml"),
		Values: []*armcontainerregistry.SetValue{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
		ValuesFilePath: to.Ptr("prod-values.yaml"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunTask)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_Task.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.TaskRunRequest{
		Type: to.Ptr("TaskRunRequest"),
		OverrideTaskStepProperties: &armcontainerregistry.OverrideTaskStepProperties{
			Arguments: []*armcontainerregistry.Argument{
				{
					Name:     to.Ptr("mytestargument"),
					IsSecret: to.Ptr(false),
					Value:    to.Ptr("mytestvalue"),
				},
				{
					Name:     to.Ptr("mysecrettestargument"),
					IsSecret: to.Ptr(true),
					Value:    to.Ptr("mysecrettestvalue"),
				}},
			File:               to.Ptr("overriddenDockerfile"),
			Target:             to.Ptr("build"),
			UpdateTriggerToken: to.Ptr("aGVsbG8gd29ybGQ="),
			Values: []*armcontainerregistry.SetValue{
				{
					Name:     to.Ptr("mytestname"),
					IsSecret: to.Ptr(false),
					Value:    to.Ptr("mytestvalue"),
				},
				{
					Name:     to.Ptr("mysecrettestname"),
					IsSecret: to.Ptr(true),
					Value:    to.Ptr("mysecrettestvalue"),
				}},
		},
		TaskID: to.Ptr("myTask"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunTaskWithCustomCredentials)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.FileTaskRunRequest{
		Type: to.Ptr("FileTaskRunRequest"),
		Credentials: &armcontainerregistry.Credentials{
			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
				"myregistry.azurecr.io": {
					Password: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("***"),
					},
					UserName: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("reg1"),
					},
				},
			},
			SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{
				LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault),
			},
		},
		Platform: &armcontainerregistry.PlatformProperties{
			OS: to.Ptr(armcontainerregistry.OSLinux),
		},
		TaskFilePath: to.Ptr("acb.yaml"),
		Values: []*armcontainerregistry.SetValue{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunWithCustomCredentials)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithCustomCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{
		Type:             to.Ptr("DockerBuildRequest"),
		IsArchiveEnabled: to.Ptr(true),
		AgentConfiguration: &armcontainerregistry.AgentProperties{
			CPU: to.Ptr[int32](2),
		},
		Arguments: []*armcontainerregistry.Argument{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
		Credentials: &armcontainerregistry.Credentials{
			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
				"myregistry.azurecr.io": {
					Password: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("***"),
					},
					UserName: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("reg1"),
					},
				},
				"myregistry2.azurecr.io": {
					Password: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("***"),
					},
					UserName: &armcontainerregistry.SecretObject{
						Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
						Value: to.Ptr("reg2"),
					},
				},
			},
			SourceRegistry: &armcontainerregistry.SourceRegistryCredentials{
				LoginMode: to.Ptr(armcontainerregistry.SourceRegistryLoginModeDefault),
			},
		},
		DockerFilePath: to.Ptr("DockerFile"),
		ImageNames: []*string{
			to.Ptr("azurerest:testtag")},
		IsPushEnabled: to.Ptr(true),
		NoCache:       to.Ptr(true),
		Platform: &armcontainerregistry.PlatformProperties{
			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
			OS:           to.Ptr(armcontainerregistry.OSLinux),
		},
		SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
		Target:         to.Ptr("stage1"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

Example (RegistriesScheduleRunWithLogTemplate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesScheduleRun_WithLogTemplate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginScheduleRun(ctx, "myResourceGroup", "myRegistry", &armcontainerregistry.DockerBuildRequest{
		Type:             to.Ptr("DockerBuildRequest"),
		IsArchiveEnabled: to.Ptr(true),
		LogTemplate:      to.Ptr("acr/tasks:{{.Run.OS}}"),
		AgentConfiguration: &armcontainerregistry.AgentProperties{
			CPU: to.Ptr[int32](2),
		},
		Arguments: []*armcontainerregistry.Argument{
			{
				Name:     to.Ptr("mytestargument"),
				IsSecret: to.Ptr(false),
				Value:    to.Ptr("mytestvalue"),
			},
			{
				Name:     to.Ptr("mysecrettestargument"),
				IsSecret: to.Ptr(true),
				Value:    to.Ptr("mysecrettestvalue"),
			}},
		DockerFilePath: to.Ptr("DockerFile"),
		ImageNames: []*string{
			to.Ptr("azurerest:testtag")},
		IsPushEnabled: to.Ptr(true),
		NoCache:       to.Ptr(true),
		Platform: &armcontainerregistry.PlatformProperties{
			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
			OS:           to.Ptr(armcontainerregistry.OSLinux),
		},
		SourceLocation: to.Ptr("https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/run"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 	},
	// }
}
Output:

func (*RegistriesClient) BeginUpdate

func (client *RegistriesClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, options *RegistriesClientBeginUpdateOptions) (*runtime.Poller[RegistriesClientUpdateResponse], error)

BeginUpdate - Updates a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • registryUpdateParameters - The parameters for updating a container registry.
  • options - RegistriesClientBeginUpdateOptions contains the optional parameters for the RegistriesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRegistriesClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegistryUpdateParameters{
		Properties: &armcontainerregistry.RegistryPropertiesUpdateParameters{
			AdminUserEnabled: to.Ptr(true),
		},
		SKU: &armcontainerregistry.SKU{
			Name: to.Ptr(armcontainerregistry.SKUNameStandard),
		},
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Registry = armcontainerregistry.Registry{
	// 	Name: to.Ptr("myRegistry"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.RegistryProperties{
	// 		AdminUserEnabled: to.Ptr(true),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
	// 		DataEndpointEnabled: to.Ptr(false),
	// 		DataEndpointHostNames: []*string{
	// 		},
	// 		Encryption: &armcontainerregistry.EncryptionProperty{
	// 			Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
	// 		},
	// 		LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
	// 		NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
	// 		NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
	// 			DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
	// 			IPRules: []*armcontainerregistry.IPRule{
	// 			},
	// 		},
	// 		Policies: &armcontainerregistry.Policies{
	// 			ExportPolicy: &armcontainerregistry.ExportPolicy{
	// 				Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
	// 			},
	// 			QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			RetentionPolicy: &armcontainerregistry.RetentionPolicy{
	// 				Days: to.Ptr[int32](7),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			TrustPolicy: &armcontainerregistry.TrustPolicy{
	// 				Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 		},
	// 		PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// 	SKU: &armcontainerregistry.SKU{
	// 		Name: to.Ptr(armcontainerregistry.SKUNameStandard),
	// 		Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
	// 	},
	// }
}
Output:

func (*RegistriesClient) CheckNameAvailability

CheckNameAvailability - Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • registryNameCheckRequest - The object containing information for the availability request.
  • options - RegistriesClientCheckNameAvailabilityOptions contains the optional parameters for the RegistriesClient.CheckNameAvailability method.
Example (RegistryCheckNameAvailable)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCheckNameAvailable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().CheckNameAvailability(ctx, armcontainerregistry.RegistryNameCheckRequest{
		Name: to.Ptr("myRegistry"),
		Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{
	// 	NameAvailable: to.Ptr(true),
	// }
}
Output:

Example (RegistryCheckNameNotAvailable)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryCheckNameNotAvailable.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().CheckNameAvailability(ctx, armcontainerregistry.RegistryNameCheckRequest{
		Name: to.Ptr("myRegistry"),
		Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegistryNameStatus = armcontainerregistry.RegistryNameStatus{
	// 	Message: to.Ptr("The registry myRegistry is already in use."),
	// 	NameAvailable: to.Ptr(false),
	// 	Reason: to.Ptr("AlreadyExists"),
	// }
}
Output:

func (*RegistriesClient) Get

func (client *RegistriesClient) Get(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientGetOptions) (RegistriesClientGetResponse, error)

Get - Gets the properties of the specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().Get(ctx, "myResourceGroup", "myRegistry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Registry = armcontainerregistry.Registry{
	// 	Name: to.Ptr("myRegistry"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.RegistryProperties{
	// 		AdminUserEnabled: to.Ptr(false),
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
	// 		DataEndpointEnabled: to.Ptr(false),
	// 		DataEndpointHostNames: []*string{
	// 		},
	// 		Encryption: &armcontainerregistry.EncryptionProperty{
	// 			Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
	// 		},
	// 		LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
	// 		NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
	// 		NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
	// 			DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
	// 			IPRules: []*armcontainerregistry.IPRule{
	// 			},
	// 		},
	// 		Policies: &armcontainerregistry.Policies{
	// 			ExportPolicy: &armcontainerregistry.ExportPolicy{
	// 				Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
	// 			},
	// 			QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			RetentionPolicy: &armcontainerregistry.RetentionPolicy{
	// 				Days: to.Ptr[int32](7),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 			TrustPolicy: &armcontainerregistry.TrustPolicy{
	// 				Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
	// 				Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
	// 			},
	// 		},
	// 		PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// 	SKU: &armcontainerregistry.SKU{
	// 		Name: to.Ptr(armcontainerregistry.SKUNameStandard),
	// 		Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
	// 	},
	// }
}
Output:

func (*RegistriesClient) GetBuildSourceUploadURL

func (client *RegistriesClient) GetBuildSourceUploadURL(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientGetBuildSourceUploadURLOptions) (RegistriesClientGetBuildSourceUploadURLResponse, error)

GetBuildSourceUploadURL - Get the upload location for the user to be able to upload the source. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • options - RegistriesClientGetBuildSourceUploadURLOptions contains the optional parameters for the RegistriesClient.GetBuildSourceUploadURL method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RegistriesGetBuildSourceUploadUrl.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().GetBuildSourceUploadURL(ctx, "myResourceGroup", "myRegistry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.SourceUploadDefinition = armcontainerregistry.SourceUploadDefinition{
	// 	RelativePath: to.Ptr("source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz"),
	// 	UploadURL: to.Ptr("https://registrystorageaccount.blob.core.windows.net/registrycontainer/source/201802130000/b52f12d8-c3d6-4d75-9107-220f0bfc681d.tar.gz?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
	// }
}
Output:

func (*RegistriesClient) GetPrivateLinkResource added in v0.3.0

func (client *RegistriesClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, registryName string, groupName string, options *RegistriesClientGetPrivateLinkResourceOptions) (RegistriesClientGetPrivateLinkResourceResponse, error)

GetPrivateLinkResource - Gets a private link resource by a specified group name for a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • groupName - The name of the private link resource.
  • options - RegistriesClientGetPrivateLinkResourceOptions contains the optional parameters for the RegistriesClient.GetPrivateLinkResource method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryGetPrivateLinkResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().GetPrivateLinkResource(ctx, "myResourceGroup", "myRegistry", "registry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.PrivateLinkResource = armcontainerregistry.PrivateLinkResource{
	// 	Name: to.Ptr("registry"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"),
	// 	Properties: &armcontainerregistry.PrivateLinkResourceProperties{
	// 		GroupID: to.Ptr("registry"),
	// 		RequiredMembers: []*string{
	// 			to.Ptr("registry"),
	// 			to.Ptr("registry_data_myregion")},
	// 			RequiredZoneNames: []*string{
	// 				to.Ptr("privatelink.azurecr.io")},
	// 			},
	// 		}
}
Output:

func (*RegistriesClient) ListCredentials

func (client *RegistriesClient) ListCredentials(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientListCredentialsOptions) (RegistriesClientListCredentialsResponse, error)

ListCredentials - Lists the login credentials for the specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - RegistriesClientListCredentialsOptions contains the optional parameters for the RegistriesClient.ListCredentials method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().ListCredentials(ctx, "myResourceGroup", "myRegistry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{
	// 	Passwords: []*armcontainerregistry.RegistryPassword{
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.PasswordNamePassword),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 		},
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.PasswordNamePassword2),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 	}},
	// 	Username: to.Ptr("myRegistry"),
	// }
}
Output:

func (*RegistriesClient) ListUsages

func (client *RegistriesClient) ListUsages(ctx context.Context, resourceGroupName string, registryName string, options *RegistriesClientListUsagesOptions) (RegistriesClientListUsagesResponse, error)

ListUsages - Gets the quota usages for the specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - RegistriesClientListUsagesOptions contains the optional parameters for the RegistriesClient.ListUsages method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListUsages.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().ListUsages(ctx, "myResourceGroup", "myRegistry", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegistryUsageListResult = armcontainerregistry.RegistryUsageListResult{
	// 	Value: []*armcontainerregistry.RegistryUsage{
	// 		{
	// 			Name: to.Ptr("Size"),
	// 			CurrentValue: to.Ptr[int64](12345678),
	// 			Limit: to.Ptr[int64](107374182400),
	// 			Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitBytes),
	// 		},
	// 		{
	// 			Name: to.Ptr("Webhooks"),
	// 			CurrentValue: to.Ptr[int64](2),
	// 			Limit: to.Ptr[int64](10),
	// 			Unit: to.Ptr(armcontainerregistry.RegistryUsageUnitCount),
	// 	}},
	// }
}
Output:

func (*RegistriesClient) NewListByResourceGroupPager added in v0.5.0

func (client *RegistriesClient) NewListByResourceGroupPager(resourceGroupName string, options *RegistriesClientListByResourceGroupOptions) *runtime.Pager[RegistriesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists all the container registries under the specified resource group.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - RegistriesClientListByResourceGroupOptions contains the optional parameters for the RegistriesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegistriesClient().NewListByResourceGroupPager("myResourceGroup", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RegistryListResult = armcontainerregistry.RegistryListResult{
		// 	Value: []*armcontainerregistry.Registry{
		// 		{
		// 			Name: to.Ptr("myRegistry"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"key": to.Ptr("value"),
		// 			},
		// 			Properties: &armcontainerregistry.RegistryProperties{
		// 				AdminUserEnabled: to.Ptr(false),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
		// 				DataEndpointEnabled: to.Ptr(false),
		// 				DataEndpointHostNames: []*string{
		// 				},
		// 				Encryption: &armcontainerregistry.EncryptionProperty{
		// 					Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
		// 				},
		// 				LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
		// 				NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
		// 				NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
		// 					DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
		// 					IPRules: []*armcontainerregistry.IPRule{
		// 					},
		// 				},
		// 				Policies: &armcontainerregistry.Policies{
		// 					ExportPolicy: &armcontainerregistry.ExportPolicy{
		// 						Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
		// 					},
		// 					QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 					RetentionPolicy: &armcontainerregistry.RetentionPolicy{
		// 						Days: to.Ptr[int32](7),
		// 						LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 					TrustPolicy: &armcontainerregistry.TrustPolicy{
		// 						Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 				},
		// 				PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
		// 				},
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
		// 				ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
		// 			},
		// 			SKU: &armcontainerregistry.SKU{
		// 				Name: to.Ptr(armcontainerregistry.SKUNameStandard),
		// 				Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*RegistriesClient) NewListPager added in v0.5.0

NewListPager - Lists all the container registries under the specified subscription.

Generated from API version 2023-07-01

  • options - RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegistriesClient().NewListPager(nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RegistryListResult = armcontainerregistry.RegistryListResult{
		// 	Value: []*armcontainerregistry.Registry{
		// 		{
		// 			Name: to.Ptr("myRegistry"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"key": to.Ptr("value"),
		// 			},
		// 			Properties: &armcontainerregistry.RegistryProperties{
		// 				AdminUserEnabled: to.Ptr(false),
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:38:26.153Z"); return t}()),
		// 				DataEndpointEnabled: to.Ptr(false),
		// 				DataEndpointHostNames: []*string{
		// 				},
		// 				Encryption: &armcontainerregistry.EncryptionProperty{
		// 					Status: to.Ptr(armcontainerregistry.EncryptionStatusDisabled),
		// 				},
		// 				LoginServer: to.Ptr("myRegistry.azurecr-test.io"),
		// 				NetworkRuleBypassOptions: to.Ptr(armcontainerregistry.NetworkRuleBypassOptionsAzureServices),
		// 				NetworkRuleSet: &armcontainerregistry.NetworkRuleSet{
		// 					DefaultAction: to.Ptr(armcontainerregistry.DefaultActionAllow),
		// 					IPRules: []*armcontainerregistry.IPRule{
		// 					},
		// 				},
		// 				Policies: &armcontainerregistry.Policies{
		// 					ExportPolicy: &armcontainerregistry.ExportPolicy{
		// 						Status: to.Ptr(armcontainerregistry.ExportPolicyStatusEnabled),
		// 					},
		// 					QuarantinePolicy: &armcontainerregistry.QuarantinePolicy{
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 					RetentionPolicy: &armcontainerregistry.RetentionPolicy{
		// 						Days: to.Ptr[int32](7),
		// 						LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-15T21:40:12.850Z"); return t}()),
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 					TrustPolicy: &armcontainerregistry.TrustPolicy{
		// 						Type: to.Ptr(armcontainerregistry.TrustPolicyTypeNotary),
		// 						Status: to.Ptr(armcontainerregistry.PolicyStatusDisabled),
		// 					},
		// 				},
		// 				PrivateEndpointConnections: []*armcontainerregistry.PrivateEndpointConnection{
		// 				},
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				PublicNetworkAccess: to.Ptr(armcontainerregistry.PublicNetworkAccessEnabled),
		// 				ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
		// 			},
		// 			SKU: &armcontainerregistry.SKU{
		// 				Name: to.Ptr(armcontainerregistry.SKUNameStandard),
		// 				Tier: to.Ptr(armcontainerregistry.SKUTierStandard),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*RegistriesClient) NewListPrivateLinkResourcesPager added in v0.5.0

func (client *RegistriesClient) NewListPrivateLinkResourcesPager(resourceGroupName string, registryName string, options *RegistriesClientListPrivateLinkResourcesOptions) *runtime.Pager[RegistriesClientListPrivateLinkResourcesResponse]

NewListPrivateLinkResourcesPager - Lists the private link resources for a container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - RegistriesClientListPrivateLinkResourcesOptions contains the optional parameters for the RegistriesClient.NewListPrivateLinkResourcesPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryListPrivateLinkResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRegistriesClient().NewListPrivateLinkResourcesPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.PrivateLinkResourceListResult = armcontainerregistry.PrivateLinkResourceListResult{
		// 	Value: []*armcontainerregistry.PrivateLinkResource{
		// 		{
		// 			Name: to.Ptr("registry"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/privateLinkResources"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/privateLinkResources/registry"),
		// 			Properties: &armcontainerregistry.PrivateLinkResourceProperties{
		// 				GroupID: to.Ptr("registry"),
		// 				RequiredMembers: []*string{
		// 					to.Ptr("registry"),
		// 					to.Ptr("registry_data_myregion")},
		// 					RequiredZoneNames: []*string{
		// 						to.Ptr("privatelink.azurecr.io")},
		// 					},
		// 			}},
		// 		}
	}
}
Output:

func (*RegistriesClient) RegenerateCredential

func (client *RegistriesClient) RegenerateCredential(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters, options *RegistriesClientRegenerateCredentialOptions) (RegistriesClientRegenerateCredentialResponse, error)

RegenerateCredential - Regenerates one of the login credentials for the specified container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • regenerateCredentialParameters - Specifies name of the password which should be regenerated -- password or password2.
  • options - RegistriesClientRegenerateCredentialOptions contains the optional parameters for the RegistriesClient.RegenerateCredential method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/RegistryRegenerateCredential.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRegistriesClient().RegenerateCredential(ctx, "myResourceGroup", "myRegistry", armcontainerregistry.RegenerateCredentialParameters{
		Name: to.Ptr(armcontainerregistry.PasswordNamePassword),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{
	// 	Passwords: []*armcontainerregistry.RegistryPassword{
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.PasswordNamePassword),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 		},
	// 		{
	// 			Name: to.Ptr(armcontainerregistry.PasswordNamePassword2),
	// 			Value: to.Ptr("00000000000000000000000000000000"),
	// 	}},
	// 	Username: to.Ptr("myRegistry"),
	// }
}
Output:

type RegistriesClientBeginCreateOptions added in v0.3.0

type RegistriesClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginCreateOptions contains the optional parameters for the RegistriesClient.BeginCreate method.

type RegistriesClientBeginDeleteOptions added in v0.3.0

type RegistriesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginDeleteOptions contains the optional parameters for the RegistriesClient.BeginDelete method.

type RegistriesClientBeginGenerateCredentialsOptions added in v0.4.0

type RegistriesClientBeginGenerateCredentialsOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginGenerateCredentialsOptions contains the optional parameters for the RegistriesClient.BeginGenerateCredentials method.

type RegistriesClientBeginImportImageOptions added in v0.3.0

type RegistriesClientBeginImportImageOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginImportImageOptions contains the optional parameters for the RegistriesClient.BeginImportImage method.

type RegistriesClientBeginScheduleRunOptions added in v0.3.0

type RegistriesClientBeginScheduleRunOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginScheduleRunOptions contains the optional parameters for the RegistriesClient.BeginScheduleRun method.

type RegistriesClientBeginUpdateOptions added in v0.3.0

type RegistriesClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RegistriesClientBeginUpdateOptions contains the optional parameters for the RegistriesClient.BeginUpdate method.

type RegistriesClientCheckNameAvailabilityOptions added in v0.3.0

type RegistriesClientCheckNameAvailabilityOptions struct {
}

RegistriesClientCheckNameAvailabilityOptions contains the optional parameters for the RegistriesClient.CheckNameAvailability method.

type RegistriesClientCheckNameAvailabilityResponse added in v0.3.0

type RegistriesClientCheckNameAvailabilityResponse struct {
	// The result of a request to check the availability of a container registry name.
	RegistryNameStatus
}

RegistriesClientCheckNameAvailabilityResponse contains the response from method RegistriesClient.CheckNameAvailability.

type RegistriesClientCreateResponse added in v0.3.0

type RegistriesClientCreateResponse struct {
	// An object that represents a container registry.
	Registry
}

RegistriesClientCreateResponse contains the response from method RegistriesClient.BeginCreate.

type RegistriesClientDeleteResponse added in v0.3.0

type RegistriesClientDeleteResponse struct {
}

RegistriesClientDeleteResponse contains the response from method RegistriesClient.BeginDelete.

type RegistriesClientGenerateCredentialsResponse added in v0.4.0

type RegistriesClientGenerateCredentialsResponse struct {
	// The response from the GenerateCredentials operation.
	GenerateCredentialsResult
}

RegistriesClientGenerateCredentialsResponse contains the response from method RegistriesClient.BeginGenerateCredentials.

type RegistriesClientGetBuildSourceUploadURLOptions added in v0.3.0

type RegistriesClientGetBuildSourceUploadURLOptions struct {
}

RegistriesClientGetBuildSourceUploadURLOptions contains the optional parameters for the RegistriesClient.GetBuildSourceUploadURL method.

type RegistriesClientGetBuildSourceUploadURLResponse added in v0.3.0

type RegistriesClientGetBuildSourceUploadURLResponse struct {
	// The properties of a response to source upload request.
	SourceUploadDefinition
}

RegistriesClientGetBuildSourceUploadURLResponse contains the response from method RegistriesClient.GetBuildSourceUploadURL.

type RegistriesClientGetOptions added in v0.3.0

type RegistriesClientGetOptions struct {
}

RegistriesClientGetOptions contains the optional parameters for the RegistriesClient.Get method.

type RegistriesClientGetPrivateLinkResourceOptions added in v0.3.0

type RegistriesClientGetPrivateLinkResourceOptions struct {
}

RegistriesClientGetPrivateLinkResourceOptions contains the optional parameters for the RegistriesClient.GetPrivateLinkResource method.

type RegistriesClientGetPrivateLinkResourceResponse added in v0.3.0

type RegistriesClientGetPrivateLinkResourceResponse struct {
	// A resource that supports private link capabilities.
	PrivateLinkResource
}

RegistriesClientGetPrivateLinkResourceResponse contains the response from method RegistriesClient.GetPrivateLinkResource.

type RegistriesClientGetResponse added in v0.3.0

type RegistriesClientGetResponse struct {
	// An object that represents a container registry.
	Registry
}

RegistriesClientGetResponse contains the response from method RegistriesClient.Get.

type RegistriesClientImportImageResponse added in v0.3.0

type RegistriesClientImportImageResponse struct {
}

RegistriesClientImportImageResponse contains the response from method RegistriesClient.BeginImportImage.

type RegistriesClientListByResourceGroupOptions added in v0.3.0

type RegistriesClientListByResourceGroupOptions struct {
}

RegistriesClientListByResourceGroupOptions contains the optional parameters for the RegistriesClient.NewListByResourceGroupPager method.

type RegistriesClientListByResourceGroupResponse added in v0.3.0

type RegistriesClientListByResourceGroupResponse struct {
	// The result of a request to list container registries.
	RegistryListResult
}

RegistriesClientListByResourceGroupResponse contains the response from method RegistriesClient.NewListByResourceGroupPager.

type RegistriesClientListCredentialsOptions added in v0.3.0

type RegistriesClientListCredentialsOptions struct {
}

RegistriesClientListCredentialsOptions contains the optional parameters for the RegistriesClient.ListCredentials method.

type RegistriesClientListCredentialsResponse added in v0.3.0

type RegistriesClientListCredentialsResponse struct {
	// The response from the ListCredentials operation.
	RegistryListCredentialsResult
}

RegistriesClientListCredentialsResponse contains the response from method RegistriesClient.ListCredentials.

type RegistriesClientListOptions added in v0.3.0

type RegistriesClientListOptions struct {
}

RegistriesClientListOptions contains the optional parameters for the RegistriesClient.NewListPager method.

type RegistriesClientListPrivateLinkResourcesOptions added in v0.3.0

type RegistriesClientListPrivateLinkResourcesOptions struct {
}

RegistriesClientListPrivateLinkResourcesOptions contains the optional parameters for the RegistriesClient.NewListPrivateLinkResourcesPager method.

type RegistriesClientListPrivateLinkResourcesResponse added in v0.3.0

type RegistriesClientListPrivateLinkResourcesResponse struct {
	// The result of a request to list private link resources for a container registry.
	PrivateLinkResourceListResult
}

RegistriesClientListPrivateLinkResourcesResponse contains the response from method RegistriesClient.NewListPrivateLinkResourcesPager.

type RegistriesClientListResponse added in v0.3.0

type RegistriesClientListResponse struct {
	// The result of a request to list container registries.
	RegistryListResult
}

RegistriesClientListResponse contains the response from method RegistriesClient.NewListPager.

type RegistriesClientListUsagesOptions added in v0.3.0

type RegistriesClientListUsagesOptions struct {
}

RegistriesClientListUsagesOptions contains the optional parameters for the RegistriesClient.ListUsages method.

type RegistriesClientListUsagesResponse added in v0.3.0

type RegistriesClientListUsagesResponse struct {
	// The result of a request to get container registry quota usages.
	RegistryUsageListResult
}

RegistriesClientListUsagesResponse contains the response from method RegistriesClient.ListUsages.

type RegistriesClientRegenerateCredentialOptions added in v0.3.0

type RegistriesClientRegenerateCredentialOptions struct {
}

RegistriesClientRegenerateCredentialOptions contains the optional parameters for the RegistriesClient.RegenerateCredential method.

type RegistriesClientRegenerateCredentialResponse added in v0.3.0

type RegistriesClientRegenerateCredentialResponse struct {
	// The response from the ListCredentials operation.
	RegistryListCredentialsResult
}

RegistriesClientRegenerateCredentialResponse contains the response from method RegistriesClient.RegenerateCredential.

type RegistriesClientScheduleRunResponse added in v0.3.0

type RegistriesClientScheduleRunResponse struct {
	// Run resource properties
	Run
}

RegistriesClientScheduleRunResponse contains the response from method RegistriesClient.BeginScheduleRun.

type RegistriesClientUpdateResponse added in v0.3.0

type RegistriesClientUpdateResponse struct {
	// An object that represents a container registry.
	Registry
}

RegistriesClientUpdateResponse contains the response from method RegistriesClient.BeginUpdate.

type Registry

type Registry struct {
	// REQUIRED; The location of the resource. This cannot be changed after the resource is created.
	Location *string

	// REQUIRED; The SKU of the container registry.
	SKU *SKU

	// The identity of the container registry.
	Identity *IdentityProperties

	// The properties of the container registry.
	Properties *RegistryProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Registry - An object that represents a container registry.

func (Registry) MarshalJSON

func (r Registry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Registry.

func (*Registry) UnmarshalJSON added in v0.7.0

func (r *Registry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Registry.

type RegistryListCredentialsResult

type RegistryListCredentialsResult struct {
	// The list of passwords for a container registry.
	Passwords []*RegistryPassword

	// The username for a container registry.
	Username *string
}

RegistryListCredentialsResult - The response from the ListCredentials operation.

func (RegistryListCredentialsResult) MarshalJSON

func (r RegistryListCredentialsResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryListCredentialsResult.

func (*RegistryListCredentialsResult) UnmarshalJSON added in v0.7.0

func (r *RegistryListCredentialsResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListCredentialsResult.

type RegistryListResult

type RegistryListResult struct {
	// The URI that can be used to request the next list of container registries.
	NextLink *string

	// The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next
	// list of container registries.
	Value []*Registry
}

RegistryListResult - The result of a request to list container registries.

func (RegistryListResult) MarshalJSON

func (r RegistryListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryListResult.

func (*RegistryListResult) UnmarshalJSON added in v0.7.0

func (r *RegistryListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryListResult.

type RegistryNameCheckRequest

type RegistryNameCheckRequest struct {
	// REQUIRED; The name of the container registry.
	Name *string

	// CONSTANT; The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'.
	// Field has constant value "Microsoft.ContainerRegistry/registries", any specified value is ignored.
	Type *string
}

RegistryNameCheckRequest - A request to check whether a container registry name is available.

func (RegistryNameCheckRequest) MarshalJSON added in v0.7.0

func (r RegistryNameCheckRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryNameCheckRequest.

func (*RegistryNameCheckRequest) UnmarshalJSON added in v0.7.0

func (r *RegistryNameCheckRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameCheckRequest.

type RegistryNameStatus

type RegistryNameStatus struct {
	// If any, the error message that provides more detail for the reason that the name is not available.
	Message *string

	// The value that indicates whether the name is available.
	NameAvailable *bool

	// If any, the reason that the name is not available.
	Reason *string
}

RegistryNameStatus - The result of a request to check the availability of a container registry name.

func (RegistryNameStatus) MarshalJSON added in v0.7.0

func (r RegistryNameStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryNameStatus.

func (*RegistryNameStatus) UnmarshalJSON added in v0.7.0

func (r *RegistryNameStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryNameStatus.

type RegistryPassword

type RegistryPassword struct {
	// The password name.
	Name *PasswordName

	// The password value.
	Value *string
}

RegistryPassword - The login password for the container registry.

func (RegistryPassword) MarshalJSON added in v0.7.0

func (r RegistryPassword) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryPassword.

func (*RegistryPassword) UnmarshalJSON added in v0.7.0

func (r *RegistryPassword) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPassword.

type RegistryProperties

type RegistryProperties struct {
	// The value that indicates whether the admin user is enabled.
	AdminUserEnabled *bool

	// Enable a single data endpoint per region for serving data.
	DataEndpointEnabled *bool

	// The encryption settings of container registry.
	Encryption *EncryptionProperty

	// Whether to allow trusted Azure services to access a network restricted registry.
	NetworkRuleBypassOptions *NetworkRuleBypassOptions

	// The network rule set for a container registry.
	NetworkRuleSet *NetworkRuleSet

	// The policies for a container registry.
	Policies *Policies

	// Whether or not public network access is allowed for the container registry.
	PublicNetworkAccess *PublicNetworkAccess

	// Whether or not zone redundancy is enabled for this container registry
	ZoneRedundancy *ZoneRedundancy

	// READ-ONLY; The creation date of the container registry in ISO8601 format.
	CreationDate *time.Time

	// READ-ONLY; List of host names that will serve data when dataEndpointEnabled is true.
	DataEndpointHostNames []*string

	// READ-ONLY; The URL that can be used to log into the container registry.
	LoginServer *string

	// READ-ONLY; List of private endpoint connections for a container registry.
	PrivateEndpointConnections []*PrivateEndpointConnection

	// READ-ONLY; The provisioning state of the container registry at the time the operation was called.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The status of the container registry at the time the operation was called.
	Status *Status
}

RegistryProperties - The properties of a container registry.

func (RegistryProperties) MarshalJSON

func (r RegistryProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryProperties.

func (*RegistryProperties) UnmarshalJSON

func (r *RegistryProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryProperties.

type RegistryPropertiesUpdateParameters

type RegistryPropertiesUpdateParameters struct {
	// The value that indicates whether the admin user is enabled.
	AdminUserEnabled *bool

	// Enable a single data endpoint per region for serving data.
	DataEndpointEnabled *bool

	// The encryption settings of container registry.
	Encryption *EncryptionProperty

	// Whether to allow trusted Azure services to access a network restricted registry.
	NetworkRuleBypassOptions *NetworkRuleBypassOptions

	// The network rule set for a container registry.
	NetworkRuleSet *NetworkRuleSet

	// The policies for a container registry.
	Policies *Policies

	// Whether or not public network access is allowed for the container registry.
	PublicNetworkAccess *PublicNetworkAccess
}

RegistryPropertiesUpdateParameters - The parameters for updating the properties of a container registry.

func (RegistryPropertiesUpdateParameters) MarshalJSON added in v0.7.0

func (r RegistryPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryPropertiesUpdateParameters.

func (*RegistryPropertiesUpdateParameters) UnmarshalJSON added in v0.7.0

func (r *RegistryPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryPropertiesUpdateParameters.

type RegistryUpdateParameters

type RegistryUpdateParameters struct {
	// The identity of the container registry.
	Identity *IdentityProperties

	// The properties that the container registry will be updated with.
	Properties *RegistryPropertiesUpdateParameters

	// The SKU of the container registry.
	SKU *SKU

	// The tags for the container registry.
	Tags map[string]*string
}

RegistryUpdateParameters - The parameters for updating a container registry.

func (RegistryUpdateParameters) MarshalJSON

func (r RegistryUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryUpdateParameters.

func (*RegistryUpdateParameters) UnmarshalJSON added in v0.7.0

func (r *RegistryUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUpdateParameters.

type RegistryUsage

type RegistryUsage struct {
	// The current value of the usage.
	CurrentValue *int64

	// The limit of the usage.
	Limit *int64

	// The name of the usage.
	Name *string

	// The unit of measurement.
	Unit *RegistryUsageUnit
}

RegistryUsage - The quota usage for a container registry.

func (RegistryUsage) MarshalJSON added in v0.7.0

func (r RegistryUsage) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryUsage.

func (*RegistryUsage) UnmarshalJSON added in v0.7.0

func (r *RegistryUsage) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsage.

type RegistryUsageListResult

type RegistryUsageListResult struct {
	// The list of container registry quota usages.
	Value []*RegistryUsage
}

RegistryUsageListResult - The result of a request to get container registry quota usages.

func (RegistryUsageListResult) MarshalJSON

func (r RegistryUsageListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RegistryUsageListResult.

func (*RegistryUsageListResult) UnmarshalJSON added in v0.7.0

func (r *RegistryUsageListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RegistryUsageListResult.

type RegistryUsageUnit

type RegistryUsageUnit string

RegistryUsageUnit - The unit of measurement.

const (
	RegistryUsageUnitBytes RegistryUsageUnit = "Bytes"
	RegistryUsageUnitCount RegistryUsageUnit = "Count"
)

func PossibleRegistryUsageUnitValues

func PossibleRegistryUsageUnitValues() []RegistryUsageUnit

PossibleRegistryUsageUnitValues returns the possible values for the RegistryUsageUnit const type.

type Replication

type Replication struct {
	// REQUIRED; The location of the resource. This cannot be changed after the resource is created.
	Location *string

	// The properties of the replication.
	Properties *ReplicationProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Replication - An object that represents a replication for a container registry.

func (Replication) MarshalJSON

func (r Replication) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Replication.

func (*Replication) UnmarshalJSON added in v0.7.0

func (r *Replication) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Replication.

type ReplicationListResult

type ReplicationListResult struct {
	// The URI that can be used to request the next list of replications.
	NextLink *string

	// The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list
	// of replications.
	Value []*Replication
}

ReplicationListResult - The result of a request to list replications for a container registry.

func (ReplicationListResult) MarshalJSON

func (r ReplicationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReplicationListResult.

func (*ReplicationListResult) UnmarshalJSON added in v0.7.0

func (r *ReplicationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationListResult.

type ReplicationProperties

type ReplicationProperties struct {
	// Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional
	// endpoint is disabled, however its data will continue to be synced with
	// other replications.
	RegionEndpointEnabled *bool

	// Whether or not zone redundancy is enabled for this container registry replication
	ZoneRedundancy *ZoneRedundancy

	// READ-ONLY; The provisioning state of the replication at the time the operation was called.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The status of the replication at the time the operation was called.
	Status *Status
}

ReplicationProperties - The properties of a replication.

func (ReplicationProperties) MarshalJSON added in v0.7.0

func (r ReplicationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReplicationProperties.

func (*ReplicationProperties) UnmarshalJSON added in v0.7.0

func (r *ReplicationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationProperties.

type ReplicationUpdateParameters

type ReplicationUpdateParameters struct {
	// The parameters for updating a replication's properties
	Properties *ReplicationUpdateParametersProperties

	// The tags for the replication.
	Tags map[string]*string
}

ReplicationUpdateParameters - The parameters for updating a replication.

func (ReplicationUpdateParameters) MarshalJSON

func (r ReplicationUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParameters.

func (*ReplicationUpdateParameters) UnmarshalJSON added in v0.7.0

func (r *ReplicationUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParameters.

type ReplicationUpdateParametersProperties

type ReplicationUpdateParametersProperties struct {
	// Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional
	// endpoint is disabled, however its data will continue to be synced with
	// other replications.
	RegionEndpointEnabled *bool
}

func (ReplicationUpdateParametersProperties) MarshalJSON added in v0.7.0

func (r ReplicationUpdateParametersProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ReplicationUpdateParametersProperties.

func (*ReplicationUpdateParametersProperties) UnmarshalJSON added in v0.7.0

func (r *ReplicationUpdateParametersProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationUpdateParametersProperties.

type ReplicationsClient

type ReplicationsClient struct {
	// contains filtered or unexported fields
}

ReplicationsClient contains the methods for the Replications group. Don't use this type directly, use NewReplicationsClient() instead.

func NewReplicationsClient

func NewReplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicationsClient, error)

NewReplicationsClient creates a new instance of ReplicationsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ReplicationsClient) BeginCreate

func (client *ReplicationsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication, options *ReplicationsClientBeginCreateOptions) (*runtime.Poller[ReplicationsClientCreateResponse], error)

BeginCreate - Creates a replication for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • replicationName - The name of the replication.
  • replication - The parameters for creating a replication.
  • options - ReplicationsClientBeginCreateOptions contains the optional parameters for the ReplicationsClient.BeginCreate method.
Example (ReplicationCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Replication = armcontainerregistry.Replication{
	// 	Name: to.Ptr("myReplication"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.ReplicationProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RegionEndpointEnabled: to.Ptr(true),
	// 		Status: &armcontainerregistry.Status{
	// 			DisplayStatus: to.Ptr("Ready"),
	// 			Message: to.Ptr("The replication is ready."),
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()),
	// 		},
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// }
}
Output:

Example (ReplicationCreateZoneRedundant)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationCreateZoneRedundant.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.Replication{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
		Properties: &armcontainerregistry.ReplicationProperties{
			RegionEndpointEnabled: to.Ptr(true),
			ZoneRedundancy:        to.Ptr(armcontainerregistry.ZoneRedundancyEnabled),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Replication = armcontainerregistry.Replication{
	// 	Name: to.Ptr("myReplication"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.ReplicationProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RegionEndpointEnabled: to.Ptr(true),
	// 		Status: &armcontainerregistry.Status{
	// 			DisplayStatus: to.Ptr("Ready"),
	// 			Message: to.Ptr("The replication is ready."),
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()),
	// 		},
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyEnabled),
	// 	},
	// }
}
Output:

func (*ReplicationsClient) BeginDelete

func (client *ReplicationsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, replicationName string, options *ReplicationsClientBeginDeleteOptions) (*runtime.Poller[ReplicationsClientDeleteResponse], error)

BeginDelete - Deletes a replication from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • replicationName - The name of the replication.
  • options - ReplicationsClientBeginDeleteOptions contains the optional parameters for the ReplicationsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myReplication", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ReplicationsClient) BeginUpdate

func (client *ReplicationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters, options *ReplicationsClientBeginUpdateOptions) (*runtime.Poller[ReplicationsClientUpdateResponse], error)

BeginUpdate - Updates a replication for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • replicationName - The name of the replication.
  • replicationUpdateParameters - The parameters for updating a replication.
  • options - ReplicationsClientBeginUpdateOptions contains the optional parameters for the ReplicationsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewReplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myReplication", armcontainerregistry.ReplicationUpdateParameters{
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Replication = armcontainerregistry.Replication{
	// 	Name: to.Ptr("myReplication"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.ReplicationProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RegionEndpointEnabled: to.Ptr(true),
	// 		Status: &armcontainerregistry.Status{
	// 			DisplayStatus: to.Ptr("Ready"),
	// 			Message: to.Ptr("The replication is ready."),
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()),
	// 		},
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// }
}
Output:

func (*ReplicationsClient) Get

func (client *ReplicationsClient) Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string, options *ReplicationsClientGetOptions) (ReplicationsClientGetResponse, error)

Get - Gets the properties of the specified replication. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • replicationName - The name of the replication.
  • options - ReplicationsClientGetOptions contains the optional parameters for the ReplicationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewReplicationsClient().Get(ctx, "myResourceGroup", "myRegistry", "myReplication", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Replication = armcontainerregistry.Replication{
	// 	Name: to.Ptr("myReplication"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.ReplicationProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RegionEndpointEnabled: to.Ptr(true),
	// 		Status: &armcontainerregistry.Status{
	// 			DisplayStatus: to.Ptr("Ready"),
	// 			Message: to.Ptr("The replication is ready."),
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()),
	// 		},
	// 		ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
	// 	},
	// }
}
Output:

func (*ReplicationsClient) NewListPager added in v0.5.0

func (client *ReplicationsClient) NewListPager(resourceGroupName string, registryName string, options *ReplicationsClientListOptions) *runtime.Pager[ReplicationsClientListResponse]

NewListPager - Lists all the replications for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - ReplicationsClientListOptions contains the optional parameters for the ReplicationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ReplicationList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewReplicationsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ReplicationListResult = armcontainerregistry.ReplicationListResult{
		// 	Value: []*armcontainerregistry.Replication{
		// 		{
		// 			Name: to.Ptr("myReplication"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/replications"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/replications/myReplication"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"key": to.Ptr("value"),
		// 			},
		// 			Properties: &armcontainerregistry.ReplicationProperties{
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				RegionEndpointEnabled: to.Ptr(true),
		// 				Status: &armcontainerregistry.Status{
		// 					DisplayStatus: to.Ptr("Ready"),
		// 					Message: to.Ptr("The replication is ready."),
		// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:15:37.070Z"); return t}()),
		// 				},
		// 				ZoneRedundancy: to.Ptr(armcontainerregistry.ZoneRedundancyDisabled),
		// 			},
		// 	}},
		// }
	}
}
Output:

type ReplicationsClientBeginCreateOptions added in v0.3.0

type ReplicationsClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ReplicationsClientBeginCreateOptions contains the optional parameters for the ReplicationsClient.BeginCreate method.

type ReplicationsClientBeginDeleteOptions added in v0.3.0

type ReplicationsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ReplicationsClientBeginDeleteOptions contains the optional parameters for the ReplicationsClient.BeginDelete method.

type ReplicationsClientBeginUpdateOptions added in v0.3.0

type ReplicationsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ReplicationsClientBeginUpdateOptions contains the optional parameters for the ReplicationsClient.BeginUpdate method.

type ReplicationsClientCreateResponse added in v0.3.0

type ReplicationsClientCreateResponse struct {
	// An object that represents a replication for a container registry.
	Replication
}

ReplicationsClientCreateResponse contains the response from method ReplicationsClient.BeginCreate.

type ReplicationsClientDeleteResponse added in v0.3.0

type ReplicationsClientDeleteResponse struct {
}

ReplicationsClientDeleteResponse contains the response from method ReplicationsClient.BeginDelete.

type ReplicationsClientGetOptions added in v0.3.0

type ReplicationsClientGetOptions struct {
}

ReplicationsClientGetOptions contains the optional parameters for the ReplicationsClient.Get method.

type ReplicationsClientGetResponse added in v0.3.0

type ReplicationsClientGetResponse struct {
	// An object that represents a replication for a container registry.
	Replication
}

ReplicationsClientGetResponse contains the response from method ReplicationsClient.Get.

type ReplicationsClientListOptions added in v0.3.0

type ReplicationsClientListOptions struct {
}

ReplicationsClientListOptions contains the optional parameters for the ReplicationsClient.NewListPager method.

type ReplicationsClientListResponse added in v0.3.0

type ReplicationsClientListResponse struct {
	// The result of a request to list replications for a container registry.
	ReplicationListResult
}

ReplicationsClientListResponse contains the response from method ReplicationsClient.NewListPager.

type ReplicationsClientUpdateResponse added in v0.3.0

type ReplicationsClientUpdateResponse struct {
	// An object that represents a replication for a container registry.
	Replication
}

ReplicationsClientUpdateResponse contains the response from method ReplicationsClient.BeginUpdate.

type Request

type Request struct {
	// The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the
	// standard http request.
	Addr *string

	// The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests.
	Host *string

	// The ID of the request that initiated the event.
	ID *string

	// The request method that generated the event.
	Method *string

	// The user agent header of the request.
	Useragent *string
}

Request - The request that generated the event.

func (Request) MarshalJSON added in v0.7.0

func (r Request) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Request.

func (*Request) UnmarshalJSON added in v0.7.0

func (r *Request) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Request.

type ResourceIdentityType

type ResourceIdentityType string

ResourceIdentityType - The identity type.

const (
	ResourceIdentityTypeNone                       ResourceIdentityType = "None"
	ResourceIdentityTypeSystemAssigned             ResourceIdentityType = "SystemAssigned"
	ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned"
	ResourceIdentityTypeUserAssigned               ResourceIdentityType = "UserAssigned"
)

func PossibleResourceIdentityTypeValues

func PossibleResourceIdentityTypeValues() []ResourceIdentityType

PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.

type RetentionPolicy

type RetentionPolicy struct {
	// The number of days to retain an untagged manifest after which it gets purged.
	Days *int32

	// The value that indicates whether the policy is enabled or not.
	Status *PolicyStatus

	// READ-ONLY; The timestamp when the policy was last updated.
	LastUpdatedTime *time.Time
}

RetentionPolicy - The retention policy for a container registry.

func (RetentionPolicy) MarshalJSON

func (r RetentionPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RetentionPolicy.

func (*RetentionPolicy) UnmarshalJSON

func (r *RetentionPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy.

type Run

type Run struct {
	// The properties of a run.
	Properties *RunProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Run resource properties

func (Run) MarshalJSON added in v0.7.0

func (r Run) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Run.

func (*Run) UnmarshalJSON added in v0.7.0

func (r *Run) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Run.

type RunFilter

type RunFilter struct {
	// The name of the agent pool that the run corresponds to.
	AgentPoolName *string

	// The create time for a run.
	CreateTime *time.Time

	// The time the run finished.
	FinishTime *time.Time

	// The value that indicates whether archiving is enabled or not.
	IsArchiveEnabled *bool

	// The list of comma-separated image manifests that were generated from the run. This is applicable if the run is of build
	// type.
	OutputImageManifests *string

	// The unique identifier for the run.
	RunID *string

	// The type of run.
	RunType *RunType

	// The current status of the run.
	Status *RunStatus

	// The name of the task that the run corresponds to.
	TaskName *string
}

RunFilter - Properties that are enabled for Odata querying on runs.

func (RunFilter) MarshalJSON

func (r RunFilter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunFilter.

func (*RunFilter) UnmarshalJSON

func (r *RunFilter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunFilter.

type RunGetLogResult

type RunGetLogResult struct {
	// The link to logs in registry for a run on a azure container registry.
	LogArtifactLink *string

	// The link to logs for a run on a azure container registry.
	LogLink *string
}

RunGetLogResult - The result of get log link operation.

func (RunGetLogResult) MarshalJSON added in v0.7.0

func (r RunGetLogResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunGetLogResult.

func (*RunGetLogResult) UnmarshalJSON added in v0.7.0

func (r *RunGetLogResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunGetLogResult.

type RunListResult

type RunListResult struct {
	// The URI that can be used to request the next set of paged results.
	NextLink *string

	// The collection value.
	Value []*Run
}

RunListResult - Collection of runs.

func (RunListResult) MarshalJSON

func (r RunListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunListResult.

func (*RunListResult) UnmarshalJSON added in v0.7.0

func (r *RunListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunListResult.

type RunProperties

type RunProperties struct {
	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The time the run was scheduled.
	CreateTime *time.Time

	// The list of custom registries that were logged in during this run.
	CustomRegistries []*string

	// The time the run finished.
	FinishTime *time.Time

	// The image update trigger that caused the run. This is applicable if the task has base image trigger configured.
	ImageUpdateTrigger *ImageUpdateTrigger

	// The value that indicates whether archiving is enabled or not.
	IsArchiveEnabled *bool

	// The last updated time for the run.
	LastUpdatedTime *time.Time

	// The list of all images that were generated from the run. This is applicable if the run generates base image dependencies.
	OutputImages []*ImageDescriptor

	// The platform properties against which the run will happen.
	Platform *PlatformProperties

	// The provisioning state of a run.
	ProvisioningState *ProvisioningState

	// The unique identifier for the run.
	RunID *string

	// The type of run.
	RunType *RunType

	// The scope of the credentials that were used to login to the source registry during this run.
	SourceRegistryAuth *string

	// The source trigger that caused the run.
	SourceTrigger *SourceTriggerDescriptor

	// The time the run started.
	StartTime *time.Time

	// The current status of the run.
	Status *RunStatus

	// The task against which run was scheduled.
	Task *string

	// The timer trigger that caused the run.
	TimerTrigger *TimerTriggerDescriptor

	// The update trigger token passed for the Run.
	UpdateTriggerToken *string

	// READ-ONLY; The image description for the log artifact.
	LogArtifact *ImageDescriptor

	// READ-ONLY; The error message received from backend systems after the run is scheduled.
	RunErrorMessage *string
}

RunProperties - The properties for a run.

func (RunProperties) MarshalJSON

func (r RunProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunProperties.

func (*RunProperties) UnmarshalJSON

func (r *RunProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunProperties.

type RunRequest

type RunRequest struct {
	// REQUIRED; The type of the run request.
	Type *string

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The value that indicates whether archiving is enabled for the run or not.
	IsArchiveEnabled *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string
}

RunRequest - The request parameters for scheduling a run.

func (*RunRequest) GetRunRequest

func (r *RunRequest) GetRunRequest() *RunRequest

GetRunRequest implements the RunRequestClassification interface for type RunRequest.

func (RunRequest) MarshalJSON added in v0.7.0

func (r RunRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunRequest.

func (*RunRequest) UnmarshalJSON

func (r *RunRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunRequest.

type RunRequestClassification

type RunRequestClassification interface {
	// GetRunRequest returns the RunRequest content of the underlying type.
	GetRunRequest() *RunRequest
}

RunRequestClassification provides polymorphic access to related types. Call the interface's GetRunRequest() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DockerBuildRequest, *EncodedTaskRunRequest, *FileTaskRunRequest, *RunRequest, *TaskRunRequest

type RunStatus

type RunStatus string

RunStatus - The current status of the run.

const (
	RunStatusCanceled  RunStatus = "Canceled"
	RunStatusError     RunStatus = "Error"
	RunStatusFailed    RunStatus = "Failed"
	RunStatusQueued    RunStatus = "Queued"
	RunStatusRunning   RunStatus = "Running"
	RunStatusStarted   RunStatus = "Started"
	RunStatusSucceeded RunStatus = "Succeeded"
	RunStatusTimeout   RunStatus = "Timeout"
)

func PossibleRunStatusValues

func PossibleRunStatusValues() []RunStatus

PossibleRunStatusValues returns the possible values for the RunStatus const type.

type RunType

type RunType string

RunType - The type of run.

const (
	RunTypeAutoBuild  RunType = "AutoBuild"
	RunTypeAutoRun    RunType = "AutoRun"
	RunTypeQuickBuild RunType = "QuickBuild"
	RunTypeQuickRun   RunType = "QuickRun"
)

func PossibleRunTypeValues

func PossibleRunTypeValues() []RunType

PossibleRunTypeValues returns the possible values for the RunType const type.

type RunUpdateParameters

type RunUpdateParameters struct {
	// The value that indicates whether archiving is enabled or not.
	IsArchiveEnabled *bool
}

RunUpdateParameters - The set of run properties that can be updated.

func (RunUpdateParameters) MarshalJSON

func (r RunUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type RunUpdateParameters.

func (*RunUpdateParameters) UnmarshalJSON added in v0.7.0

func (r *RunUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type RunUpdateParameters.

type RunsClient

type RunsClient struct {
	// contains filtered or unexported fields
}

RunsClient contains the methods for the Runs group. Don't use this type directly, use NewRunsClient() instead.

func NewRunsClient

func NewRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RunsClient, error)

NewRunsClient creates a new instance of RunsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*RunsClient) BeginCancel

func (client *RunsClient) BeginCancel(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientBeginCancelOptions) (*runtime.Poller[RunsClientCancelResponse], error)

BeginCancel - Cancel an existing run. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • runID - The run ID.
  • options - RunsClientBeginCancelOptions contains the optional parameters for the RunsClient.BeginCancel method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsCancel.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRunsClient().BeginCancel(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*RunsClient) BeginUpdate

func (client *RunsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters, options *RunsClientBeginUpdateOptions) (*runtime.Poller[RunsClientUpdateResponse], error)

BeginUpdate - Patch the run properties. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • runID - The run ID.
  • runUpdateParameters - The run update properties.
  • options - RunsClientBeginUpdateOptions contains the optional parameters for the RunsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewRunsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", armcontainerregistry.RunUpdateParameters{
		IsArchiveEnabled: to.Ptr(true),
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
	// 		FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()),
	// 		ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{
	// 			ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"),
	// 			Images: []*armcontainerregistry.ImageDescriptor{
	// 				{
	// 					Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 					Registry: to.Ptr("registry.hub.docker.com"),
	// 					Repository: to.Ptr("mybaseimage"),
	// 					Tag: to.Ptr("latest"),
	// 			}},
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
	// 		},
	// 		IsArchiveEnabled: to.Ptr(true),
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		LogArtifact: &armcontainerregistry.ImageDescriptor{
	// 			Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 			Registry: to.Ptr("myregistry"),
	// 			Repository: to.Ptr("acr/tasks"),
	// 			Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"),
	// 		},
	// 		OutputImages: []*armcontainerregistry.ImageDescriptor{
	// 			{
	// 				Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 				Registry: to.Ptr("myregistry.azurecr.io"),
	// 				Repository: to.Ptr("myimage"),
	// 				Tag: to.Ptr("latest"),
	// 		}},
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild),
	// 		StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 		Task: to.Ptr("myTask"),
	// 	},
	// }
}
Output:

func (*RunsClient) Get

func (client *RunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientGetOptions) (RunsClientGetResponse, error)

Get - Gets the detailed information for a given run. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • runID - The run ID.
  • options - RunsClientGetOptions contains the optional parameters for the RunsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRunsClient().Get(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Run = armcontainerregistry.Run{
	// 	Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 	Properties: &armcontainerregistry.RunProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
	// 		FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()),
	// 		ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{
	// 			ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"),
	// 			Images: []*armcontainerregistry.ImageDescriptor{
	// 				{
	// 					Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 					Registry: to.Ptr("registry.hub.docker.com"),
	// 					Repository: to.Ptr("mybaseimage"),
	// 					Tag: to.Ptr("latest"),
	// 			}},
	// 			Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
	// 		},
	// 		IsArchiveEnabled: to.Ptr(true),
	// 		LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
	// 		LogArtifact: &armcontainerregistry.ImageDescriptor{
	// 			Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 			Registry: to.Ptr("myregistry"),
	// 			Repository: to.Ptr("acr/tasks"),
	// 			Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"),
	// 		},
	// 		OutputImages: []*armcontainerregistry.ImageDescriptor{
	// 			{
	// 				Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
	// 				Registry: to.Ptr("myregistry.azurecr.io"),
	// 				Repository: to.Ptr("myimage"),
	// 				Tag: to.Ptr("latest"),
	// 		}},
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
	// 		RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild),
	// 		StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()),
	// 		Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 		Task: to.Ptr("myTask"),
	// 	},
	// }
}
Output:

func (*RunsClient) GetLogSasURL

func (client *RunsClient) GetLogSasURL(ctx context.Context, resourceGroupName string, registryName string, runID string, options *RunsClientGetLogSasURLOptions) (RunsClientGetLogSasURLResponse, error)

GetLogSasURL - Gets a link to download the run logs. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • runID - The run ID.
  • options - RunsClientGetLogSasURLOptions contains the optional parameters for the RunsClient.GetLogSasURL method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsGetLogSasUrl.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewRunsClient().GetLogSasURL(ctx, "myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.RunGetLogResult = armcontainerregistry.RunGetLogResult{
	// 	LogLink: to.Ptr("https://registrystorageaccount.blob.core.windows.net/sascontainer/logs/0accec26-d6de-4757-8e74-d080f38eaaab/rawtext.log?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"),
	// }
}
Output:

func (*RunsClient) NewListPager added in v0.5.0

func (client *RunsClient) NewListPager(resourceGroupName string, registryName string, options *RunsClientListOptions) *runtime.Pager[RunsClientListResponse]

NewListPager - Gets all the runs for a registry.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • options - RunsClientListOptions contains the optional parameters for the RunsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/RunsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewRunsClient().NewListPager("myResourceGroup", "myRegistry", &armcontainerregistry.RunsClientListOptions{Filter: to.Ptr(""),
		Top: to.Ptr[int32](10),
	})
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.RunListResult = armcontainerregistry.RunListResult{
		// 	Value: []*armcontainerregistry.Run{
		// 		{
		// 			Name: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
		// 			ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/0accec26-d6de-4757-8e74-d080f38eaaab"),
		// 			Properties: &armcontainerregistry.RunProperties{
		// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
		// 					CPU: to.Ptr[int32](2),
		// 				},
		// 				CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
		// 				FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:13:51.618Z"); return t}()),
		// 				ImageUpdateTrigger: &armcontainerregistry.ImageUpdateTrigger{
		// 					ID: to.Ptr("c0c43143-da5d-41ef-b9e1-e7d749272e88"),
		// 					Images: []*armcontainerregistry.ImageDescriptor{
		// 						{
		// 							Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
		// 							Registry: to.Ptr("registry.hub.docker.com"),
		// 							Repository: to.Ptr("mybaseimage"),
		// 							Tag: to.Ptr("latest"),
		// 					}},
		// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.618Z"); return t}()),
		// 				},
		// 				IsArchiveEnabled: to.Ptr(true),
		// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:13:51.617Z"); return t}()),
		// 				LogArtifact: &armcontainerregistry.ImageDescriptor{
		// 					Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
		// 					Registry: to.Ptr("myregistry"),
		// 					Repository: to.Ptr("acr/tasks"),
		// 					Tag: to.Ptr("mytask-0accec26-d6de-4757-8e74-d080f38eaaab-log"),
		// 				},
		// 				OutputImages: []*armcontainerregistry.ImageDescriptor{
		// 					{
		// 						Digest: to.Ptr("sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0"),
		// 						Registry: to.Ptr("myregistry.azurecr.io"),
		// 						Repository: to.Ptr("myimage"),
		// 						Tag: to.Ptr("latest"),
		// 				}},
		// 				Platform: &armcontainerregistry.PlatformProperties{
		// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
		// 					OS: to.Ptr(armcontainerregistry.OSLinux),
		// 				},
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				RunID: to.Ptr("0accec26-d6de-4757-8e74-d080f38eaaab"),
		// 				RunType: to.Ptr(armcontainerregistry.RunTypeAutoBuild),
		// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T05:50:51.618Z"); return t}()),
		// 				Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
		// 				Task: to.Ptr("myTask"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type RunsClientBeginCancelOptions added in v0.3.0

type RunsClientBeginCancelOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RunsClientBeginCancelOptions contains the optional parameters for the RunsClient.BeginCancel method.

type RunsClientBeginUpdateOptions added in v0.3.0

type RunsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

RunsClientBeginUpdateOptions contains the optional parameters for the RunsClient.BeginUpdate method.

type RunsClientCancelResponse added in v0.3.0

type RunsClientCancelResponse struct {
}

RunsClientCancelResponse contains the response from method RunsClient.BeginCancel.

type RunsClientGetLogSasURLOptions added in v0.3.0

type RunsClientGetLogSasURLOptions struct {
}

RunsClientGetLogSasURLOptions contains the optional parameters for the RunsClient.GetLogSasURL method.

type RunsClientGetLogSasURLResponse added in v0.3.0

type RunsClientGetLogSasURLResponse struct {
	// The result of get log link operation.
	RunGetLogResult
}

RunsClientGetLogSasURLResponse contains the response from method RunsClient.GetLogSasURL.

type RunsClientGetOptions added in v0.3.0

type RunsClientGetOptions struct {
}

RunsClientGetOptions contains the optional parameters for the RunsClient.Get method.

type RunsClientGetResponse added in v0.3.0

type RunsClientGetResponse struct {
	// Run resource properties
	Run
}

RunsClientGetResponse contains the response from method RunsClient.Get.

type RunsClientListOptions added in v0.3.0

type RunsClientListOptions struct {
	// The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed string function is 'contains'.
	// All logical operators except 'Not', 'Has', 'All' are allowed.
	Filter *string

	// $top is supported for get list of runs, which limits the maximum number of runs to return.
	Top *int32
}

RunsClientListOptions contains the optional parameters for the RunsClient.NewListPager method.

type RunsClientListResponse added in v0.3.0

type RunsClientListResponse struct {
	// Collection of runs.
	RunListResult
}

RunsClientListResponse contains the response from method RunsClient.NewListPager.

type RunsClientUpdateResponse added in v0.3.0

type RunsClientUpdateResponse struct {
	// Run resource properties
	Run
}

RunsClientUpdateResponse contains the response from method RunsClient.BeginUpdate.

type SKU

type SKU struct {
	// REQUIRED; The SKU name of the container registry. Required for registry creation.
	Name *SKUName

	// READ-ONLY; The SKU tier based on the SKU name.
	Tier *SKUTier
}

SKU - The SKU of a container registry.

func (SKU) MarshalJSON added in v0.7.0

func (s SKU) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON added in v0.7.0

func (s *SKU) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUName

type SKUName string

SKUName - The SKU name of the container registry. Required for registry creation.

const (
	SKUNameBasic    SKUName = "Basic"
	SKUNameClassic  SKUName = "Classic"
	SKUNamePremium  SKUName = "Premium"
	SKUNameStandard SKUName = "Standard"
)

func PossibleSKUNameValues

func PossibleSKUNameValues() []SKUName

PossibleSKUNameValues returns the possible values for the SKUName const type.

type SKUTier

type SKUTier string

SKUTier - The SKU tier based on the SKU name.

const (
	SKUTierBasic    SKUTier = "Basic"
	SKUTierClassic  SKUTier = "Classic"
	SKUTierPremium  SKUTier = "Premium"
	SKUTierStandard SKUTier = "Standard"
)

func PossibleSKUTierValues

func PossibleSKUTierValues() []SKUTier

PossibleSKUTierValues returns the possible values for the SKUTier const type.

type ScopeMap

type ScopeMap struct {
	// The properties of the scope map.
	Properties *ScopeMapProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

ScopeMap - An object that represents a scope map for a container registry.

func (ScopeMap) MarshalJSON added in v0.7.0

func (s ScopeMap) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScopeMap.

func (*ScopeMap) UnmarshalJSON added in v0.7.0

func (s *ScopeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMap.

type ScopeMapListResult

type ScopeMapListResult struct {
	// The URI that can be used to request the next list of scope maps.
	NextLink *string

	// The list of scope maps. Since this list may be incomplete, the nextLink field should be used to request the next list of
	// scope maps.
	Value []*ScopeMap
}

ScopeMapListResult - The result of a request to list scope maps for a container registry.

func (ScopeMapListResult) MarshalJSON

func (s ScopeMapListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScopeMapListResult.

func (*ScopeMapListResult) UnmarshalJSON added in v0.7.0

func (s *ScopeMapListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapListResult.

type ScopeMapProperties

type ScopeMapProperties struct {
	// REQUIRED; The list of scoped permissions for registry artifacts. E.g. repositories/repository-name/content/read, repositories/repository-name/metadata/write
	Actions []*string

	// The user friendly description of the scope map.
	Description *string

	// READ-ONLY; The creation date of scope map.
	CreationDate *time.Time

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The type of the scope map. E.g. BuildIn scope map.
	Type *string
}

ScopeMapProperties - The properties of a scope map.

func (ScopeMapProperties) MarshalJSON

func (s ScopeMapProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScopeMapProperties.

func (*ScopeMapProperties) UnmarshalJSON

func (s *ScopeMapProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapProperties.

type ScopeMapPropertiesUpdateParameters

type ScopeMapPropertiesUpdateParameters struct {
	// The list of scope permissions for registry artifacts. E.g. repositories/repository-name/pull, repositories/repository-name/delete
	Actions []*string

	// The user friendly description of the scope map.
	Description *string
}

ScopeMapPropertiesUpdateParameters - The update parameters for scope map properties.

func (ScopeMapPropertiesUpdateParameters) MarshalJSON

func (s ScopeMapPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScopeMapPropertiesUpdateParameters.

func (*ScopeMapPropertiesUpdateParameters) UnmarshalJSON added in v0.7.0

func (s *ScopeMapPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapPropertiesUpdateParameters.

type ScopeMapUpdateParameters

type ScopeMapUpdateParameters struct {
	// The update parameters for scope map properties.
	Properties *ScopeMapPropertiesUpdateParameters
}

ScopeMapUpdateParameters - The properties for updating the scope map.

func (ScopeMapUpdateParameters) MarshalJSON

func (s ScopeMapUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ScopeMapUpdateParameters.

func (*ScopeMapUpdateParameters) UnmarshalJSON added in v0.7.0

func (s *ScopeMapUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ScopeMapUpdateParameters.

type ScopeMapsClient

type ScopeMapsClient struct {
	// contains filtered or unexported fields
}

ScopeMapsClient contains the methods for the ScopeMaps group. Don't use this type directly, use NewScopeMapsClient() instead.

func NewScopeMapsClient

func NewScopeMapsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScopeMapsClient, error)

NewScopeMapsClient creates a new instance of ScopeMapsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ScopeMapsClient) BeginCreate

func (client *ScopeMapsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapCreateParameters ScopeMap, options *ScopeMapsClientBeginCreateOptions) (*runtime.Poller[ScopeMapsClientCreateResponse], error)

BeginCreate - Creates a scope map for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • scopeMapName - The name of the scope map.
  • scopeMapCreateParameters - The parameters for creating a scope map.
  • options - ScopeMapsClientBeginCreateOptions contains the optional parameters for the ScopeMapsClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewScopeMapsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMap{
		Properties: &armcontainerregistry.ScopeMapProperties{
			Description: to.Ptr("Developer Scopes"),
			Actions: []*string{
				to.Ptr("repositories/myrepository/contentWrite"),
				to.Ptr("repositories/myrepository/delete")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ScopeMap = armcontainerregistry.ScopeMap{
	// 	Name: to.Ptr("myScopeMap"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
	// 	Properties: &armcontainerregistry.ScopeMapProperties{
	// 		Type: to.Ptr("IsUserDefined"),
	// 		Actions: []*string{
	// 			to.Ptr("repositories/myrepository/contentWrite"),
	// 			to.Ptr("repositories/myrepository/delete")},
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		},
	// 	}
}
Output:

func (*ScopeMapsClient) BeginDelete

func (client *ScopeMapsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, options *ScopeMapsClientBeginDeleteOptions) (*runtime.Poller[ScopeMapsClientDeleteResponse], error)

BeginDelete - Deletes a scope map from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • scopeMapName - The name of the scope map.
  • options - ScopeMapsClientBeginDeleteOptions contains the optional parameters for the ScopeMapsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewScopeMapsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myScopeMap", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*ScopeMapsClient) BeginUpdate

func (client *ScopeMapsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, scopeMapUpdateParameters ScopeMapUpdateParameters, options *ScopeMapsClientBeginUpdateOptions) (*runtime.Poller[ScopeMapsClientUpdateResponse], error)

BeginUpdate - Updates a scope map with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • scopeMapName - The name of the scope map.
  • scopeMapUpdateParameters - The parameters for updating a scope map.
  • options - ScopeMapsClientBeginUpdateOptions contains the optional parameters for the ScopeMapsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewScopeMapsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myScopeMap", armcontainerregistry.ScopeMapUpdateParameters{
		Properties: &armcontainerregistry.ScopeMapPropertiesUpdateParameters{
			Description: to.Ptr("Developer Scopes"),
			Actions: []*string{
				to.Ptr("repositories/myrepository/contentWrite"),
				to.Ptr("repositories/myrepository/contentRead")},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ScopeMap = armcontainerregistry.ScopeMap{
	// 	Name: to.Ptr("myScopeMap"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
	// 	Properties: &armcontainerregistry.ScopeMapProperties{
	// 		Type: to.Ptr("IsUserDefined"),
	// 		Actions: []*string{
	// 			to.Ptr("repositories/myrepository/contentWrite"),
	// 			to.Ptr("repositories/myrepository/contentRead")},
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		},
	// 	}
}
Output:

func (*ScopeMapsClient) Get

func (client *ScopeMapsClient) Get(ctx context.Context, resourceGroupName string, registryName string, scopeMapName string, options *ScopeMapsClientGetOptions) (ScopeMapsClientGetResponse, error)

Get - Gets the properties of the specified scope map. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • scopeMapName - The name of the scope map.
  • options - ScopeMapsClientGetOptions contains the optional parameters for the ScopeMapsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewScopeMapsClient().Get(ctx, "myResourceGroup", "myRegistry", "myScopeMap", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.ScopeMap = armcontainerregistry.ScopeMap{
	// 	Name: to.Ptr("myScopeMap"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
	// 	Properties: &armcontainerregistry.ScopeMapProperties{
	// 		Type: to.Ptr("IsUserDefined"),
	// 		Actions: []*string{
	// 			to.Ptr("repositories/myrepository/contentWrite"),
	// 			to.Ptr("repositories/myrepository/delete")},
	// 			CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		},
	// 	}
}
Output:

func (*ScopeMapsClient) NewListPager added in v0.5.0

func (client *ScopeMapsClient) NewListPager(resourceGroupName string, registryName string, options *ScopeMapsClientListOptions) *runtime.Pager[ScopeMapsClientListResponse]

NewListPager - Lists all the scope maps for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - ScopeMapsClientListOptions contains the optional parameters for the ScopeMapsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/ScopeMapList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewScopeMapsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.ScopeMapListResult = armcontainerregistry.ScopeMapListResult{
		// 	Value: []*armcontainerregistry.ScopeMap{
		// 		{
		// 			Name: to.Ptr("myScopeMap"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/scopeMaps"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
		// 			Properties: &armcontainerregistry.ScopeMapProperties{
		// 				Type: to.Ptr("IsUserDefined"),
		// 				Actions: []*string{
		// 					to.Ptr("repositories/myrepository/contentWrite"),
		// 					to.Ptr("repositories/myrepository/delete")},
		// 					CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
		// 					ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type ScopeMapsClientBeginCreateOptions added in v0.4.0

type ScopeMapsClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ScopeMapsClientBeginCreateOptions contains the optional parameters for the ScopeMapsClient.BeginCreate method.

type ScopeMapsClientBeginDeleteOptions added in v0.4.0

type ScopeMapsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ScopeMapsClientBeginDeleteOptions contains the optional parameters for the ScopeMapsClient.BeginDelete method.

type ScopeMapsClientBeginUpdateOptions added in v0.4.0

type ScopeMapsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ScopeMapsClientBeginUpdateOptions contains the optional parameters for the ScopeMapsClient.BeginUpdate method.

type ScopeMapsClientCreateResponse added in v0.4.0

type ScopeMapsClientCreateResponse struct {
	// An object that represents a scope map for a container registry.
	ScopeMap
}

ScopeMapsClientCreateResponse contains the response from method ScopeMapsClient.BeginCreate.

type ScopeMapsClientDeleteResponse added in v0.4.0

type ScopeMapsClientDeleteResponse struct {
}

ScopeMapsClientDeleteResponse contains the response from method ScopeMapsClient.BeginDelete.

type ScopeMapsClientGetOptions added in v0.4.0

type ScopeMapsClientGetOptions struct {
}

ScopeMapsClientGetOptions contains the optional parameters for the ScopeMapsClient.Get method.

type ScopeMapsClientGetResponse added in v0.4.0

type ScopeMapsClientGetResponse struct {
	// An object that represents a scope map for a container registry.
	ScopeMap
}

ScopeMapsClientGetResponse contains the response from method ScopeMapsClient.Get.

type ScopeMapsClientListOptions added in v0.4.0

type ScopeMapsClientListOptions struct {
}

ScopeMapsClientListOptions contains the optional parameters for the ScopeMapsClient.NewListPager method.

type ScopeMapsClientListResponse added in v0.4.0

type ScopeMapsClientListResponse struct {
	// The result of a request to list scope maps for a container registry.
	ScopeMapListResult
}

ScopeMapsClientListResponse contains the response from method ScopeMapsClient.NewListPager.

type ScopeMapsClientUpdateResponse added in v0.4.0

type ScopeMapsClientUpdateResponse struct {
	// An object that represents a scope map for a container registry.
	ScopeMap
}

ScopeMapsClientUpdateResponse contains the response from method ScopeMapsClient.BeginUpdate.

type SecretObject

type SecretObject struct {
	// The type of the secret object which determines how the value of the secret object has to be interpreted.
	Type *SecretObjectType

	// The value of the secret. The format of this value will be determined based on the type of the secret object. If the type
	// is Opaque, the value will be used as is without any modification.
	Value *string
}

SecretObject - Describes the properties of a secret object value.

func (SecretObject) MarshalJSON added in v0.7.0

func (s SecretObject) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SecretObject.

func (*SecretObject) UnmarshalJSON added in v0.7.0

func (s *SecretObject) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SecretObject.

type SecretObjectType

type SecretObjectType string

SecretObjectType - The type of the secret object which determines how the value of the secret object has to be interpreted.

const (
	SecretObjectTypeOpaque      SecretObjectType = "Opaque"
	SecretObjectTypeVaultsecret SecretObjectType = "Vaultsecret"
)

func PossibleSecretObjectTypeValues

func PossibleSecretObjectTypeValues() []SecretObjectType

PossibleSecretObjectTypeValues returns the possible values for the SecretObjectType const type.

type SetValue

type SetValue struct {
	// REQUIRED; The name of the overridable value.
	Name *string

	// REQUIRED; The overridable value.
	Value *string

	// Flag to indicate whether the value represents a secret or not.
	IsSecret *bool
}

SetValue - The properties of a overridable value that can be passed to a task template.

func (SetValue) MarshalJSON added in v0.7.0

func (s SetValue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SetValue.

func (*SetValue) UnmarshalJSON added in v0.7.0

func (s *SetValue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SetValue.

type Source

type Source struct {
	// The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname()
	// along with the running port.
	Addr *string

	// The running instance of an application. Changes after each restart.
	InstanceID *string
}

Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it.

func (Source) MarshalJSON added in v0.7.0

func (s Source) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Source.

func (*Source) UnmarshalJSON added in v0.7.0

func (s *Source) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Source.

type SourceControlType

type SourceControlType string

SourceControlType - The type of source control service.

const (
	SourceControlTypeGithub                  SourceControlType = "Github"
	SourceControlTypeVisualStudioTeamService SourceControlType = "VisualStudioTeamService"
)

func PossibleSourceControlTypeValues

func PossibleSourceControlTypeValues() []SourceControlType

PossibleSourceControlTypeValues returns the possible values for the SourceControlType const type.

type SourceProperties

type SourceProperties struct {
	// REQUIRED; The full URL to the source code repository
	RepositoryURL *string

	// REQUIRED; The type of source control service.
	SourceControlType *SourceControlType

	// The branch name of the source code.
	Branch *string

	// The authorization properties for accessing the source code repository and to set up webhooks for notifications.
	SourceControlAuthProperties *AuthInfo
}

SourceProperties - The properties of the source code repository.

func (SourceProperties) MarshalJSON added in v0.7.0

func (s SourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceProperties.

func (*SourceProperties) UnmarshalJSON added in v0.7.0

func (s *SourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceProperties.

type SourceRegistryCredentials

type SourceRegistryCredentials struct {
	// The authentication mode which determines the source registry login scope. The credentials for the source registry will
	// be generated using the given scope. These credentials will be used to login to
	// the source registry during the run.
	LoginMode *SourceRegistryLoginMode
}

SourceRegistryCredentials - Describes the credential parameters for accessing the source registry.

func (SourceRegistryCredentials) MarshalJSON added in v0.7.0

func (s SourceRegistryCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceRegistryCredentials.

func (*SourceRegistryCredentials) UnmarshalJSON added in v0.7.0

func (s *SourceRegistryCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceRegistryCredentials.

type SourceRegistryLoginMode

type SourceRegistryLoginMode string

SourceRegistryLoginMode - The authentication mode which determines the source registry login scope. The credentials for the source registry will be generated using the given scope. These credentials will be used to login to the source registry during the run.

const (
	SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default"
	SourceRegistryLoginModeNone    SourceRegistryLoginMode = "None"
)

func PossibleSourceRegistryLoginModeValues

func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode

PossibleSourceRegistryLoginModeValues returns the possible values for the SourceRegistryLoginMode const type.

type SourceTrigger

type SourceTrigger struct {
	// REQUIRED; The name of the trigger.
	Name *string

	// REQUIRED; The properties that describes the source(code) for the task.
	SourceRepository *SourceProperties

	// REQUIRED; The source event corresponding to the trigger.
	SourceTriggerEvents []*SourceTriggerEvent

	// The current status of trigger.
	Status *TriggerStatus
}

SourceTrigger - The properties of a source based trigger.

func (SourceTrigger) MarshalJSON

func (s SourceTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceTrigger.

func (*SourceTrigger) UnmarshalJSON added in v0.7.0

func (s *SourceTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceTrigger.

type SourceTriggerDescriptor

type SourceTriggerDescriptor struct {
	// The branch name in the repository.
	BranchName *string

	// The unique ID that identifies a commit.
	CommitID *string

	// The event type of the trigger.
	EventType *string

	// The unique ID of the trigger.
	ID *string

	// The source control provider type.
	ProviderType *string

	// The unique ID that identifies pull request.
	PullRequestID *string

	// The repository URL.
	RepositoryURL *string
}

SourceTriggerDescriptor - The source trigger that caused a run.

func (SourceTriggerDescriptor) MarshalJSON added in v0.7.0

func (s SourceTriggerDescriptor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceTriggerDescriptor.

func (*SourceTriggerDescriptor) UnmarshalJSON added in v0.7.0

func (s *SourceTriggerDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerDescriptor.

type SourceTriggerEvent

type SourceTriggerEvent string
const (
	SourceTriggerEventCommit      SourceTriggerEvent = "commit"
	SourceTriggerEventPullrequest SourceTriggerEvent = "pullrequest"
)

func PossibleSourceTriggerEventValues

func PossibleSourceTriggerEventValues() []SourceTriggerEvent

PossibleSourceTriggerEventValues returns the possible values for the SourceTriggerEvent const type.

type SourceTriggerUpdateParameters

type SourceTriggerUpdateParameters struct {
	// REQUIRED; The name of the trigger.
	Name *string

	// The properties that describes the source(code) for the task.
	SourceRepository *SourceUpdateParameters

	// The source event corresponding to the trigger.
	SourceTriggerEvents []*SourceTriggerEvent

	// The current status of trigger.
	Status *TriggerStatus
}

SourceTriggerUpdateParameters - The properties for updating a source based trigger.

func (SourceTriggerUpdateParameters) MarshalJSON

func (s SourceTriggerUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceTriggerUpdateParameters.

func (*SourceTriggerUpdateParameters) UnmarshalJSON added in v0.7.0

func (s *SourceTriggerUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceTriggerUpdateParameters.

type SourceUpdateParameters

type SourceUpdateParameters struct {
	// The branch name of the source code.
	Branch *string

	// The full URL to the source code repository
	RepositoryURL *string

	// The authorization properties for accessing the source code repository and to set up webhooks for notifications.
	SourceControlAuthProperties *AuthInfoUpdateParameters

	// The type of source control service.
	SourceControlType *SourceControlType
}

SourceUpdateParameters - The properties for updating the source code repository.

func (SourceUpdateParameters) MarshalJSON added in v0.7.0

func (s SourceUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceUpdateParameters.

func (*SourceUpdateParameters) UnmarshalJSON added in v0.7.0

func (s *SourceUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceUpdateParameters.

type SourceUploadDefinition

type SourceUploadDefinition struct {
	// The relative path to the source. This is used to submit the subsequent queue build request.
	RelativePath *string

	// The URL where the client can upload the source.
	UploadURL *string
}

SourceUploadDefinition - The properties of a response to source upload request.

func (SourceUploadDefinition) MarshalJSON added in v0.7.0

func (s SourceUploadDefinition) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SourceUploadDefinition.

func (*SourceUploadDefinition) UnmarshalJSON added in v0.7.0

func (s *SourceUploadDefinition) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SourceUploadDefinition.

type Status

type Status struct {
	// READ-ONLY; The short label for the status.
	DisplayStatus *string

	// READ-ONLY; The detailed message for the status, including alerts and error messages.
	Message *string

	// READ-ONLY; The timestamp when the status was changed to the current value.
	Timestamp *time.Time
}

Status - The status of an Azure resource at the time the operation was called.

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Status.

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Status.

type StepType

type StepType string

StepType - The type of the step.

const (
	StepTypeDocker      StepType = "Docker"
	StepTypeEncodedTask StepType = "EncodedTask"
	StepTypeFileTask    StepType = "FileTask"
)

func PossibleStepTypeValues

func PossibleStepTypeValues() []StepType

PossibleStepTypeValues returns the possible values for the StepType const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource modification (UTC).
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *LastModifiedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

func (s SystemData) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type Target

type Target struct {
	// The digest of the content, as defined by the Registry V2 HTTP API Specification.
	Digest *string

	// The number of bytes of the content. Same as Size field.
	Length *int64

	// The MIME type of the referenced object.
	MediaType *string

	// The name of the artifact.
	Name *string

	// The repository name.
	Repository *string

	// The number of bytes of the content. Same as Length field.
	Size *int64

	// The tag name.
	Tag *string

	// The direct URL to the content.
	URL *string

	// The version of the artifact.
	Version *string
}

Target - The target of the event.

func (Target) MarshalJSON added in v0.7.0

func (t Target) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Target.

func (*Target) UnmarshalJSON added in v0.7.0

func (t *Target) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Target.

type Task

type Task struct {
	// REQUIRED; The location of the resource. This cannot be changed after the resource is created.
	Location *string

	// Identity for the resource.
	Identity *IdentityProperties

	// The properties of a task.
	Properties *TaskProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Task - The task that has the ARM resource and task properties. The task will have all information to schedule a run against it.

func (Task) MarshalJSON

func (t Task) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Task.

func (*Task) UnmarshalJSON added in v0.7.0

func (t *Task) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Task.

type TaskListResult

type TaskListResult struct {
	// The URI that can be used to request the next set of paged results.
	NextLink *string

	// The collection value.
	Value []*Task
}

TaskListResult - The collection of tasks.

func (TaskListResult) MarshalJSON

func (t TaskListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskListResult.

func (*TaskListResult) UnmarshalJSON added in v0.7.0

func (t *TaskListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskListResult.

type TaskProperties

type TaskProperties struct {
	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the task.
	AgentPoolName *string

	// The properties that describes a set of credentials that will be used when this run is invoked.
	Credentials *Credentials

	// The value of this property indicates whether the task resource is system task or not.
	IsSystemTask *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// The platform properties against which the run has to happen.
	Platform *PlatformProperties

	// The current status of task.
	Status *TaskStatus

	// The properties of a task step.
	Step TaskStepPropertiesClassification

	// Run timeout in seconds.
	Timeout *int32

	// The properties that describe all triggers for the task.
	Trigger *TriggerProperties

	// READ-ONLY; The creation date of task.
	CreationDate *time.Time

	// READ-ONLY; The provisioning state of the task.
	ProvisioningState *ProvisioningState
}

TaskProperties - The properties of a task.

func (TaskProperties) MarshalJSON

func (t TaskProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskProperties.

func (*TaskProperties) UnmarshalJSON

func (t *TaskProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskProperties.

type TaskPropertiesUpdateParameters

type TaskPropertiesUpdateParameters struct {
	// The machine configuration of the run agent.
	AgentConfiguration *AgentProperties

	// The dedicated agent pool for the task.
	AgentPoolName *string

	// The parameters that describes a set of credentials that will be used when this run is invoked.
	Credentials *Credentials

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// The platform properties against which the run has to happen.
	Platform *PlatformUpdateParameters

	// The current status of task.
	Status *TaskStatus

	// The properties for updating a task step.
	Step TaskStepUpdateParametersClassification

	// Run timeout in seconds.
	Timeout *int32

	// The properties for updating trigger properties.
	Trigger *TriggerUpdateParameters
}

TaskPropertiesUpdateParameters - The properties for updating a task.

func (TaskPropertiesUpdateParameters) MarshalJSON

func (t TaskPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskPropertiesUpdateParameters.

func (*TaskPropertiesUpdateParameters) UnmarshalJSON

func (t *TaskPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskPropertiesUpdateParameters.

type TaskRun

type TaskRun struct {
	// Identity for the resource.
	Identity *IdentityProperties

	// The location of the resource
	Location *string

	// The properties associated with the task run, i.e., request and result of the run
	Properties *TaskRunProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

TaskRun - The task run that has the ARM resource and properties. The task run will have the information of request and result of a run.

func (TaskRun) MarshalJSON added in v0.7.0

func (t TaskRun) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRun.

func (*TaskRun) UnmarshalJSON added in v0.7.0

func (t *TaskRun) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRun.

type TaskRunListResult

type TaskRunListResult struct {
	// The URI that can be used to request the next set of paged results.
	NextLink *string

	// The collection value.
	Value []*TaskRun
}

TaskRunListResult - The collection of task runs.

func (TaskRunListResult) MarshalJSON

func (t TaskRunListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRunListResult.

func (*TaskRunListResult) UnmarshalJSON added in v0.7.0

func (t *TaskRunListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunListResult.

type TaskRunProperties

type TaskRunProperties struct {
	// How the run should be forced to rerun even if the run request configuration has not changed
	ForceUpdateTag *string

	// The request (parameters) for the run
	RunRequest RunRequestClassification

	// READ-ONLY; The provisioning state of this task run
	ProvisioningState *ProvisioningState

	// READ-ONLY; The result of this task run
	RunResult *Run
}

TaskRunProperties - The properties of task run.

func (TaskRunProperties) MarshalJSON

func (t TaskRunProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRunProperties.

func (*TaskRunProperties) UnmarshalJSON

func (t *TaskRunProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunProperties.

type TaskRunPropertiesUpdateParameters

type TaskRunPropertiesUpdateParameters struct {
	// How the run should be forced to rerun even if the run request configuration has not changed
	ForceUpdateTag *string

	// The request (parameters) for the new run
	RunRequest RunRequestClassification
}

TaskRunPropertiesUpdateParameters - The properties of a task run update parameters.

func (TaskRunPropertiesUpdateParameters) MarshalJSON

func (t TaskRunPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRunPropertiesUpdateParameters.

func (*TaskRunPropertiesUpdateParameters) UnmarshalJSON

func (t *TaskRunPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunPropertiesUpdateParameters.

type TaskRunRequest

type TaskRunRequest struct {
	// REQUIRED; The resource ID of task against which run has to be queued.
	TaskID *string

	// REQUIRED; The type of the run request.
	Type *string

	// The dedicated agent pool for the run.
	AgentPoolName *string

	// The value that indicates whether archiving is enabled for the run or not.
	IsArchiveEnabled *bool

	// The template that describes the repository and tag information for run log artifact.
	LogTemplate *string

	// Set of overridable parameters that can be passed when running a Task.
	OverrideTaskStepProperties *OverrideTaskStepProperties
}

TaskRunRequest - The parameters for a task run request.

func (*TaskRunRequest) GetRunRequest added in v0.3.0

func (t *TaskRunRequest) GetRunRequest() *RunRequest

GetRunRequest implements the RunRequestClassification interface for type TaskRunRequest.

func (TaskRunRequest) MarshalJSON

func (t TaskRunRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRunRequest.

func (*TaskRunRequest) UnmarshalJSON

func (t *TaskRunRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunRequest.

type TaskRunUpdateParameters

type TaskRunUpdateParameters struct {
	// Identity for the resource.
	Identity *IdentityProperties

	// The location of the resource
	Location *string

	// The properties for updating a task run.
	Properties *TaskRunPropertiesUpdateParameters

	// The ARM resource tags.
	Tags map[string]*string
}

TaskRunUpdateParameters - The parameters for updating a task run.

func (TaskRunUpdateParameters) MarshalJSON

func (t TaskRunUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskRunUpdateParameters.

func (*TaskRunUpdateParameters) UnmarshalJSON added in v0.7.0

func (t *TaskRunUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskRunUpdateParameters.

type TaskRunsClient

type TaskRunsClient struct {
	// contains filtered or unexported fields
}

TaskRunsClient contains the methods for the TaskRuns group. Don't use this type directly, use NewTaskRunsClient() instead.

func NewTaskRunsClient

func NewTaskRunsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TaskRunsClient, error)

NewTaskRunsClient creates a new instance of TaskRunsClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TaskRunsClient) BeginCreate

func (client *TaskRunsClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun, options *TaskRunsClientBeginCreateOptions) (*runtime.Poller[TaskRunsClientCreateResponse], error)

BeginCreate - Creates a task run for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskRunName - The name of the task run.
  • taskRun - The parameters of a run that needs to scheduled.
  • options - TaskRunsClientBeginCreateOptions contains the optional parameters for the TaskRunsClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTaskRunsClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myRun", armcontainerregistry.TaskRun{
		Properties: &armcontainerregistry.TaskRunProperties{
			ForceUpdateTag: to.Ptr("test"),
			RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
				Type:                 to.Ptr("EncodedTaskRunRequest"),
				Credentials:          &armcontainerregistry.Credentials{},
				EncodedTaskContent:   to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
				EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
				Platform: &armcontainerregistry.PlatformProperties{
					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
					OS:           to.Ptr(armcontainerregistry.OSLinux),
				},
				Values: []*armcontainerregistry.SetValue{},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TaskRun = armcontainerregistry.TaskRun{
	// 	Name: to.Ptr("myrun"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"),
	// 	Properties: &armcontainerregistry.TaskRunProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
	// 			Type: to.Ptr("EncodedTaskRunRequest"),
	// 			IsArchiveEnabled: to.Ptr(true),
	// 			Credentials: &armcontainerregistry.Credentials{
	// 			},
	// 			EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
	// 			EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
	// 			Platform: &armcontainerregistry.PlatformProperties{
	// 				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 				OS: to.Ptr(armcontainerregistry.OSLinux),
	// 			},
	// 			Values: []*armcontainerregistry.SetValue{
	// 			},
	// 		},
	// 		RunResult: &armcontainerregistry.Run{
	// 			Name: to.Ptr("yd5"),
	// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 			ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"),
	// 			Properties: &armcontainerregistry.RunProperties{
	// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 					CPU: to.Ptr[int32](2),
	// 				},
	// 				CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()),
	// 				IsArchiveEnabled: to.Ptr(true),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.000Z"); return t}()),
	// 				Platform: &armcontainerregistry.PlatformProperties{
	// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 					OS: to.Ptr(armcontainerregistry.OSLinux),
	// 				},
	// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 				RunID: to.Ptr("yd5"),
	// 				RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun),
	// 				Status: to.Ptr(armcontainerregistry.RunStatusQueued),
	// 			},
	// 		},
	// 	},
	// }
}
Output:

func (*TaskRunsClient) BeginDelete

func (client *TaskRunsClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientBeginDeleteOptions) (*runtime.Poller[TaskRunsClientDeleteResponse], error)

BeginDelete - Deletes a specified task run resource. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskRunName - The name of the task run.
  • options - TaskRunsClientBeginDeleteOptions contains the optional parameters for the TaskRunsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTaskRunsClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myRun", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*TaskRunsClient) BeginUpdate

func (client *TaskRunsClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters, options *TaskRunsClientBeginUpdateOptions) (*runtime.Poller[TaskRunsClientUpdateResponse], error)

BeginUpdate - Updates a task run with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskRunName - The name of the task run.
  • updateParameters - The parameters for updating a task run.
  • options - TaskRunsClientBeginUpdateOptions contains the optional parameters for the TaskRunsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTaskRunsClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myRun", armcontainerregistry.TaskRunUpdateParameters{
		Properties: &armcontainerregistry.TaskRunPropertiesUpdateParameters{
			ForceUpdateTag: to.Ptr("test"),
			RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
				Type:                 to.Ptr("EncodedTaskRunRequest"),
				IsArchiveEnabled:     to.Ptr(true),
				Credentials:          &armcontainerregistry.Credentials{},
				EncodedTaskContent:   to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
				EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
				Platform: &armcontainerregistry.PlatformProperties{
					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
					OS:           to.Ptr(armcontainerregistry.OSLinux),
				},
				Values: []*armcontainerregistry.SetValue{},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TaskRun = armcontainerregistry.TaskRun{
	// 	Name: to.Ptr("mytestrun"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"),
	// 	Properties: &armcontainerregistry.TaskRunProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
	// 			Type: to.Ptr("EncodedTaskRunRequest"),
	// 			IsArchiveEnabled: to.Ptr(true),
	// 			Credentials: &armcontainerregistry.Credentials{
	// 			},
	// 			EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
	// 			EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
	// 			Platform: &armcontainerregistry.PlatformProperties{
	// 				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 				OS: to.Ptr(armcontainerregistry.OSLinux),
	// 			},
	// 			Values: []*armcontainerregistry.SetValue{
	// 			},
	// 		},
	// 		RunResult: &armcontainerregistry.Run{
	// 			Name: to.Ptr("yd6"),
	// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 			ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd6"),
	// 			Properties: &armcontainerregistry.RunProperties{
	// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 					CPU: to.Ptr[int32](2),
	// 				},
	// 				CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:31:34.118Z"); return t}()),
	// 				IsArchiveEnabled: to.Ptr(true),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:31:34.000Z"); return t}()),
	// 				Platform: &armcontainerregistry.PlatformProperties{
	// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 					OS: to.Ptr(armcontainerregistry.OSLinux),
	// 				},
	// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 				RunID: to.Ptr("yd6"),
	// 				RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun),
	// 				Status: to.Ptr(armcontainerregistry.RunStatusQueued),
	// 			},
	// 		},
	// 	},
	// }
}
Output:

func (*TaskRunsClient) Get

func (client *TaskRunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientGetOptions) (TaskRunsClientGetResponse, error)

Get - Gets the detailed information for a given task run. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskRunName - The name of the task run.
  • options - TaskRunsClientGetOptions contains the optional parameters for the TaskRunsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTaskRunsClient().Get(ctx, "myResourceGroup", "myRegistry", "myRun", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TaskRun = armcontainerregistry.TaskRun{
	// 	Name: to.Ptr("myRun"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"),
	// 	ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"),
	// 	Properties: &armcontainerregistry.TaskRunProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
	// 			Type: to.Ptr("EncodedTaskRunRequest"),
	// 			IsArchiveEnabled: to.Ptr(true),
	// 			Credentials: &armcontainerregistry.Credentials{
	// 			},
	// 			EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
	// 			EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
	// 			Platform: &armcontainerregistry.PlatformProperties{
	// 				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 				OS: to.Ptr(armcontainerregistry.OSLinux),
	// 			},
	// 			Values: []*armcontainerregistry.SetValue{
	// 			},
	// 		},
	// 		RunResult: &armcontainerregistry.Run{
	// 			Name: to.Ptr("yd5"),
	// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 			ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"),
	// 			Properties: &armcontainerregistry.RunProperties{
	// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 					CPU: to.Ptr[int32](2),
	// 				},
	// 				CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()),
	// 				FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.879Z"); return t}()),
	// 				IsArchiveEnabled: to.Ptr(true),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.000Z"); return t}()),
	// 				Platform: &armcontainerregistry.PlatformProperties{
	// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 					OS: to.Ptr(armcontainerregistry.OSLinux),
	// 				},
	// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 				RunID: to.Ptr("yd5"),
	// 				RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:22.134Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 			},
	// 		},
	// 	},
	// }
}
Output:

func (*TaskRunsClient) GetDetails

func (client *TaskRunsClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, options *TaskRunsClientGetDetailsOptions) (TaskRunsClientGetDetailsResponse, error)

GetDetails - Gets the detailed information for a given task run that includes all secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskRunName - The name of the task run.
  • options - TaskRunsClientGetDetailsOptions contains the optional parameters for the TaskRunsClient.GetDetails method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsGetDetails.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTaskRunsClient().GetDetails(ctx, "myResourceGroup", "myRegistry", "myRun", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.TaskRun = armcontainerregistry.TaskRun{
	// 	Name: to.Ptr("myRun"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"),
	// 	ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"),
	// 	Properties: &armcontainerregistry.TaskRunProperties{
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
	// 			Type: to.Ptr("EncodedTaskRunRequest"),
	// 			IsArchiveEnabled: to.Ptr(true),
	// 			Credentials: &armcontainerregistry.Credentials{
	// 			},
	// 			EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
	// 			EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
	// 			Platform: &armcontainerregistry.PlatformProperties{
	// 				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 				OS: to.Ptr(armcontainerregistry.OSLinux),
	// 			},
	// 			Values: []*armcontainerregistry.SetValue{
	// 			},
	// 		},
	// 		RunResult: &armcontainerregistry.Run{
	// 			Name: to.Ptr("yd5"),
	// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
	// 			ID: to.Ptr("/subscriptions/3647315e-0c5b-4ce4-8739-b071e144b2c9/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd5"),
	// 			Properties: &armcontainerregistry.RunProperties{
	// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 					CPU: to.Ptr[int32](2),
	// 				},
	// 				CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:21.926Z"); return t}()),
	// 				FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.879Z"); return t}()),
	// 				IsArchiveEnabled: to.Ptr(true),
	// 				LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:29.000Z"); return t}()),
	// 				Platform: &armcontainerregistry.PlatformProperties{
	// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 					OS: to.Ptr(armcontainerregistry.OSLinux),
	// 				},
	// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 				RunID: to.Ptr("yd5"),
	// 				RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun),
	// 				StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-06T17:23:22.134Z"); return t}()),
	// 				Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
	// 			},
	// 		},
	// 	},
	// }
}
Output:

func (*TaskRunsClient) NewListPager added in v0.5.0

func (client *TaskRunsClient) NewListPager(resourceGroupName string, registryName string, options *TaskRunsClientListOptions) *runtime.Pager[TaskRunsClientListResponse]

NewListPager - Lists all the task runs for a specified container registry.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • options - TaskRunsClientListOptions contains the optional parameters for the TaskRunsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTaskRunsClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.TaskRunListResult = armcontainerregistry.TaskRunListResult{
		// 	Value: []*armcontainerregistry.TaskRun{
		// 		{
		// 			Name: to.Ptr("mytestrun"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/TaskRuns"),
		// 			ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/taskRuns/myRun"),
		// 			Properties: &armcontainerregistry.TaskRunProperties{
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				RunRequest: &armcontainerregistry.EncodedTaskRunRequest{
		// 					Type: to.Ptr("EncodedTaskRunRequest"),
		// 					IsArchiveEnabled: to.Ptr(true),
		// 					Credentials: &armcontainerregistry.Credentials{
		// 					},
		// 					EncodedTaskContent: to.Ptr("c3RlcHM6IAogIC0gY21kOiB7eyAuVmFsdWVzLmNvbW1hbmQgfX0K"),
		// 					EncodedValuesContent: to.Ptr("Y29tbWFuZDogYmFzaCBlY2hvIHt7LlJ1bi5SZWdpc3RyeX19Cg=="),
		// 					Platform: &armcontainerregistry.PlatformProperties{
		// 						Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
		// 						OS: to.Ptr(armcontainerregistry.OSLinux),
		// 					},
		// 					Values: []*armcontainerregistry.SetValue{
		// 					},
		// 				},
		// 				RunResult: &armcontainerregistry.Run{
		// 					Name: to.Ptr("yd4"),
		// 					Type: to.Ptr("Microsoft.ContainerRegistry/registries/runs"),
		// 					ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/runs/yd4"),
		// 					Properties: &armcontainerregistry.RunProperties{
		// 						AgentConfiguration: &armcontainerregistry.AgentProperties{
		// 							CPU: to.Ptr[int32](2),
		// 						},
		// 						CreateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:29.227Z"); return t}()),
		// 						FinishTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37.034Z"); return t}()),
		// 						IsArchiveEnabled: to.Ptr(true),
		// 						LastUpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:37.000Z"); return t}()),
		// 						Platform: &armcontainerregistry.PlatformProperties{
		// 							Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
		// 							OS: to.Ptr(armcontainerregistry.OSLinux),
		// 						},
		// 						ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 						RunID: to.Ptr("yd4"),
		// 						RunType: to.Ptr(armcontainerregistry.RunTypeQuickRun),
		// 						StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-09-04T17:15:29.458Z"); return t}()),
		// 						Status: to.Ptr(armcontainerregistry.RunStatusSucceeded),
		// 					},
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

type TaskRunsClientBeginCreateOptions added in v0.3.0

type TaskRunsClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TaskRunsClientBeginCreateOptions contains the optional parameters for the TaskRunsClient.BeginCreate method.

type TaskRunsClientBeginDeleteOptions added in v0.3.0

type TaskRunsClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TaskRunsClientBeginDeleteOptions contains the optional parameters for the TaskRunsClient.BeginDelete method.

type TaskRunsClientBeginUpdateOptions added in v0.3.0

type TaskRunsClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TaskRunsClientBeginUpdateOptions contains the optional parameters for the TaskRunsClient.BeginUpdate method.

type TaskRunsClientCreateResponse added in v0.3.0

type TaskRunsClientCreateResponse struct {
	// The task run that has the ARM resource and properties.
	// The task run will have the information of request and result of a run.
	TaskRun
}

TaskRunsClientCreateResponse contains the response from method TaskRunsClient.BeginCreate.

type TaskRunsClientDeleteResponse added in v0.3.0

type TaskRunsClientDeleteResponse struct {
}

TaskRunsClientDeleteResponse contains the response from method TaskRunsClient.BeginDelete.

type TaskRunsClientGetDetailsOptions added in v0.3.0

type TaskRunsClientGetDetailsOptions struct {
}

TaskRunsClientGetDetailsOptions contains the optional parameters for the TaskRunsClient.GetDetails method.

type TaskRunsClientGetDetailsResponse added in v0.3.0

type TaskRunsClientGetDetailsResponse struct {
	// The task run that has the ARM resource and properties.
	// The task run will have the information of request and result of a run.
	TaskRun
}

TaskRunsClientGetDetailsResponse contains the response from method TaskRunsClient.GetDetails.

type TaskRunsClientGetOptions added in v0.3.0

type TaskRunsClientGetOptions struct {
}

TaskRunsClientGetOptions contains the optional parameters for the TaskRunsClient.Get method.

type TaskRunsClientGetResponse added in v0.3.0

type TaskRunsClientGetResponse struct {
	// The task run that has the ARM resource and properties.
	// The task run will have the information of request and result of a run.
	TaskRun
}

TaskRunsClientGetResponse contains the response from method TaskRunsClient.Get.

type TaskRunsClientListOptions added in v0.3.0

type TaskRunsClientListOptions struct {
}

TaskRunsClientListOptions contains the optional parameters for the TaskRunsClient.NewListPager method.

type TaskRunsClientListResponse added in v0.3.0

type TaskRunsClientListResponse struct {
	// The collection of task runs.
	TaskRunListResult
}

TaskRunsClientListResponse contains the response from method TaskRunsClient.NewListPager.

type TaskRunsClientUpdateResponse added in v0.3.0

type TaskRunsClientUpdateResponse struct {
	// The task run that has the ARM resource and properties.
	// The task run will have the information of request and result of a run.
	TaskRun
}

TaskRunsClientUpdateResponse contains the response from method TaskRunsClient.BeginUpdate.

type TaskStatus

type TaskStatus string

TaskStatus - The current status of task.

const (
	TaskStatusDisabled TaskStatus = "Disabled"
	TaskStatusEnabled  TaskStatus = "Enabled"
)

func PossibleTaskStatusValues

func PossibleTaskStatusValues() []TaskStatus

PossibleTaskStatusValues returns the possible values for the TaskStatus const type.

type TaskStepProperties

type TaskStepProperties struct {
	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string

	// READ-ONLY; List of base image dependencies for a step.
	BaseImageDependencies []*BaseImageDependency
}

TaskStepProperties - Base properties for any task step.

func (*TaskStepProperties) GetTaskStepProperties

func (t *TaskStepProperties) GetTaskStepProperties() *TaskStepProperties

GetTaskStepProperties implements the TaskStepPropertiesClassification interface for type TaskStepProperties.

func (TaskStepProperties) MarshalJSON added in v0.3.0

func (t TaskStepProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskStepProperties.

func (*TaskStepProperties) UnmarshalJSON

func (t *TaskStepProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepProperties.

type TaskStepPropertiesClassification

type TaskStepPropertiesClassification interface {
	// GetTaskStepProperties returns the TaskStepProperties content of the underlying type.
	GetTaskStepProperties() *TaskStepProperties
}

TaskStepPropertiesClassification provides polymorphic access to related types. Call the interface's GetTaskStepProperties() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DockerBuildStep, *EncodedTaskStep, *FileTaskStep, *TaskStepProperties

type TaskStepUpdateParameters

type TaskStepUpdateParameters struct {
	// REQUIRED; The type of the step.
	Type *StepType

	// The token (git PAT or SAS token of storage account blob) associated with the context for a step.
	ContextAccessToken *string

	// The URL(absolute or relative) of the source context for the task step.
	ContextPath *string
}

TaskStepUpdateParameters - Base properties for updating any task step.

func (*TaskStepUpdateParameters) GetTaskStepUpdateParameters

func (t *TaskStepUpdateParameters) GetTaskStepUpdateParameters() *TaskStepUpdateParameters

GetTaskStepUpdateParameters implements the TaskStepUpdateParametersClassification interface for type TaskStepUpdateParameters.

func (TaskStepUpdateParameters) MarshalJSON added in v0.7.0

func (t TaskStepUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskStepUpdateParameters.

func (*TaskStepUpdateParameters) UnmarshalJSON

func (t *TaskStepUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskStepUpdateParameters.

type TaskStepUpdateParametersClassification

type TaskStepUpdateParametersClassification interface {
	// GetTaskStepUpdateParameters returns the TaskStepUpdateParameters content of the underlying type.
	GetTaskStepUpdateParameters() *TaskStepUpdateParameters
}

TaskStepUpdateParametersClassification provides polymorphic access to related types. Call the interface's GetTaskStepUpdateParameters() method to access the common type. Use a type switch to determine the concrete type. The possible types are: - *DockerBuildStepUpdateParameters, *EncodedTaskStepUpdateParameters, *FileTaskStepUpdateParameters, *TaskStepUpdateParameters

type TaskUpdateParameters

type TaskUpdateParameters struct {
	// Identity for the resource.
	Identity *IdentityProperties

	// The properties for updating a task.
	Properties *TaskPropertiesUpdateParameters

	// The ARM resource tags.
	Tags map[string]*string
}

TaskUpdateParameters - The parameters for updating a task.

func (TaskUpdateParameters) MarshalJSON

func (t TaskUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TaskUpdateParameters.

func (*TaskUpdateParameters) UnmarshalJSON added in v0.7.0

func (t *TaskUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TaskUpdateParameters.

type TasksClient

type TasksClient struct {
	// contains filtered or unexported fields
}

TasksClient contains the methods for the Tasks group. Don't use this type directly, use NewTasksClient() instead.

func NewTasksClient

func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TasksClient, error)

NewTasksClient creates a new instance of TasksClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TasksClient) BeginCreate

func (client *TasksClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters Task, options *TasksClientBeginCreateOptions) (*runtime.Poller[TasksClientCreateResponse], error)

BeginCreate - Creates a task for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskName - The name of the container registry task.
  • taskCreateParameters - The parameters for creating a task.
  • options - TasksClientBeginCreateOptions contains the optional parameters for the TasksClient.BeginCreate method.
Example (TasksCreate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
		Identity: &armcontainerregistry.IdentityProperties{
			Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
		},
		Properties: &armcontainerregistry.TaskProperties{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](2),
			},
			IsSystemTask: to.Ptr(false),
			LogTemplate:  to.Ptr("acr/tasks:{{.Run.OS}}"),
			Platform: &armcontainerregistry.PlatformProperties{
				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
				OS:           to.Ptr(armcontainerregistry.OSLinux),
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStep{
				Type:        to.Ptr(armcontainerregistry.StepTypeDocker),
				ContextPath: to.Ptr("src"),
				Arguments: []*armcontainerregistry.Argument{
					{
						Name:     to.Ptr("mytestargument"),
						IsSecret: to.Ptr(false),
						Value:    to.Ptr("mytestvalue"),
					},
					{
						Name:     to.Ptr("mysecrettestargument"),
						IsSecret: to.Ptr(true),
						Value:    to.Ptr("mysecrettestvalue"),
					}},
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag")},
				IsPushEnabled: to.Ptr(true),
				NoCache:       to.Ptr(false),
			},
			Trigger: &armcontainerregistry.TriggerProperties{
				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
					Name:                     to.Ptr("myBaseImageTrigger"),
					BaseImageTriggerType:     to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
					UpdateTriggerEndpoint:    to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"),
					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken),
				},
				SourceTriggers: []*armcontainerregistry.SourceTrigger{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceProperties{
							Branch:        to.Ptr("master"),
							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
							SourceControlAuthProperties: &armcontainerregistry.AuthInfo{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
				TimerTriggers: []*armcontainerregistry.TimerTrigger{
					{
						Name:     to.Ptr("myTimerTrigger"),
						Schedule: to.Ptr("30 9 * * 1-5"),
					}},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		IsSystemTask: to.Ptr(false),
	// 		LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksCreateQuickTask)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksCreate_QuickTask.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "quicktask", armcontainerregistry.Task{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
		Properties: &armcontainerregistry.TaskProperties{
			IsSystemTask: to.Ptr(true),
			LogTemplate:  to.Ptr("acr/tasks:{{.Run.OS}}"),
			Status:       to.Ptr(armcontainerregistry.TaskStatusEnabled),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("quicktask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		IsSystemTask: to.Ptr(true),
	// 		LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 	},
	// }
}
Output:

Example (TasksCreateWithSystemAndUserIdentities)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
		Identity: &armcontainerregistry.IdentityProperties{
			Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssignedUserAssigned),
			UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{
				"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {},
			},
		},
		Properties: &armcontainerregistry.TaskProperties{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](2),
			},
			IsSystemTask: to.Ptr(false),
			Platform: &armcontainerregistry.PlatformProperties{
				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
				OS:           to.Ptr(armcontainerregistry.OSLinux),
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStep{
				Type:        to.Ptr(armcontainerregistry.StepTypeDocker),
				ContextPath: to.Ptr("src"),
				Arguments: []*armcontainerregistry.Argument{
					{
						Name:     to.Ptr("mytestargument"),
						IsSecret: to.Ptr(false),
						Value:    to.Ptr("mytestvalue"),
					},
					{
						Name:     to.Ptr("mysecrettestargument"),
						IsSecret: to.Ptr(true),
						Value:    to.Ptr("mysecrettestvalue"),
					}},
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag")},
				IsPushEnabled: to.Ptr(true),
				NoCache:       to.Ptr(false),
			},
			Trigger: &armcontainerregistry.TriggerProperties{
				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
					Name:                     to.Ptr("myBaseImageTrigger"),
					BaseImageTriggerType:     to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
					UpdateTriggerEndpoint:    to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"),
					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
				},
				SourceTriggers: []*armcontainerregistry.SourceTrigger{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceProperties{
							Branch:        to.Ptr("master"),
							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
							SourceControlAuthProperties: &armcontainerregistry.AuthInfo{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
				TimerTriggers: []*armcontainerregistry.TimerTrigger{
					{
						Name:     to.Ptr("myTimerTrigger"),
						Schedule: to.Ptr("30 9 * * 1-5"),
					}},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssignedUserAssigned),
	// 		PrincipalID: to.Ptr("fc99dc67-1ad9-45c8-9ebc-e438081c8e30"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"),
	// 		UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{
	// 			"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{
	// 				ClientID: to.Ptr("e35621a5-f615-4a20-940e-de8a84b15abc"),
	// 				PrincipalID: to.Ptr("e45e3m7c-176e-416a-b466-0c5ec8298f8a"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		IsSystemTask: to.Ptr(false),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksCreateWithUserIdentities)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
		Identity: &armcontainerregistry.IdentityProperties{
			Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned),
			UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{
				"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1":  {},
				"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": {},
			},
		},
		Properties: &armcontainerregistry.TaskProperties{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](2),
			},
			IsSystemTask: to.Ptr(false),
			Platform: &armcontainerregistry.PlatformProperties{
				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
				OS:           to.Ptr(armcontainerregistry.OSLinux),
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStep{
				Type:        to.Ptr(armcontainerregistry.StepTypeDocker),
				ContextPath: to.Ptr("src"),
				Arguments: []*armcontainerregistry.Argument{
					{
						Name:     to.Ptr("mytestargument"),
						IsSecret: to.Ptr(false),
						Value:    to.Ptr("mytestvalue"),
					},
					{
						Name:     to.Ptr("mysecrettestargument"),
						IsSecret: to.Ptr(true),
						Value:    to.Ptr("mysecrettestvalue"),
					}},
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag")},
				IsPushEnabled: to.Ptr(true),
				NoCache:       to.Ptr(false),
			},
			Trigger: &armcontainerregistry.TriggerProperties{
				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
					Name:                     to.Ptr("myBaseImageTrigger"),
					BaseImageTriggerType:     to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
					UpdateTriggerEndpoint:    to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"),
					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
				},
				SourceTriggers: []*armcontainerregistry.SourceTrigger{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceProperties{
							Branch:        to.Ptr("master"),
							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
							SourceControlAuthProperties: &armcontainerregistry.AuthInfo{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
				TimerTriggers: []*armcontainerregistry.TimerTrigger{
					{
						Name:     to.Ptr("myTimerTrigger"),
						Schedule: to.Ptr("30 9 * * 1-5"),
					}},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeUserAssigned),
	// 		UserAssignedIdentities: map[string]*armcontainerregistry.UserIdentityProperties{
	// 			"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armcontainerregistry.UserIdentityProperties{
	// 				ClientID: to.Ptr("d3ce1bc2-f7d7-4a5b-9979-950f4e57680e"),
	// 				PrincipalID: to.Ptr("b6p9f58b-6fbf-4efd-a7e0-fvd46911a466"),
	// 			},
	// 			"/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2": &armcontainerregistry.UserIdentityProperties{
	// 				ClientID: to.Ptr("e35621a5-f615-4a20-940e-de8a84b15abc"),
	// 				PrincipalID: to.Ptr("e45e3m7c-176e-416a-b466-0c5ec8298f8a"),
	// 			},
	// 		},
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		IsSystemTask: to.Ptr(false),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksCreateWithUserIdentitiesWithSystemIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "mytTask", armcontainerregistry.Task{
		Location: to.Ptr("eastus"),
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
		Identity: &armcontainerregistry.IdentityProperties{
			Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
		},
		Properties: &armcontainerregistry.TaskProperties{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](2),
			},
			IsSystemTask: to.Ptr(false),
			Platform: &armcontainerregistry.PlatformProperties{
				Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
				OS:           to.Ptr(armcontainerregistry.OSLinux),
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStep{
				Type:        to.Ptr(armcontainerregistry.StepTypeDocker),
				ContextPath: to.Ptr("src"),
				Arguments: []*armcontainerregistry.Argument{
					{
						Name:     to.Ptr("mytestargument"),
						IsSecret: to.Ptr(false),
						Value:    to.Ptr("mytestvalue"),
					},
					{
						Name:     to.Ptr("mysecrettestargument"),
						IsSecret: to.Ptr(true),
						Value:    to.Ptr("mysecrettestvalue"),
					}},
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag")},
				IsPushEnabled: to.Ptr(true),
				NoCache:       to.Ptr(false),
			},
			Trigger: &armcontainerregistry.TriggerProperties{
				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
					Name:                 to.Ptr("myBaseImageTrigger"),
					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
				},
				SourceTriggers: []*armcontainerregistry.SourceTrigger{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceProperties{
							Branch:        to.Ptr("master"),
							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
							SourceControlAuthProperties: &armcontainerregistry.AuthInfo{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
				TimerTriggers: []*armcontainerregistry.TimerTrigger{
					{
						Name:     to.Ptr("myTimerTrigger"),
						Schedule: to.Ptr("30 9 * * 1-5"),
					}},
			},
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		IsSystemTask: to.Ptr(false),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

func (*TasksClient) BeginDelete

func (client *TasksClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientBeginDeleteOptions) (*runtime.Poller[TasksClientDeleteResponse], error)

BeginDelete - Deletes a specified task. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskName - The name of the container registry task.
  • options - TasksClientBeginDeleteOptions contains the optional parameters for the TasksClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myTask", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*TasksClient) BeginUpdate

func (client *TasksClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters TaskUpdateParameters, options *TasksClientBeginUpdateOptions) (*runtime.Poller[TasksClientUpdateResponse], error)

BeginUpdate - Updates a task with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskName - The name of the container registry task.
  • taskUpdateParameters - The parameters for updating a task.
  • options - TasksClientBeginUpdateOptions contains the optional parameters for the TasksClient.BeginUpdate method.
Example (TasksUpdate)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{
		Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](3),
			},
			Credentials: &armcontainerregistry.Credentials{
				CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
					"myregistry.azurecr.io": {
						Identity: to.Ptr("[system]"),
						Password: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret),
							Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/password"),
						},
						UserName: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
							Value: to.Ptr("username"),
						},
					},
				},
			},
			LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
			Status:      to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStepUpdateParameters{
				Type:           to.Ptr(armcontainerregistry.StepTypeDocker),
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag1")},
			},
			Trigger: &armcontainerregistry.TriggerUpdateParameters{
				SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceUpdateParameters{
							SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
			},
		},
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](3),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azurecr.io": nil,
	// 			},
	// 		},
	// 		LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag1")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksUpdateQuickTask)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_QuickTask.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "quicktask", armcontainerregistry.TaskUpdateParameters{
		Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{
			LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
			Status:      to.Ptr(armcontainerregistry.TaskStatusEnabled),
		},
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		LogTemplate: to.Ptr("acr/tasks:{{.Run.OS}}"),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 	},
	// }
}
Output:

Example (TasksUpdateWithKeyVaultCustomCredentials)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{
		Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](3),
			},
			Credentials: &armcontainerregistry.Credentials{
				CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
					"myregistry.azurecr.io": {
						Identity: to.Ptr("[system]"),
						Password: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret),
							Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/password"),
						},
						UserName: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret),
							Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/username"),
						},
					},
				},
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStepUpdateParameters{
				Type:           to.Ptr(armcontainerregistry.StepTypeDocker),
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag1")},
			},
			Trigger: &armcontainerregistry.TriggerUpdateParameters{
				SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceUpdateParameters{
							SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
			},
		},
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](3),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azurecr.io": nil,
	// 			},
	// 		},
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag1")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksUpdateWithMsiCustomCredentials)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{
		Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](3),
			},
			Credentials: &armcontainerregistry.Credentials{
				CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
					"myregistry.azurecr.io": {
						Identity: to.Ptr("[system]"),
					},
				},
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStepUpdateParameters{
				Type:           to.Ptr(armcontainerregistry.StepTypeDocker),
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag1")},
			},
			Trigger: &armcontainerregistry.TriggerUpdateParameters{
				SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceUpdateParameters{
							SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
			},
		},
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](3),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azure.io": nil,
	// 			},
	// 		},
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag1")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

Example (TasksUpdateWithOpaqueCustomCredentials)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTasksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myTask", armcontainerregistry.TaskUpdateParameters{
		Properties: &armcontainerregistry.TaskPropertiesUpdateParameters{
			AgentConfiguration: &armcontainerregistry.AgentProperties{
				CPU: to.Ptr[int32](3),
			},
			Credentials: &armcontainerregistry.Credentials{
				CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
					"myregistry.azurecr.io": {
						Password: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
							Value: to.Ptr("***"),
						},
						UserName: &armcontainerregistry.SecretObject{
							Type:  to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
							Value: to.Ptr("username"),
						},
					},
				},
			},
			Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
			Step: &armcontainerregistry.DockerBuildStepUpdateParameters{
				Type:           to.Ptr(armcontainerregistry.StepTypeDocker),
				DockerFilePath: to.Ptr("src/DockerFile"),
				ImageNames: []*string{
					to.Ptr("azurerest:testtag1")},
			},
			Trigger: &armcontainerregistry.TriggerUpdateParameters{
				SourceTriggers: []*armcontainerregistry.SourceTriggerUpdateParameters{
					{
						Name: to.Ptr("mySourceTrigger"),
						SourceRepository: &armcontainerregistry.SourceUpdateParameters{
							SourceControlAuthProperties: &armcontainerregistry.AuthInfoUpdateParameters{
								Token:     to.Ptr("xxxxx"),
								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
							},
						},
						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
					}},
			},
		},
		Tags: map[string]*string{
			"testkey": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](3),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azure.io": nil,
	// 			},
	// 		},
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag1")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

func (*TasksClient) Get

func (client *TasksClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientGetOptions) (TasksClientGetResponse, error)

Get - Get the properties of a specified task. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskName - The name of the container registry task.
  • options - TasksClientGetOptions contains the optional parameters for the TasksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTasksClient().Get(ctx, "myResourceGroup", "myRegistry", "myTask", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Name: to.Ptr("myTask"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
	// 	ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azure.io": nil,
	// 			},
	// 		},
	// 		IsSystemTask: to.Ptr(false),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

func (*TasksClient) GetDetails

func (client *TasksClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskName string, options *TasksClientGetDetailsOptions) (TasksClientGetDetailsResponse, error)

GetDetails - Returns a task with extended information that includes all secrets. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • taskName - The name of the container registry task.
  • options - TasksClientGetDetailsOptions contains the optional parameters for the TasksClient.GetDetails method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksGetDetails.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTasksClient().GetDetails(ctx, "myResourceGroup", "myRegistry", "myTask", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Task = armcontainerregistry.Task{
	// 	Location: to.Ptr("eastus"),
	// 	Tags: map[string]*string{
	// 		"testkey": to.Ptr("value"),
	// 	},
	// 	Identity: &armcontainerregistry.IdentityProperties{
	// 		Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
	// 		TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
	// 	},
	// 	Properties: &armcontainerregistry.TaskProperties{
	// 		AgentConfiguration: &armcontainerregistry.AgentProperties{
	// 			CPU: to.Ptr[int32](2),
	// 		},
	// 		Credentials: &armcontainerregistry.Credentials{
	// 			CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
	// 				"myregistry.azure-test.io": &armcontainerregistry.CustomRegistryCredentials{
	// 					Identity: to.Ptr("[system]"),
	// 					Password: &armcontainerregistry.SecretObject{
	// 						Type: to.Ptr(armcontainerregistry.SecretObjectTypeVaultsecret),
	// 						Value: to.Ptr("https://myacbvault.vault.azure.net/secrets/username"),
	// 					},
	// 					UserName: &armcontainerregistry.SecretObject{
	// 						Type: to.Ptr(armcontainerregistry.SecretObjectTypeOpaque),
	// 						Value: to.Ptr("username"),
	// 					},
	// 				},
	// 			},
	// 		},
	// 		IsSystemTask: to.Ptr(false),
	// 		Platform: &armcontainerregistry.PlatformProperties{
	// 			Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
	// 			OS: to.Ptr(armcontainerregistry.OSLinux),
	// 		},
	// 		Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
	// 		Step: &armcontainerregistry.DockerBuildStep{
	// 			Type: to.Ptr(armcontainerregistry.StepTypeDocker),
	// 			ContextPath: to.Ptr("src"),
	// 			Arguments: []*armcontainerregistry.Argument{
	// 				{
	// 					Name: to.Ptr("mytestargument"),
	// 					IsSecret: to.Ptr(false),
	// 					Value: to.Ptr("mytestvalue"),
	// 				},
	// 				{
	// 					Name: to.Ptr("mysecrettestargument"),
	// 					IsSecret: to.Ptr(true),
	// 					Value: to.Ptr("mysecrettestvalue"),
	// 			}},
	// 			DockerFilePath: to.Ptr("src/DockerFile"),
	// 			ImageNames: []*string{
	// 				to.Ptr("azurerest:testtag")},
	// 				IsPushEnabled: to.Ptr(true),
	// 				NoCache: to.Ptr(false),
	// 			},
	// 			Trigger: &armcontainerregistry.TriggerProperties{
	// 				BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
	// 					Name: to.Ptr("myBaseImageTrigger"),
	// 					BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
	// 					Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					UpdateTriggerEndpoint: to.Ptr("https://user:pass@mycicd.webhook.com?token=foo"),
	// 					UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeToken),
	// 				},
	// 				SourceTriggers: []*armcontainerregistry.SourceTrigger{
	// 					{
	// 						Name: to.Ptr("mySourceTrigger"),
	// 						SourceRepository: &armcontainerregistry.SourceProperties{
	// 							Branch: to.Ptr("master"),
	// 							RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
	// 							SourceControlAuthProperties: &armcontainerregistry.AuthInfo{
	// 								Token: to.Ptr("xxxxx"),
	// 								TokenType: to.Ptr(armcontainerregistry.TokenTypePAT),
	// 							},
	// 							SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
	// 						},
	// 						SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
	// 							to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 					TimerTriggers: []*armcontainerregistry.TimerTrigger{
	// 						{
	// 							Name: to.Ptr("myTimerTrigger"),
	// 							Schedule: to.Ptr("30 9 * * 1-5"),
	// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
	// 					}},
	// 				},
	// 			},
	// 		}
}
Output:

func (*TasksClient) NewListPager added in v0.5.0

func (client *TasksClient) NewListPager(resourceGroupName string, registryName string, options *TasksClientListOptions) *runtime.Pager[TasksClientListResponse]

NewListPager - Lists all the tasks for a specified container registry.

Generated from API version 2019-06-01-preview

  • resourceGroupName - The name of the resource group to which the container registry belongs.
  • registryName - The name of the container registry.
  • options - TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TasksList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTasksClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.TaskListResult = armcontainerregistry.TaskListResult{
		// 	Value: []*armcontainerregistry.Task{
		// 		{
		// 			Name: to.Ptr("myTask"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/tasks"),
		// 			ID: to.Ptr("/subscriptions/4385cf00-2d3a-425a-832f-f4285b1c9dce/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tasks/myTask"),
		// 			Location: to.Ptr("eastus"),
		// 			Tags: map[string]*string{
		// 				"testkey": to.Ptr("value"),
		// 			},
		// 			Identity: &armcontainerregistry.IdentityProperties{
		// 				Type: to.Ptr(armcontainerregistry.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("fa153151-b9fd-46f4-9088-5e6600f2689v"),
		// 				TenantID: to.Ptr("f686d426-8d16-42db-81b7-abu4gm510ccd"),
		// 			},
		// 			Properties: &armcontainerregistry.TaskProperties{
		// 				AgentConfiguration: &armcontainerregistry.AgentProperties{
		// 					CPU: to.Ptr[int32](2),
		// 				},
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-25T06:54:23.536Z"); return t}()),
		// 				Credentials: &armcontainerregistry.Credentials{
		// 					CustomRegistries: map[string]*armcontainerregistry.CustomRegistryCredentials{
		// 						"myRegistry.azure.io": nil,
		// 					},
		// 				},
		// 				IsSystemTask: to.Ptr(false),
		// 				Platform: &armcontainerregistry.PlatformProperties{
		// 					Architecture: to.Ptr(armcontainerregistry.ArchitectureAmd64),
		// 					OS: to.Ptr(armcontainerregistry.OSLinux),
		// 				},
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				Status: to.Ptr(armcontainerregistry.TaskStatusEnabled),
		// 				Step: &armcontainerregistry.DockerBuildStep{
		// 					Type: to.Ptr(armcontainerregistry.StepTypeDocker),
		// 					ContextPath: to.Ptr("src"),
		// 					Arguments: []*armcontainerregistry.Argument{
		// 						{
		// 							Name: to.Ptr("mytestargument"),
		// 							IsSecret: to.Ptr(false),
		// 							Value: to.Ptr("mytestvalue"),
		// 					}},
		// 					DockerFilePath: to.Ptr("src/DockerFile"),
		// 					ImageNames: []*string{
		// 						to.Ptr("azurerest:testtag")},
		// 						IsPushEnabled: to.Ptr(true),
		// 						NoCache: to.Ptr(false),
		// 					},
		// 					Trigger: &armcontainerregistry.TriggerProperties{
		// 						BaseImageTrigger: &armcontainerregistry.BaseImageTrigger{
		// 							Name: to.Ptr("myBaseImageTrigger"),
		// 							BaseImageTriggerType: to.Ptr(armcontainerregistry.BaseImageTriggerTypeRuntime),
		// 							Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
		// 							UpdateTriggerPayloadType: to.Ptr(armcontainerregistry.UpdateTriggerPayloadTypeDefault),
		// 						},
		// 						SourceTriggers: []*armcontainerregistry.SourceTrigger{
		// 							{
		// 								Name: to.Ptr("mySourceTrigger"),
		// 								SourceRepository: &armcontainerregistry.SourceProperties{
		// 									Branch: to.Ptr("master"),
		// 									RepositoryURL: to.Ptr("https://github.com/Azure/azure-rest-api-specs"),
		// 									SourceControlType: to.Ptr(armcontainerregistry.SourceControlTypeGithub),
		// 								},
		// 								SourceTriggerEvents: []*armcontainerregistry.SourceTriggerEvent{
		// 									to.Ptr(armcontainerregistry.SourceTriggerEventCommit)},
		// 									Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
		// 							}},
		// 							TimerTriggers: []*armcontainerregistry.TimerTrigger{
		// 								{
		// 									Name: to.Ptr("myTimerTrigger"),
		// 									Schedule: to.Ptr("30 9 * * 1-5"),
		// 									Status: to.Ptr(armcontainerregistry.TriggerStatusEnabled),
		// 							}},
		// 						},
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type TasksClientBeginCreateOptions added in v0.3.0

type TasksClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TasksClientBeginCreateOptions contains the optional parameters for the TasksClient.BeginCreate method.

type TasksClientBeginDeleteOptions added in v0.3.0

type TasksClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TasksClientBeginDeleteOptions contains the optional parameters for the TasksClient.BeginDelete method.

type TasksClientBeginUpdateOptions added in v0.3.0

type TasksClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TasksClientBeginUpdateOptions contains the optional parameters for the TasksClient.BeginUpdate method.

type TasksClientCreateResponse added in v0.3.0

type TasksClientCreateResponse struct {
	// The task that has the ARM resource and task properties.
	// The task will have all information to schedule a run against it.
	Task
}

TasksClientCreateResponse contains the response from method TasksClient.BeginCreate.

type TasksClientDeleteResponse added in v0.3.0

type TasksClientDeleteResponse struct {
}

TasksClientDeleteResponse contains the response from method TasksClient.BeginDelete.

type TasksClientGetDetailsOptions added in v0.3.0

type TasksClientGetDetailsOptions struct {
}

TasksClientGetDetailsOptions contains the optional parameters for the TasksClient.GetDetails method.

type TasksClientGetDetailsResponse added in v0.3.0

type TasksClientGetDetailsResponse struct {
	// The task that has the ARM resource and task properties.
	// The task will have all information to schedule a run against it.
	Task
}

TasksClientGetDetailsResponse contains the response from method TasksClient.GetDetails.

type TasksClientGetOptions added in v0.3.0

type TasksClientGetOptions struct {
}

TasksClientGetOptions contains the optional parameters for the TasksClient.Get method.

type TasksClientGetResponse added in v0.3.0

type TasksClientGetResponse struct {
	// The task that has the ARM resource and task properties.
	// The task will have all information to schedule a run against it.
	Task
}

TasksClientGetResponse contains the response from method TasksClient.Get.

type TasksClientListOptions added in v0.3.0

type TasksClientListOptions struct {
}

TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method.

type TasksClientListResponse added in v0.3.0

type TasksClientListResponse struct {
	// The collection of tasks.
	TaskListResult
}

TasksClientListResponse contains the response from method TasksClient.NewListPager.

type TasksClientUpdateResponse added in v0.3.0

type TasksClientUpdateResponse struct {
	// The task that has the ARM resource and task properties.
	// The task will have all information to schedule a run against it.
	Task
}

TasksClientUpdateResponse contains the response from method TasksClient.BeginUpdate.

type TimerTrigger

type TimerTrigger struct {
	// REQUIRED; The name of the trigger.
	Name *string

	// REQUIRED; The CRON expression for the task schedule
	Schedule *string

	// The current status of trigger.
	Status *TriggerStatus
}

TimerTrigger - The properties of a timer trigger.

func (TimerTrigger) MarshalJSON added in v0.7.0

func (t TimerTrigger) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TimerTrigger.

func (*TimerTrigger) UnmarshalJSON added in v0.7.0

func (t *TimerTrigger) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TimerTrigger.

type TimerTriggerDescriptor

type TimerTriggerDescriptor struct {
	// The occurrence that triggered the run.
	ScheduleOccurrence *string

	// The timer trigger name that caused the run.
	TimerTriggerName *string
}

func (TimerTriggerDescriptor) MarshalJSON added in v0.7.0

func (t TimerTriggerDescriptor) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TimerTriggerDescriptor.

func (*TimerTriggerDescriptor) UnmarshalJSON added in v0.7.0

func (t *TimerTriggerDescriptor) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerDescriptor.

type TimerTriggerUpdateParameters

type TimerTriggerUpdateParameters struct {
	// REQUIRED; The name of the trigger.
	Name *string

	// The CRON expression for the task schedule
	Schedule *string

	// The current status of trigger.
	Status *TriggerStatus
}

TimerTriggerUpdateParameters - The properties for updating a timer trigger.

func (TimerTriggerUpdateParameters) MarshalJSON added in v0.7.0

func (t TimerTriggerUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TimerTriggerUpdateParameters.

func (*TimerTriggerUpdateParameters) UnmarshalJSON added in v0.7.0

func (t *TimerTriggerUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TimerTriggerUpdateParameters.

type Token

type Token struct {
	// The properties of the token.
	Properties *TokenProperties

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Token - An object that represents a token for a container registry.

func (Token) MarshalJSON added in v0.7.0

func (t Token) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Token.

func (*Token) UnmarshalJSON added in v0.7.0

func (t *Token) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Token.

type TokenCertificate

type TokenCertificate struct {
	// Base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token.
	EncodedPemCertificate *string

	// The expiry datetime of the certificate.
	Expiry *time.Time
	Name   *TokenCertificateName

	// The thumbprint of the certificate.
	Thumbprint *string
}

TokenCertificate - The properties of a certificate used for authenticating a token.

func (TokenCertificate) MarshalJSON

func (t TokenCertificate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenCertificate.

func (*TokenCertificate) UnmarshalJSON

func (t *TokenCertificate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenCertificate.

type TokenCertificateName

type TokenCertificateName string
const (
	TokenCertificateNameCertificate1 TokenCertificateName = "certificate1"
	TokenCertificateNameCertificate2 TokenCertificateName = "certificate2"
)

func PossibleTokenCertificateNameValues

func PossibleTokenCertificateNameValues() []TokenCertificateName

PossibleTokenCertificateNameValues returns the possible values for the TokenCertificateName const type.

type TokenCredentialsProperties

type TokenCredentialsProperties struct {
	Certificates []*TokenCertificate
	Passwords    []*TokenPassword
}

TokenCredentialsProperties - The properties of the credentials that can be used for authenticating the token.

func (TokenCredentialsProperties) MarshalJSON

func (t TokenCredentialsProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenCredentialsProperties.

func (*TokenCredentialsProperties) UnmarshalJSON added in v0.7.0

func (t *TokenCredentialsProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenCredentialsProperties.

type TokenListResult

type TokenListResult struct {
	// The URI that can be used to request the next list of tokens.
	NextLink *string

	// The list of tokens. Since this list may be incomplete, the nextLink field should be used to request the next list of tokens.
	Value []*Token
}

TokenListResult - The result of a request to list tokens for a container registry.

func (TokenListResult) MarshalJSON

func (t TokenListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenListResult.

func (*TokenListResult) UnmarshalJSON added in v0.7.0

func (t *TokenListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenListResult.

type TokenPassword

type TokenPassword struct {
	// The creation datetime of the password.
	CreationTime *time.Time

	// The expiry datetime of the password.
	Expiry *time.Time

	// The password name "password1" or "password2"
	Name *TokenPasswordName

	// READ-ONLY; The password value.
	Value *string
}

TokenPassword - The password that will be used for authenticating the token of a container registry.

func (TokenPassword) MarshalJSON

func (t TokenPassword) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenPassword.

func (*TokenPassword) UnmarshalJSON

func (t *TokenPassword) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenPassword.

type TokenPasswordName

type TokenPasswordName string

TokenPasswordName - The password name "password1" or "password2"

const (
	TokenPasswordNamePassword1 TokenPasswordName = "password1"
	TokenPasswordNamePassword2 TokenPasswordName = "password2"
)

func PossibleTokenPasswordNameValues

func PossibleTokenPasswordNameValues() []TokenPasswordName

PossibleTokenPasswordNameValues returns the possible values for the TokenPasswordName const type.

type TokenProperties

type TokenProperties struct {
	// The credentials that can be used for authenticating the token.
	Credentials *TokenCredentialsProperties

	// The resource ID of the scope map to which the token will be associated with.
	ScopeMapID *string

	// The status of the token example enabled or disabled.
	Status *TokenStatus

	// READ-ONLY; The creation date of scope map.
	CreationDate *time.Time

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState
}

TokenProperties - The properties of a token.

func (TokenProperties) MarshalJSON

func (t TokenProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenProperties.

func (*TokenProperties) UnmarshalJSON

func (t *TokenProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenProperties.

type TokenStatus

type TokenStatus string

TokenStatus - The status of the token example enabled or disabled.

const (
	TokenStatusDisabled TokenStatus = "disabled"
	TokenStatusEnabled  TokenStatus = "enabled"
)

func PossibleTokenStatusValues

func PossibleTokenStatusValues() []TokenStatus

PossibleTokenStatusValues returns the possible values for the TokenStatus const type.

type TokenType

type TokenType string

TokenType - The type of Auth token.

const (
	TokenTypeOAuth TokenType = "OAuth"
	TokenTypePAT   TokenType = "PAT"
)

func PossibleTokenTypeValues

func PossibleTokenTypeValues() []TokenType

PossibleTokenTypeValues returns the possible values for the TokenType const type.

type TokenUpdateParameters

type TokenUpdateParameters struct {
	// The properties of the token update parameters.
	Properties *TokenUpdateProperties
}

TokenUpdateParameters - The parameters for updating a token.

func (TokenUpdateParameters) MarshalJSON

func (t TokenUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenUpdateParameters.

func (*TokenUpdateParameters) UnmarshalJSON added in v0.7.0

func (t *TokenUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenUpdateParameters.

type TokenUpdateProperties

type TokenUpdateProperties struct {
	// The credentials that can be used for authenticating the token.
	Credentials *TokenCredentialsProperties

	// The resource ID of the scope map to which the token will be associated with.
	ScopeMapID *string

	// The status of the token example enabled or disabled.
	Status *TokenStatus
}

TokenUpdateProperties - The parameters for updating token properties.

func (TokenUpdateProperties) MarshalJSON added in v0.7.0

func (t TokenUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TokenUpdateProperties.

func (*TokenUpdateProperties) UnmarshalJSON added in v0.7.0

func (t *TokenUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TokenUpdateProperties.

type TokensClient

type TokensClient struct {
	// contains filtered or unexported fields
}

TokensClient contains the methods for the Tokens group. Don't use this type directly, use NewTokensClient() instead.

func NewTokensClient

func NewTokensClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TokensClient, error)

NewTokensClient creates a new instance of TokensClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*TokensClient) BeginCreate

func (client *TokensClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenCreateParameters Token, options *TokensClientBeginCreateOptions) (*runtime.Poller[TokensClientCreateResponse], error)

BeginCreate - Creates a token for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • tokenName - The name of the token.
  • tokenCreateParameters - The parameters for creating a token.
  • options - TokensClientBeginCreateOptions contains the optional parameters for the TokensClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTokensClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.Token{
		Properties: &armcontainerregistry.TokenProperties{
			Credentials: &armcontainerregistry.TokenCredentialsProperties{
				Certificates: []*armcontainerregistry.TokenCertificate{
					{
						Name:                  to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1),
						EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="),
					}},
			},
			ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
			Status:     to.Ptr(armcontainerregistry.TokenStatusDisabled),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Token = armcontainerregistry.Token{
	// 	Name: to.Ptr("myToken"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"),
	// 	Properties: &armcontainerregistry.TokenProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 		Credentials: &armcontainerregistry.TokenCredentialsProperties{
	// 			Certificates: []*armcontainerregistry.TokenCertificate{
	// 				{
	// 					Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1),
	// 					Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-04T15:32:48.070Z"); return t}()),
	// 					Thumbprint: to.Ptr("feeb79a888bf1415f8e17c4965a2a5bb5c8a2ff7"),
	// 			}},
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
	// 		Status: to.Ptr(armcontainerregistry.TokenStatusDisabled),
	// 	},
	// }
}
Output:

func (*TokensClient) BeginDelete

func (client *TokensClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, tokenName string, options *TokensClientBeginDeleteOptions) (*runtime.Poller[TokensClientDeleteResponse], error)

BeginDelete - Deletes a token from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • tokenName - The name of the token.
  • options - TokensClientBeginDeleteOptions contains the optional parameters for the TokensClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTokensClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myToken", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*TokensClient) BeginUpdate

func (client *TokensClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, tokenName string, tokenUpdateParameters TokenUpdateParameters, options *TokensClientBeginUpdateOptions) (*runtime.Poller[TokensClientUpdateResponse], error)

BeginUpdate - Updates a token with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • tokenName - The name of the token.
  • tokenUpdateParameters - The parameters for updating a token.
  • options - TokensClientBeginUpdateOptions contains the optional parameters for the TokensClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewTokensClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myToken", armcontainerregistry.TokenUpdateParameters{
		Properties: &armcontainerregistry.TokenUpdateProperties{
			Credentials: &armcontainerregistry.TokenCredentialsProperties{
				Certificates: []*armcontainerregistry.TokenCertificate{
					{
						Name:                  to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1),
						EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="),
					}},
			},
			ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Token = armcontainerregistry.Token{
	// 	Name: to.Ptr("myToken"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"),
	// 	Properties: &armcontainerregistry.TokenProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 		Credentials: &armcontainerregistry.TokenCredentialsProperties{
	// 			Certificates: []*armcontainerregistry.TokenCertificate{
	// 				{
	// 					Name: to.Ptr(armcontainerregistry.TokenCertificateNameCertificate1),
	// 					EncodedPemCertificate: to.Ptr("LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUc3akNDQk5hZ0F3SUJBZ0lURmdBQlR3UVpyZGdmdmhxdzBnQUFBQUZQQkRBTkJna3Foa2lHOXcwQkFRc0YKQURDQml6RUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVApCMUpsWkcxdmJtUXhIakFjQmdOVkJBb1RGVTFwWTNKdmMyOW1kQ0JEYjNKd2IzSmhkR2x2YmpFVk1CTUdBMVVFCkN4TU1UV2xqY205emIyWjBJRWxVTVI0d0hBWURWUVFERXhWTmFXTnliM052Wm5RZ1NWUWdWRXhUSUVOQklEUXcKSGhjTk1UZ3dOREV5TWpJek1qUTRXaGNOTWpBd05ERXlNakl6TWpRNFdqQTVNVGN3TlFZRFZRUURFeTV6WlhKMgphV05sWTJ4cFpXNTBZMlZ5ZEMxd1lYSjBibVZ5TG0xaGJtRm5aVzFsYm5RdVlYcDFjbVV1WTI5dE1JSUJJakFOCkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTBSYjdJcHpxMmR4emhhbVpyS1ZDakMzeTQyYlYKUnNIY2pCUTFuSDBHZ1puUDhXeDZDSE1mWThybkVJQzRLeVRRYkJXVzhnNXlmc3NSQ0ZXbFpxYjR6SkRXS0pmTgpGSmNMUm9LNnhwTktZYVZVTkVlT25IdUxHYTM0ZlA0VjBFRjZybzdvbkRLME5zanhjY1dZVzRNVXVzc0xrQS94CkUrM2RwU1REdk1KcjJoWUpsVnFDcVR6blQvbmZaVUZzQUVEQnp5MUpOOHZiZDlIR2czc2Myd0x4dk95cFJOc0gKT1V3V2pmN2xzWWZleEVlcWkzY29EeHc2alpLVWEyVkdsUnBpTkowMjhBQitYSi9TU1FVNVBsd0JBbU9TT3ovRApGY0NKdGpPZlBqU1NKckFIQVV3SHU3RzlSV05JTFBwYU9zQ1J5eitETE5zNGpvNlEvUUg4d1lManJRSURBUUFCCm80SUNtakNDQXBZd0N3WURWUjBQQkFRREFnU3dNQjBHQTFVZEpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUYKQlFjREFUQWRCZ05WSFE0RUZnUVVlbEdkVVJrZzJoSFFOWEQ4WUc4L3drdjJVT0F3SHdZRFZSMGpCQmd3Rm9BVQplbnVNd2Mvbm9Nb2MxR3Y2KytFend3OGFvcDB3Z2F3R0ExVWRId1NCcERDQm9UQ0JucUNCbTZDQm1JWkxhSFIwCmNEb3ZMMjF6WTNKc0xtMXBZM0p2YzI5bWRDNWpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjAKSlRJd1NWUWxNakJVVEZNbE1qQkRRU1V5TURRdVkzSnNoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1agpiMjB2Y0d0cEwyMXpZMjl5Y0M5amNtd3ZUV2xqY205emIyWjBKVEl3U1ZRbE1qQlVURk1sTWpCRFFTVXlNRFF1ClkzSnNNSUdGQmdnckJnRUZCUWNCQVFSNU1IY3dVUVlJS3dZQkJRVUhNQUtHUldoMGRIQTZMeTkzZDNjdWJXbGoKY205emIyWjBMbU52YlM5d2Eya3ZiWE5qYjNKd0wwMXBZM0p2YzI5bWRDVXlNRWxVSlRJd1ZFeFRKVEl3UTBFbApNakEwTG1OeWREQWlCZ2dyQmdFRkJRY3dBWVlXYUhSMGNEb3ZMMjlqYzNBdWJYTnZZM053TG1OdmJUQStCZ2tyCkJnRUVBWUkzRlFjRU1UQXZCaWNyQmdFRUFZSTNGUWlIMm9aMWcrN1pBWUxKaFJ1QnRaNWhoZlRyWUlGZGhOTGYKUW9Mbmszb0NBV1FDQVIwd1RRWURWUjBnQkVZd1JEQkNCZ2tyQmdFRUFZSTNLZ0V3TlRBekJnZ3JCZ0VGQlFjQwpBUlluYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVM5dGMyTnZjbkF2WTNCek1DY0dDU3NHCkFRUUJnamNWQ2dRYU1CZ3dDZ1lJS3dZQkJRVUhBd0l3Q2dZSUt3WUJCUVVIQXdFd09RWURWUjBSQkRJd01JSXUKYzJWeWRtbGpaV05zYVdWdWRHTmxjblF0Y0dGeWRHNWxjaTV0WVc1aFoyVnRaVzUwTG1GNmRYSmxMbU52YlRBTgpCZ2txaGtpRzl3MEJBUXNGQUFPQ0FnRUFIVXIzbk1vdUI5WWdDUlRWYndUTllIS2RkWGJkSW1GUXNDYys4T1g1CjE5c0N6dFFSR05iSXEwVW1Ba01MbFVvWTIxckh4ZXdxU2hWczFhL2RwaFh5Tk1pcUdaU2QzU1BtYzZscitqUFQKNXVEREs0MUlWeXN0K2VUNlpyazFvcCtMVmdkeS9EU2lyNzVqcWZFY016bS82bU8rNnFNeWRLTWtVYmM5K3JHVwphUkpUcjRWUUdIRmEwNEIwZVZpNUd4MG9pL2RpZDNSaXg2aXJMMjFJSGEwYjN6c1hzZHpHU0R2K3hqL2Q2S0l4Ckdrd2FhYmZvU1NoQnFqaFNlQ0VyZXFlb1RpYjljdGw0MGRVdUp3THl4bjhHS2N6K3AvMEJUOEIxU3lYK01OQ2wKY0pkMjVtMjhLajY2TGUxOEVyeFlJYXZJVGVGa3Y2eGZjdkEvcHladDdPaU41QTlGQk1IUmpQK1kyZ2tvdjMrcQpISFRUZG4xNnlRajduNit3YlFHNGVleXc0YisyQkRLcUxNVFU2ZmlSQ3ZPM2FPZVBLSFVNN3R4b1FidWl6Z3NzCkNiMzl3QnJOTEZsMkJLQ1RkSCtkSU9oZVJiSkZvbmlwOGRPOUVFZWdSSG9lQW54ZUlYTFBrdXMzTzEvZjRhNkIKWHQ3RG5BUm8xSzJmeEp3VXRaU2MvR3dFSjU5NzlnRXlEa3pDZEVsLzdpWE9QZXVjTXhlM2xVM2pweUtsNERUaApjSkJqQytqNGpLWTFrK1U4b040aGdqYnJISUx6Vnd2eU15OU5KS290U3BMSjQxeHdPOHlGangxalFTT3Bxc0N1ClFhUFUvTjhSZ0hxWjBGTkFzS3dNUmZ6WmdXanRCNzRzYUVEdk5jVmNuNFhCQnFNSG0ydHo2Uzk3d3kxZGt0cTgKSE5BPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="),
	// 			}},
	// 		},
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myNewScopeMap"),
	// 		Status: to.Ptr(armcontainerregistry.TokenStatusEnabled),
	// 	},
	// }
}
Output:

func (*TokensClient) Get

func (client *TokensClient) Get(ctx context.Context, resourceGroupName string, registryName string, tokenName string, options *TokensClientGetOptions) (TokensClientGetResponse, error)

Get - Gets the properties of the specified token. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • tokenName - The name of the token.
  • options - TokensClientGetOptions contains the optional parameters for the TokensClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewTokensClient().Get(ctx, "myResourceGroup", "myRegistry", "myToken", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Token = armcontainerregistry.Token{
	// 	Name: to.Ptr("myToken"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"),
	// 	Properties: &armcontainerregistry.TokenProperties{
	// 		CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
	// 		ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 		ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
	// 		Status: to.Ptr(armcontainerregistry.TokenStatusEnabled),
	// 	},
	// }
}
Output:

func (*TokensClient) NewListPager added in v0.5.0

func (client *TokensClient) NewListPager(resourceGroupName string, registryName string, options *TokensClientListOptions) *runtime.Pager[TokensClientListResponse]

NewListPager - Lists all the tokens for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - TokensClientListOptions contains the optional parameters for the TokensClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/TokenList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewTokensClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.TokenListResult = armcontainerregistry.TokenListResult{
		// 	Value: []*armcontainerregistry.Token{
		// 		{
		// 			Name: to.Ptr("myToken"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/tokens"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/tokens/myToken"),
		// 			Properties: &armcontainerregistry.TokenProperties{
		// 				CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
		// 				ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 				ScopeMapID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/scopeMaps/myScopeMap"),
		// 				Status: to.Ptr(armcontainerregistry.TokenStatusEnabled),
		// 			},
		// 	}},
		// }
	}
}
Output:

type TokensClientBeginCreateOptions added in v0.4.0

type TokensClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TokensClientBeginCreateOptions contains the optional parameters for the TokensClient.BeginCreate method.

type TokensClientBeginDeleteOptions added in v0.4.0

type TokensClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TokensClientBeginDeleteOptions contains the optional parameters for the TokensClient.BeginDelete method.

type TokensClientBeginUpdateOptions added in v0.4.0

type TokensClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

TokensClientBeginUpdateOptions contains the optional parameters for the TokensClient.BeginUpdate method.

type TokensClientCreateResponse added in v0.4.0

type TokensClientCreateResponse struct {
	// An object that represents a token for a container registry.
	Token
}

TokensClientCreateResponse contains the response from method TokensClient.BeginCreate.

type TokensClientDeleteResponse added in v0.4.0

type TokensClientDeleteResponse struct {
}

TokensClientDeleteResponse contains the response from method TokensClient.BeginDelete.

type TokensClientGetOptions added in v0.4.0

type TokensClientGetOptions struct {
}

TokensClientGetOptions contains the optional parameters for the TokensClient.Get method.

type TokensClientGetResponse added in v0.4.0

type TokensClientGetResponse struct {
	// An object that represents a token for a container registry.
	Token
}

TokensClientGetResponse contains the response from method TokensClient.Get.

type TokensClientListOptions added in v0.4.0

type TokensClientListOptions struct {
}

TokensClientListOptions contains the optional parameters for the TokensClient.NewListPager method.

type TokensClientListResponse added in v0.4.0

type TokensClientListResponse struct {
	// The result of a request to list tokens for a container registry.
	TokenListResult
}

TokensClientListResponse contains the response from method TokensClient.NewListPager.

type TokensClientUpdateResponse added in v0.4.0

type TokensClientUpdateResponse struct {
	// An object that represents a token for a container registry.
	Token
}

TokensClientUpdateResponse contains the response from method TokensClient.BeginUpdate.

type TriggerProperties

type TriggerProperties struct {
	// The trigger based on base image dependencies.
	BaseImageTrigger *BaseImageTrigger

	// The collection of triggers based on source code repository.
	SourceTriggers []*SourceTrigger

	// The collection of timer triggers.
	TimerTriggers []*TimerTrigger
}

TriggerProperties - The properties of a trigger.

func (TriggerProperties) MarshalJSON

func (t TriggerProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TriggerProperties.

func (*TriggerProperties) UnmarshalJSON added in v0.7.0

func (t *TriggerProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TriggerProperties.

type TriggerStatus

type TriggerStatus string

TriggerStatus - The current status of trigger.

const (
	TriggerStatusDisabled TriggerStatus = "Disabled"
	TriggerStatusEnabled  TriggerStatus = "Enabled"
)

func PossibleTriggerStatusValues

func PossibleTriggerStatusValues() []TriggerStatus

PossibleTriggerStatusValues returns the possible values for the TriggerStatus const type.

type TriggerUpdateParameters

type TriggerUpdateParameters struct {
	// The trigger based on base image dependencies.
	BaseImageTrigger *BaseImageTriggerUpdateParameters

	// The collection of triggers based on source code repository.
	SourceTriggers []*SourceTriggerUpdateParameters

	// The collection of timer triggers.
	TimerTriggers []*TimerTriggerUpdateParameters
}

TriggerUpdateParameters - The properties for updating triggers.

func (TriggerUpdateParameters) MarshalJSON

func (t TriggerUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TriggerUpdateParameters.

func (*TriggerUpdateParameters) UnmarshalJSON added in v0.7.0

func (t *TriggerUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TriggerUpdateParameters.

type TrustPolicy

type TrustPolicy struct {
	// The value that indicates whether the policy is enabled or not.
	Status *PolicyStatus

	// The type of trust policy.
	Type *TrustPolicyType
}

TrustPolicy - The content trust policy for a container registry.

func (TrustPolicy) MarshalJSON added in v0.7.0

func (t TrustPolicy) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TrustPolicy.

func (*TrustPolicy) UnmarshalJSON added in v0.7.0

func (t *TrustPolicy) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TrustPolicy.

type TrustPolicyType

type TrustPolicyType string

TrustPolicyType - The type of trust policy.

const (
	TrustPolicyTypeNotary TrustPolicyType = "Notary"
)

func PossibleTrustPolicyTypeValues

func PossibleTrustPolicyTypeValues() []TrustPolicyType

PossibleTrustPolicyTypeValues returns the possible values for the TrustPolicyType const type.

type UpdateTriggerPayloadType

type UpdateTriggerPayloadType string

UpdateTriggerPayloadType - Type of Payload body for Base image update triggers.

const (
	UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = "Default"
	UpdateTriggerPayloadTypeToken   UpdateTriggerPayloadType = "Token"
)

func PossibleUpdateTriggerPayloadTypeValues

func PossibleUpdateTriggerPayloadTypeValues() []UpdateTriggerPayloadType

PossibleUpdateTriggerPayloadTypeValues returns the possible values for the UpdateTriggerPayloadType const type.

type UserIdentityProperties

type UserIdentityProperties struct {
	// READ-ONLY; The client id of user assigned identity.
	ClientID *string

	// READ-ONLY; The principal id of user assigned identity.
	PrincipalID *string
}

func (UserIdentityProperties) MarshalJSON added in v0.7.0

func (u UserIdentityProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties.

func (*UserIdentityProperties) UnmarshalJSON added in v0.7.0

func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties.

type Variant

type Variant string

Variant - Variant of the CPU.

const (
	VariantV6 Variant = "v6"
	VariantV7 Variant = "v7"
	VariantV8 Variant = "v8"
)

func PossibleVariantValues

func PossibleVariantValues() []Variant

PossibleVariantValues returns the possible values for the Variant const type.

type Webhook

type Webhook struct {
	// REQUIRED; The location of the resource. This cannot be changed after the resource is created.
	Location *string

	// The properties of the webhook.
	Properties *WebhookProperties

	// The tags of the resource.
	Tags map[string]*string

	// READ-ONLY; The resource ID.
	ID *string

	// READ-ONLY; The name of the resource.
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource.
	SystemData *SystemData

	// READ-ONLY; The type of the resource.
	Type *string
}

Webhook - An object that represents a webhook for a container registry.

func (Webhook) MarshalJSON

func (w Webhook) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Webhook.

func (*Webhook) UnmarshalJSON added in v0.7.0

func (w *Webhook) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Webhook.

type WebhookAction

type WebhookAction string
const (
	WebhookActionChartDelete WebhookAction = "chart_delete"
	WebhookActionChartPush   WebhookAction = "chart_push"
	WebhookActionDelete      WebhookAction = "delete"
	WebhookActionPush        WebhookAction = "push"
	WebhookActionQuarantine  WebhookAction = "quarantine"
)

func PossibleWebhookActionValues

func PossibleWebhookActionValues() []WebhookAction

PossibleWebhookActionValues returns the possible values for the WebhookAction const type.

type WebhookCreateParameters

type WebhookCreateParameters struct {
	// REQUIRED; The location of the webhook. This cannot be changed after the resource is created.
	Location *string

	// The properties that the webhook will be created with.
	Properties *WebhookPropertiesCreateParameters

	// The tags for the webhook.
	Tags map[string]*string
}

WebhookCreateParameters - The parameters for creating a webhook.

func (WebhookCreateParameters) MarshalJSON

func (w WebhookCreateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookCreateParameters.

func (*WebhookCreateParameters) UnmarshalJSON added in v0.7.0

func (w *WebhookCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookCreateParameters.

type WebhookListResult

type WebhookListResult struct {
	// The URI that can be used to request the next list of webhooks.
	NextLink *string

	// The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of
	// webhooks.
	Value []*Webhook
}

WebhookListResult - The result of a request to list webhooks for a container registry.

func (WebhookListResult) MarshalJSON

func (w WebhookListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookListResult.

func (*WebhookListResult) UnmarshalJSON added in v0.7.0

func (w *WebhookListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookListResult.

type WebhookProperties

type WebhookProperties struct {
	// REQUIRED; The list of actions that trigger the webhook to post notifications.
	Actions []*WebhookAction

	// The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository
	// 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to
	// 'foo:latest'. Empty means all events.
	Scope *string

	// The status of the webhook at the time the operation was called.
	Status *WebhookStatus

	// READ-ONLY; The provisioning state of the webhook at the time the operation was called.
	ProvisioningState *ProvisioningState
}

WebhookProperties - The properties of a webhook.

func (WebhookProperties) MarshalJSON

func (w WebhookProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookProperties.

func (*WebhookProperties) UnmarshalJSON added in v0.7.0

func (w *WebhookProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookProperties.

type WebhookPropertiesCreateParameters

type WebhookPropertiesCreateParameters struct {
	// REQUIRED; The list of actions that trigger the webhook to post notifications.
	Actions []*WebhookAction

	// REQUIRED; The service URI for the webhook to post notifications.
	ServiceURI *string

	// Custom headers that will be added to the webhook notifications.
	CustomHeaders map[string]*string

	// The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository
	// 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to
	// 'foo:latest'. Empty means all events.
	Scope *string

	// The status of the webhook at the time the operation was called.
	Status *WebhookStatus
}

WebhookPropertiesCreateParameters - The parameters for creating the properties of a webhook.

func (WebhookPropertiesCreateParameters) MarshalJSON

func (w WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookPropertiesCreateParameters.

func (*WebhookPropertiesCreateParameters) UnmarshalJSON added in v0.7.0

func (w *WebhookPropertiesCreateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPropertiesCreateParameters.

type WebhookPropertiesUpdateParameters

type WebhookPropertiesUpdateParameters struct {
	// The list of actions that trigger the webhook to post notifications.
	Actions []*WebhookAction

	// Custom headers that will be added to the webhook notifications.
	CustomHeaders map[string]*string

	// The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository
	// 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to
	// 'foo:latest'. Empty means all events.
	Scope *string

	// The service URI for the webhook to post notifications.
	ServiceURI *string

	// The status of the webhook at the time the operation was called.
	Status *WebhookStatus
}

WebhookPropertiesUpdateParameters - The parameters for updating the properties of a webhook.

func (WebhookPropertiesUpdateParameters) MarshalJSON

func (w WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookPropertiesUpdateParameters.

func (*WebhookPropertiesUpdateParameters) UnmarshalJSON added in v0.7.0

func (w *WebhookPropertiesUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPropertiesUpdateParameters.

type WebhookStatus

type WebhookStatus string

WebhookStatus - The status of the webhook at the time the operation was called.

const (
	WebhookStatusDisabled WebhookStatus = "disabled"
	WebhookStatusEnabled  WebhookStatus = "enabled"
)

func PossibleWebhookStatusValues

func PossibleWebhookStatusValues() []WebhookStatus

PossibleWebhookStatusValues returns the possible values for the WebhookStatus const type.

type WebhookUpdateParameters

type WebhookUpdateParameters struct {
	// The properties that the webhook will be updated with.
	Properties *WebhookPropertiesUpdateParameters

	// The tags for the webhook.
	Tags map[string]*string
}

WebhookUpdateParameters - The parameters for updating a webhook.

func (WebhookUpdateParameters) MarshalJSON

func (w WebhookUpdateParameters) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type WebhookUpdateParameters.

func (*WebhookUpdateParameters) UnmarshalJSON added in v0.7.0

func (w *WebhookUpdateParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type WebhookUpdateParameters.

type WebhooksClient

type WebhooksClient struct {
	// contains filtered or unexported fields
}

WebhooksClient contains the methods for the Webhooks group. Don't use this type directly, use NewWebhooksClient() instead.

func NewWebhooksClient

func NewWebhooksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WebhooksClient, error)

NewWebhooksClient creates a new instance of WebhooksClient with the specified values.

  • subscriptionID - The ID of the target subscription. The value must be an UUID.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*WebhooksClient) BeginCreate

func (client *WebhooksClient) BeginCreate(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters, options *WebhooksClientBeginCreateOptions) (*runtime.Poller[WebhooksClientCreateResponse], error)

BeginCreate - Creates a webhook for a container registry with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • webhookCreateParameters - The parameters for creating a webhook.
  • options - WebhooksClientBeginCreateOptions contains the optional parameters for the WebhooksClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookCreate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewWebhooksClient().BeginCreate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookCreateParameters{
		Location: to.Ptr("westus"),
		Properties: &armcontainerregistry.WebhookPropertiesCreateParameters{
			Actions: []*armcontainerregistry.WebhookAction{
				to.Ptr(armcontainerregistry.WebhookActionPush)},
			CustomHeaders: map[string]*string{
				"Authorization": to.Ptr("******"),
			},
			Scope:      to.Ptr("myRepository"),
			ServiceURI: to.Ptr("http://myservice.com"),
			Status:     to.Ptr(armcontainerregistry.WebhookStatusEnabled),
		},
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Webhook = armcontainerregistry.Webhook{
	// 	Name: to.Ptr("myWebhook"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.WebhookProperties{
	// 		Actions: []*armcontainerregistry.WebhookAction{
	// 			to.Ptr(armcontainerregistry.WebhookActionPush)},
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 			Scope: to.Ptr("myRepository"),
	// 			Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled),
	// 		},
	// 	}
}
Output:

func (*WebhooksClient) BeginDelete

func (client *WebhooksClient) BeginDelete(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientBeginDeleteOptions) (*runtime.Poller[WebhooksClientDeleteResponse], error)

BeginDelete - Deletes a webhook from a container registry. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • options - WebhooksClientBeginDeleteOptions contains the optional parameters for the WebhooksClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookDelete.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewWebhooksClient().BeginDelete(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	_, err = poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
}
Output:

func (*WebhooksClient) BeginUpdate

func (client *WebhooksClient) BeginUpdate(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters, options *WebhooksClientBeginUpdateOptions) (*runtime.Poller[WebhooksClientUpdateResponse], error)

BeginUpdate - Updates a webhook with the specified parameters. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • webhookUpdateParameters - The parameters for updating a webhook.
  • options - WebhooksClientBeginUpdateOptions contains the optional parameters for the WebhooksClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookUpdate.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewWebhooksClient().BeginUpdate(ctx, "myResourceGroup", "myRegistry", "myWebhook", armcontainerregistry.WebhookUpdateParameters{
		Properties: &armcontainerregistry.WebhookPropertiesUpdateParameters{
			Actions: []*armcontainerregistry.WebhookAction{
				to.Ptr(armcontainerregistry.WebhookActionPush)},
			CustomHeaders: map[string]*string{
				"Authorization": to.Ptr("******"),
			},
			Scope:      to.Ptr("myRepository"),
			ServiceURI: to.Ptr("http://myservice.com"),
			Status:     to.Ptr(armcontainerregistry.WebhookStatusEnabled),
		},
		Tags: map[string]*string{
			"key": to.Ptr("value"),
		},
	}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	res, err := poller.PollUntilDone(ctx, nil)
	if err != nil {
		log.Fatalf("failed to pull the result: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Webhook = armcontainerregistry.Webhook{
	// 	Name: to.Ptr("myWebhook"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.WebhookProperties{
	// 		Actions: []*armcontainerregistry.WebhookAction{
	// 			to.Ptr(armcontainerregistry.WebhookActionPush)},
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 			Scope: to.Ptr("myRepository"),
	// 			Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled),
	// 		},
	// 	}
}
Output:

func (*WebhooksClient) Get

func (client *WebhooksClient) Get(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientGetOptions) (WebhooksClientGetResponse, error)

Get - Gets the properties of the specified webhook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • options - WebhooksClientGetOptions contains the optional parameters for the WebhooksClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebhooksClient().Get(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.Webhook = armcontainerregistry.Webhook{
	// 	Name: to.Ptr("myWebhook"),
	// 	Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"),
	// 	Location: to.Ptr("westus"),
	// 	Tags: map[string]*string{
	// 		"key": to.Ptr("value"),
	// 	},
	// 	Properties: &armcontainerregistry.WebhookProperties{
	// 		Actions: []*armcontainerregistry.WebhookAction{
	// 			to.Ptr(armcontainerregistry.WebhookActionPush)},
	// 			ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
	// 			Scope: to.Ptr("myRepository"),
	// 			Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled),
	// 		},
	// 	}
}
Output:

func (*WebhooksClient) GetCallbackConfig

func (client *WebhooksClient) GetCallbackConfig(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientGetCallbackConfigOptions) (WebhooksClientGetCallbackConfigResponse, error)

GetCallbackConfig - Gets the configuration of service URI and custom headers for the webhook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • options - WebhooksClientGetCallbackConfigOptions contains the optional parameters for the WebhooksClient.GetCallbackConfig method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookGetCallbackConfig.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebhooksClient().GetCallbackConfig(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.CallbackConfig = armcontainerregistry.CallbackConfig{
	// 	CustomHeaders: map[string]*string{
	// 		"Authorization": to.Ptr("******"),
	// 	},
	// 	ServiceURI: to.Ptr("http://myservice.com"),
	// }
}
Output:

func (*WebhooksClient) NewListEventsPager added in v0.5.0

func (client *WebhooksClient) NewListEventsPager(resourceGroupName string, registryName string, webhookName string, options *WebhooksClientListEventsOptions) *runtime.Pager[WebhooksClientListEventsResponse]

NewListEventsPager - Lists recent events for the specified webhook.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • options - WebhooksClientListEventsOptions contains the optional parameters for the WebhooksClient.NewListEventsPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookListEvents.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebhooksClient().NewListEventsPager("myResourceGroup", "myRegistry", "myWebhook", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.EventListResult = armcontainerregistry.EventListResult{
		// 	Value: []*armcontainerregistry.Event{
		// 		{
		// 			ID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 			EventRequestMessage: &armcontainerregistry.EventRequestMessage{
		// 				Method: to.Ptr("POST"),
		// 				Content: &armcontainerregistry.EventContent{
		// 					Action: to.Ptr("push"),
		// 					Actor: &armcontainerregistry.Actor{
		// 					},
		// 					ID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					Source: &armcontainerregistry.Source{
		// 						Addr: to.Ptr("xtal.local:5000"),
		// 						InstanceID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 					},
		// 					Target: &armcontainerregistry.Target{
		// 						Digest: to.Ptr("sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"),
		// 						Length: to.Ptr[int64](708),
		// 						MediaType: to.Ptr("application/vnd.docker.distribution.manifest.v2+json"),
		// 						Repository: to.Ptr("hello-world"),
		// 						Size: to.Ptr[int64](708),
		// 						Tag: to.Ptr("latest"),
		// 						URL: to.Ptr("http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf"),
		// 					},
		// 					Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-01T23:14:37.070Z"); return t}()),
		// 					Request: &armcontainerregistry.Request{
		// 						Method: to.Ptr("GET"),
		// 						Addr: to.Ptr("192.168.64.11:42961"),
		// 						Host: to.Ptr("192.168.100.227:5000"),
		// 						ID: to.Ptr("00000000-0000-0000-0000-000000000000"),
		// 						Useragent: to.Ptr("curl/7.38.0"),
		// 					},
		// 				},
		// 				Headers: map[string]*string{
		// 					"Authorization": to.Ptr("******"),
		// 					"Content-Length": to.Ptr("719"),
		// 					"Content-Type": to.Ptr("application/json"),
		// 				},
		// 				RequestURI: to.Ptr("http://myservice.com"),
		// 				Version: to.Ptr("1.1"),
		// 			},
		// 			EventResponseMessage: &armcontainerregistry.EventResponseMessage{
		// 				Headers: map[string]*string{
		// 					"Content-Length": to.Ptr("0"),
		// 				},
		// 				StatusCode: to.Ptr("200"),
		// 				Version: to.Ptr("1.1"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*WebhooksClient) NewListPager added in v0.5.0

func (client *WebhooksClient) NewListPager(resourceGroupName string, registryName string, options *WebhooksClientListOptions) *runtime.Pager[WebhooksClientListResponse]

NewListPager - Lists all the webhooks for the specified container registry.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • options - WebhooksClientListOptions contains the optional parameters for the WebhooksClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewWebhooksClient().NewListPager("myResourceGroup", "myRegistry", nil)
	for pager.More() {
		page, err := pager.NextPage(ctx)
		if err != nil {
			log.Fatalf("failed to advance page: %v", err)
		}
		for _, v := range page.Value {
			// You could use page here. We use blank identifier for just demo purposes.
			_ = v
		}
		// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
		// page.WebhookListResult = armcontainerregistry.WebhookListResult{
		// 	Value: []*armcontainerregistry.Webhook{
		// 		{
		// 			Name: to.Ptr("myWebhook"),
		// 			Type: to.Ptr("Microsoft.ContainerRegistry/registries/webhooks"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/webhooks/myWebhook"),
		// 			Location: to.Ptr("westus"),
		// 			Tags: map[string]*string{
		// 				"key": to.Ptr("value"),
		// 			},
		// 			Properties: &armcontainerregistry.WebhookProperties{
		// 				Actions: []*armcontainerregistry.WebhookAction{
		// 					to.Ptr(armcontainerregistry.WebhookActionPush)},
		// 					ProvisioningState: to.Ptr(armcontainerregistry.ProvisioningStateSucceeded),
		// 					Scope: to.Ptr("myRepository"),
		// 					Status: to.Ptr(armcontainerregistry.WebhookStatusEnabled),
		// 				},
		// 		}},
		// 	}
	}
}
Output:

func (*WebhooksClient) Ping

func (client *WebhooksClient) Ping(ctx context.Context, resourceGroupName string, registryName string, webhookName string, options *WebhooksClientPingOptions) (WebhooksClientPingResponse, error)

Ping - Triggers a ping event to be sent to the webhook. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-07-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • registryName - The name of the container registry.
  • webhookName - The name of the webhook.
  • options - WebhooksClientPingOptions contains the optional parameters for the WebhooksClient.Ping method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/bbe1ea8bf5aa6cfbfa8855e03dbb9a93f8266bcd/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/stable/2023-07-01/examples/WebhookPing.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewWebhooksClient().Ping(ctx, "myResourceGroup", "myRegistry", "myWebhook", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
	// You could use response here. We use blank identifier for just demo purposes.
	_ = res
	// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
	// res.EventInfo = armcontainerregistry.EventInfo{
	// 	ID: to.Ptr("00000000-0000-0000-0000-000000000000"),
	// }
}
Output:

type WebhooksClientBeginCreateOptions added in v0.3.0

type WebhooksClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

WebhooksClientBeginCreateOptions contains the optional parameters for the WebhooksClient.BeginCreate method.

type WebhooksClientBeginDeleteOptions added in v0.3.0

type WebhooksClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

WebhooksClientBeginDeleteOptions contains the optional parameters for the WebhooksClient.BeginDelete method.

type WebhooksClientBeginUpdateOptions added in v0.3.0

type WebhooksClientBeginUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

WebhooksClientBeginUpdateOptions contains the optional parameters for the WebhooksClient.BeginUpdate method.

type WebhooksClientCreateResponse added in v0.3.0

type WebhooksClientCreateResponse struct {
	// An object that represents a webhook for a container registry.
	Webhook
}

WebhooksClientCreateResponse contains the response from method WebhooksClient.BeginCreate.

type WebhooksClientDeleteResponse added in v0.3.0

type WebhooksClientDeleteResponse struct {
}

WebhooksClientDeleteResponse contains the response from method WebhooksClient.BeginDelete.

type WebhooksClientGetCallbackConfigOptions added in v0.3.0

type WebhooksClientGetCallbackConfigOptions struct {
}

WebhooksClientGetCallbackConfigOptions contains the optional parameters for the WebhooksClient.GetCallbackConfig method.

type WebhooksClientGetCallbackConfigResponse added in v0.3.0

type WebhooksClientGetCallbackConfigResponse struct {
	// The configuration of service URI and custom headers for the webhook.
	CallbackConfig
}

WebhooksClientGetCallbackConfigResponse contains the response from method WebhooksClient.GetCallbackConfig.

type WebhooksClientGetOptions added in v0.3.0

type WebhooksClientGetOptions struct {
}

WebhooksClientGetOptions contains the optional parameters for the WebhooksClient.Get method.

type WebhooksClientGetResponse added in v0.3.0

type WebhooksClientGetResponse struct {
	// An object that represents a webhook for a container registry.
	Webhook
}

WebhooksClientGetResponse contains the response from method WebhooksClient.Get.

type WebhooksClientListEventsOptions added in v0.3.0

type WebhooksClientListEventsOptions struct {
}

WebhooksClientListEventsOptions contains the optional parameters for the WebhooksClient.NewListEventsPager method.

type WebhooksClientListEventsResponse added in v0.3.0

type WebhooksClientListEventsResponse struct {
	// The result of a request to list events for a webhook.
	EventListResult
}

WebhooksClientListEventsResponse contains the response from method WebhooksClient.NewListEventsPager.

type WebhooksClientListOptions added in v0.3.0

type WebhooksClientListOptions struct {
}

WebhooksClientListOptions contains the optional parameters for the WebhooksClient.NewListPager method.

type WebhooksClientListResponse added in v0.3.0

type WebhooksClientListResponse struct {
	// The result of a request to list webhooks for a container registry.
	WebhookListResult
}

WebhooksClientListResponse contains the response from method WebhooksClient.NewListPager.

type WebhooksClientPingOptions added in v0.3.0

type WebhooksClientPingOptions struct {
}

WebhooksClientPingOptions contains the optional parameters for the WebhooksClient.Ping method.

type WebhooksClientPingResponse added in v0.3.0

type WebhooksClientPingResponse struct {
	// The basic information of an event.
	EventInfo
}

WebhooksClientPingResponse contains the response from method WebhooksClient.Ping.

type WebhooksClientUpdateResponse added in v0.3.0

type WebhooksClientUpdateResponse struct {
	// An object that represents a webhook for a container registry.
	Webhook
}

WebhooksClientUpdateResponse contains the response from method WebhooksClient.BeginUpdate.

type ZoneRedundancy

type ZoneRedundancy string

ZoneRedundancy - Whether or not zone redundancy is enabled for this container registry

const (
	ZoneRedundancyDisabled ZoneRedundancy = "Disabled"
	ZoneRedundancyEnabled  ZoneRedundancy = "Enabled"
)

func PossibleZoneRedundancyValues

func PossibleZoneRedundancyValues() []ZoneRedundancy

PossibleZoneRedundancyValues returns the possible values for the ZoneRedundancy const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL