armdevops

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 12 Imported by: 2

README

Azure DevOps Module for Go

PkgGoDev

The armdevops module provides operations for working with Azure DevOps.

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 DevOps module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure DevOps. 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 DevOps 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 := armdevops.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 := armdevops.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.NewPipelinesClient()

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.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the DevOps 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 Authorization

type Authorization struct {
	// REQUIRED; Type of authorization.
	AuthorizationType *AuthorizationType

	// Authorization parameters corresponding to the authorization type.
	Parameters map[string]*string
}

Authorization info used to access a resource (like code repository).

func (Authorization) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Authorization.

func (*Authorization) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Authorization.

type AuthorizationType

type AuthorizationType string

AuthorizationType - Type of authorization.

const (
	AuthorizationTypePersonalAccessToken AuthorizationType = "personalAccessToken"
)

func PossibleAuthorizationTypeValues

func PossibleAuthorizationTypeValues() []AuthorizationType

PossibleAuthorizationTypeValues returns the possible values for the AuthorizationType const type.

type BootstrapConfiguration

type BootstrapConfiguration struct {
	// REQUIRED; Template used to bootstrap the pipeline.
	Template *PipelineTemplate

	// Repository containing the source code for the pipeline.
	Repository *CodeRepository
}

BootstrapConfiguration - Configuration used to bootstrap a Pipeline.

func (BootstrapConfiguration) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type BootstrapConfiguration.

func (*BootstrapConfiguration) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type BootstrapConfiguration.

type ClientFactory added in v0.6.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 v0.6.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 - Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewOperationsClient added in v0.6.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPipelineTemplateDefinitionsClient added in v0.6.0

func (c *ClientFactory) NewPipelineTemplateDefinitionsClient() *PipelineTemplateDefinitionsClient

NewPipelineTemplateDefinitionsClient creates a new instance of PipelineTemplateDefinitionsClient.

func (*ClientFactory) NewPipelinesClient added in v0.6.0

func (c *ClientFactory) NewPipelinesClient() *PipelinesClient

NewPipelinesClient creates a new instance of PipelinesClient.

type CodeRepository

type CodeRepository struct {
	// REQUIRED; Default branch used to configure Continuous Integration (CI) in the pipeline.
	DefaultBranch *string

	// REQUIRED; Unique immutable identifier of the code repository.
	ID *string

	// REQUIRED; Type of code repository.
	RepositoryType *CodeRepositoryType

	// Authorization info to access the code repository.
	Authorization *Authorization

	// Repository-specific properties.
	Properties map[string]*string
}

CodeRepository - Repository containing the source code for a pipeline.

func (CodeRepository) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type CodeRepository.

func (*CodeRepository) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type CodeRepository.

type CodeRepositoryType

type CodeRepositoryType string

CodeRepositoryType - Type of code repository.

const (
	CodeRepositoryTypeGitHub  CodeRepositoryType = "gitHub"
	CodeRepositoryTypeVstsGit CodeRepositoryType = "vstsGit"
)

func PossibleCodeRepositoryTypeValues

func PossibleCodeRepositoryTypeValues() []CodeRepositoryType

PossibleCodeRepositoryTypeValues returns the possible values for the CodeRepositoryType const type.

type InputDataType

type InputDataType string

InputDataType - Data type of the value of the input parameter.

const (
	InputDataTypeAuthorization InputDataType = "Authorization"
	InputDataTypeBool          InputDataType = "Bool"
	InputDataTypeInt           InputDataType = "Int"
	InputDataTypeSecureString  InputDataType = "SecureString"
	InputDataTypeString        InputDataType = "String"
)

func PossibleInputDataTypeValues

func PossibleInputDataTypeValues() []InputDataType

PossibleInputDataTypeValues returns the possible values for the InputDataType const type.

type InputDescriptor

type InputDescriptor struct {
	// REQUIRED; Identifier of the input parameter.
	ID *string

	// REQUIRED; Data type of the value of the input parameter.
	Type *InputDataType

	// Description of the input parameter.
	Description *string

	// List of possible values for the input parameter.
	PossibleValues []*InputValue
}

InputDescriptor - Representation of a pipeline template input parameter.

func (InputDescriptor) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type InputDescriptor.

func (*InputDescriptor) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type InputDescriptor.

type InputValue

type InputValue struct {
	// Description of the input parameter value.
	DisplayValue *string

	// Value of an input parameter.
	Value *string
}

InputValue - Representation of a pipeline template input parameter value.

func (InputValue) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type InputValue.

func (*InputValue) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type InputValue.

type Operation

type Operation struct {
	// Display information of the operation.
	Display *OperationDisplayValue

	// Indicates whether the operation applies to data-plane.
	IsDataAction *string

	// READ-ONLY; Name of the operation.
	Name *string
}

Operation - Properties of an Operation.

func (Operation) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplayValue

type OperationDisplayValue struct {
	// READ-ONLY; Friendly description of the operation.
	Description *string

	// READ-ONLY; Friendly name of the operation.
	Operation *string

	// READ-ONLY; Friendly name of the resource provider.
	Provider *string

	// READ-ONLY; Friendly name of the resource type the operation applies to.
	Resource *string
}

OperationDisplayValue - Display information of an operation.

func (OperationDisplayValue) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplayValue.

func (*OperationDisplayValue) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplayValue.

type OperationListResult

type OperationListResult struct {
	// The URL to get the next set of operations, if there are any.
	NextLink *string

	// READ-ONLY; List of operations supported by Microsoft.DevOps resource provider.
	Value []*Operation
}

OperationListResult - Result of a request to list all operations supported by Microsoft.DevOps resource provider.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

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.4.0

NewListPager - Lists all the operations supported by Microsoft.DevOps resource provider.

Generated from API version 2019-07-01-preview

  • 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/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.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 = armdevops.OperationListResult{
		// 	Value: []*armdevops.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.DevOps/register/action"),
		// 			Display: &armdevops.OperationDisplayValue{
		// 				Description: to.Ptr("Registers the specified subscription with Microsoft.DevOps resource provider and enables the creation of Pipelines"),
		// 				Operation: to.Ptr("Register for Microsoft.DevOps"),
		// 				Provider: to.Ptr("Microsoft DevOps"),
		// 				Resource: to.Ptr("register"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevOps/pipelines/write"),
		// 			Display: &armdevops.OperationDisplayValue{
		// 				Description: to.Ptr("Creates or Updates any Pipeline"),
		// 				Operation: to.Ptr("Create or Update Pipeline"),
		// 				Provider: to.Ptr("Microsoft DevOps"),
		// 				Resource: to.Ptr("Pipelines"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevOps/pipelines/read"),
		// 			Display: &armdevops.OperationDisplayValue{
		// 				Description: to.Ptr("Reads any Pipeline"),
		// 				Operation: to.Ptr("Read Pipeline"),
		// 				Provider: to.Ptr("Microsoft DevOps"),
		// 				Resource: to.Ptr("Pipelines"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevOps/pipelines/delete"),
		// 			Display: &armdevops.OperationDisplayValue{
		// 				Description: to.Ptr("Deletes any Pipeline"),
		// 				Operation: to.Ptr("Delete Pipeline"),
		// 				Provider: to.Ptr("Microsoft DevOps"),
		// 				Resource: to.Ptr("Pipelines"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.DevOps/pipelineTemplateDefinitions/read"),
		// 			Display: &armdevops.OperationDisplayValue{
		// 				Description: to.Ptr("Reads any PipelineTemplateDefinition"),
		// 				Operation: to.Ptr("Read PipelineTemplateDefinition"),
		// 				Provider: to.Ptr("Microsoft DevOps"),
		// 				Resource: to.Ptr("PipelineTemplateDefinitions"),
		// 			},
		// 			IsDataAction: to.Ptr("false"),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions added in v0.2.0

type OperationsClientListOptions struct {
}

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

type OperationsClientListResponse added in v0.2.0

type OperationsClientListResponse struct {
	// Result of a request to list all operations supported by Microsoft.DevOps resource provider.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type OrganizationReference

type OrganizationReference struct {
	// REQUIRED; Name of the Azure DevOps Organization.
	Name *string

	// READ-ONLY; Unique immutable identifier for the Azure DevOps Organization.
	ID *string
}

OrganizationReference - Reference to an Azure DevOps Organization.

func (OrganizationReference) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type OrganizationReference.

func (*OrganizationReference) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type OrganizationReference.

type Pipeline

type Pipeline struct {
	// REQUIRED; Custom properties of the Pipeline.
	Properties *PipelineProperties

	// Resource Location
	Location *string

	// Resource Tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; Resource Type
	Type *string
}

Pipeline - Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) for Azure resources.

func (Pipeline) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Pipeline.

func (*Pipeline) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Pipeline.

type PipelineListResult

type PipelineListResult struct {
	// URL to get the next set of Pipelines, if there are any.
	NextLink *string

	// List of pipelines.
	Value []*Pipeline
}

PipelineListResult - Result of a request to list all Azure Pipelines under a given scope.

func (PipelineListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PipelineListResult.

func (*PipelineListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineListResult.

type PipelineProperties

type PipelineProperties struct {
	// REQUIRED; Configuration used to bootstrap the Pipeline.
	BootstrapConfiguration *BootstrapConfiguration

	// REQUIRED; Reference to the Azure DevOps Organization containing the Pipeline.
	Organization *OrganizationReference

	// REQUIRED; Reference to the Azure DevOps Project containing the Pipeline.
	Project *ProjectReference

	// READ-ONLY; Unique identifier of the Azure Pipeline within the Azure DevOps Project.
	PipelineID *int32
}

PipelineProperties - Custom properties of a Pipeline.

func (PipelineProperties) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type PipelineProperties.

func (*PipelineProperties) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineProperties.

type PipelineTemplate

type PipelineTemplate struct {
	// REQUIRED; Unique identifier of the pipeline template.
	ID *string

	// Dictionary of input parameters used in the pipeline template.
	Parameters map[string]*string
}

PipelineTemplate - Template used to bootstrap the pipeline.

func (PipelineTemplate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PipelineTemplate.

func (*PipelineTemplate) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTemplate.

type PipelineTemplateDefinition

type PipelineTemplateDefinition struct {
	// REQUIRED; Unique identifier of the pipeline template.
	ID *string

	// Description of the pipeline enabled by the template.
	Description *string

	// List of input parameters required by the template to create a pipeline.
	Inputs []*InputDescriptor
}

PipelineTemplateDefinition - Definition of a pipeline template.

func (PipelineTemplateDefinition) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinition.

func (*PipelineTemplateDefinition) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTemplateDefinition.

type PipelineTemplateDefinitionListResult

type PipelineTemplateDefinitionListResult struct {
	// The URL to get the next set of pipeline template definitions, if there are any.
	NextLink *string

	// List of pipeline template definitions.
	Value []*PipelineTemplateDefinition
}

PipelineTemplateDefinitionListResult - Result of a request to list all pipeline template definitions.

func (PipelineTemplateDefinitionListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinitionListResult.

func (*PipelineTemplateDefinitionListResult) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineTemplateDefinitionListResult.

type PipelineTemplateDefinitionsClient

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

PipelineTemplateDefinitionsClient contains the methods for the PipelineTemplateDefinitions group. Don't use this type directly, use NewPipelineTemplateDefinitionsClient() instead.

func NewPipelineTemplateDefinitionsClient

func NewPipelineTemplateDefinitionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PipelineTemplateDefinitionsClient, error)

NewPipelineTemplateDefinitionsClient creates a new instance of PipelineTemplateDefinitionsClient with the specified values.

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

func (*PipelineTemplateDefinitionsClient) NewListPager added in v0.4.0

NewListPager - Lists all pipeline templates which can be used to configure an Azure Pipeline.

Generated from API version 2019-07-01-preview

  • options - PipelineTemplateDefinitionsClientListOptions contains the optional parameters for the PipelineTemplateDefinitionsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListPipelineTemplateDefinitions.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPipelineTemplateDefinitionsClient().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.PipelineTemplateDefinitionListResult = armdevops.PipelineTemplateDefinitionListResult{
		// 	Value: []*armdevops.PipelineTemplateDefinition{
		// 		{
		// 			Description: to.Ptr("Template for configuring CI/CD pipeline for ASP.Net app on Azure windows app service"),
		// 			ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
		// 			Inputs: []*armdevops.InputDescriptor{
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Authorization for Azure ARM endpoints."),
		// 					ID: to.Ptr("azureAuth"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Id of subscription where azure resources will be created."),
		// 					ID: to.Ptr("subscriptionId"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("A resource group is a collection of resources that share the same lifecycle, permissions, and policies. Name of resource group which should contain web app."),
		// 					ID: to.Ptr("resourceGroup"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Name of web app to be created"),
		// 					ID: to.Ptr("webAppName"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Choose the Azure region that's right for you and your customers."),
		// 					ID: to.Ptr("location"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Details of cost and compute resource associated with the web app"),
		// 					ID: to.Ptr("appServicePlan"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 						{
		// 							DisplayValue: to.Ptr("P1 Premium (1 Core, 1.75 GB RAM)"),
		// 							Value: to.Ptr("P1 Premium"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("P2 Premium (2 Core, 3.5 GB RAM)"),
		// 							Value: to.Ptr("P2 Premium"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("P3 Premium (4 Core, 7 GB RAM)"),
		// 							Value: to.Ptr("P3 Premium"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("S1 Standard (1 Core, 1.75 GB RAM)"),
		// 							Value: to.Ptr("S1 Standard"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("S2 Standard (2 Core, 3.5 GB RAM)"),
		// 							Value: to.Ptr("S2 Standard"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("S3 Standard (4 Core, 7 GB RAM)"),
		// 							Value: to.Ptr("S3 Standard"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("B1 Basic (1 Core, 1.75 GB RAM)"),
		// 							Value: to.Ptr("B1 Basic"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("B2 Basic (2 Core, 3.5 GB RAM)"),
		// 							Value: to.Ptr("B2 Basic"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("B3 Basic (4 Core, 7 GB RAM)"),
		// 							Value: to.Ptr("B3 Basic"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("F1 Free"),
		// 							Value: to.Ptr("F1 Free"),
		// 						},
		// 						{
		// 							DisplayValue: to.Ptr("D1 Shared"),
		// 							Value: to.Ptr("D1 Shared"),
		// 					}},
		// 				},
		// 				{
		// 					Type: to.Ptr(armdevops.InputDataTypeString),
		// 					Description: to.Ptr("Collect application monitoring data using Application Insights."),
		// 					ID: to.Ptr("appInsightLocation"),
		// 					PossibleValues: []*armdevops.InputValue{
		// 					},
		// 			}},
		// 	}},
		// }
	}
}
Output:

type PipelineTemplateDefinitionsClientListOptions added in v0.2.0

type PipelineTemplateDefinitionsClientListOptions struct {
}

PipelineTemplateDefinitionsClientListOptions contains the optional parameters for the PipelineTemplateDefinitionsClient.NewListPager method.

type PipelineTemplateDefinitionsClientListResponse added in v0.2.0

type PipelineTemplateDefinitionsClientListResponse struct {
	// Result of a request to list all pipeline template definitions.
	PipelineTemplateDefinitionListResult
}

PipelineTemplateDefinitionsClientListResponse contains the response from method PipelineTemplateDefinitionsClient.NewListPager.

type PipelineUpdateParameters

type PipelineUpdateParameters struct {
	// Dictionary of key-value pairs to be set as tags on the Azure Pipeline. This will overwrite any existing tags.
	Tags map[string]*string
}

PipelineUpdateParameters - Request payload used to update an existing Azure Pipeline.

func (PipelineUpdateParameters) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type PipelineUpdateParameters.

func (*PipelineUpdateParameters) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type PipelineUpdateParameters.

type PipelinesClient

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

PipelinesClient contains the methods for the Pipelines group. Don't use this type directly, use NewPipelinesClient() instead.

func NewPipelinesClient

func NewPipelinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PipelinesClient, error)

NewPipelinesClient creates a new instance of PipelinesClient with the specified values.

  • subscriptionID - Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PipelinesClient) BeginCreateOrUpdate

func (client *PipelinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, pipelineName string, createOperationParameters Pipeline, options *PipelinesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PipelinesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates an Azure Pipeline. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-01-preview

  • resourceGroupName - Name of the resource group within the Azure subscription.
  • pipelineName - The name of the Azure Pipeline resource in ARM.
  • createOperationParameters - The request payload to create the Azure Pipeline.
  • options - PipelinesClientBeginCreateOrUpdateOptions contains the optional parameters for the PipelinesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/CreateAzurePipeline-Sample-AspNet-WindowsWebApp.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/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewPipelinesClient().BeginCreateOrUpdate(ctx, "myAspNetWebAppPipeline-rg", "myAspNetWebAppPipeline", armdevops.Pipeline{
		Location: to.Ptr("South India"),
		Tags:     map[string]*string{},
		Properties: &armdevops.PipelineProperties{
			BootstrapConfiguration: &armdevops.BootstrapConfiguration{
				Template: &armdevops.PipelineTemplate{
					ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
					Parameters: map[string]*string{
						"appInsightLocation": to.Ptr("South India"),
						"appServicePlan":     to.Ptr("S1 Standard"),
						"azureAuth":          to.Ptr("{\"scheme\":\"ServicePrincipal\",\"parameters\":{\"tenantid\":\"{subscriptionTenantId}\",\"objectid\":\"{appObjectId}\",\"serviceprincipalid\":\"{appId}\",\"serviceprincipalkey\":\"{appSecret}\"}}"),
						"location":           to.Ptr("South India"),
						"resourceGroup":      to.Ptr("myAspNetWebAppPipeline-rg"),
						"subscriptionId":     to.Ptr("{subscriptionId}"),
						"webAppName":         to.Ptr("myAspNetWebApp"),
					},
				},
			},
			Organization: &armdevops.OrganizationReference{
				Name: to.Ptr("myAspNetWebAppPipeline-org"),
			},
			Project: &armdevops.ProjectReference{
				Name: to.Ptr("myAspNetWebAppPipeline-project"),
			},
		},
	}, 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.Pipeline = armdevops.Pipeline{
	// 	Name: to.Ptr("myAspNetWebAppPipeline"),
	// 	Type: to.Ptr("Microsoft.DevOps/pipelines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline"),
	// 	Location: to.Ptr("South India"),
	// 	Properties: &armdevops.PipelineProperties{
	// 		BootstrapConfiguration: &armdevops.BootstrapConfiguration{
	// 			Template: &armdevops.PipelineTemplate{
	// 				ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
	// 				Parameters: map[string]*string{
	// 					"appInsightLocation": to.Ptr("South India"),
	// 					"appServicePlan": to.Ptr("S1 Standard"),
	// 					"azureAuth": nil,
	// 					"location": to.Ptr("South India"),
	// 					"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
	// 					"subscriptionId": to.Ptr("{subscriptionId}"),
	// 					"webAppName": to.Ptr("myAspNetWebApp"),
	// 				},
	// 			},
	// 		},
	// 		Organization: &armdevops.OrganizationReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-org"),
	// 		},
	// 		Project: &armdevops.ProjectReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-project"),
	// 		},
	// 	},
	// }
}
Output:

func (*PipelinesClient) Delete

func (client *PipelinesClient) Delete(ctx context.Context, resourceGroupName string, pipelineName string, options *PipelinesClientDeleteOptions) (PipelinesClientDeleteResponse, error)

Delete - Deletes an Azure Pipeline. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-01-preview

  • resourceGroupName - Name of the resource group within the Azure subscription.
  • pipelineName - The name of the Azure Pipeline resource.
  • options - PipelinesClientDeleteOptions contains the optional parameters for the PipelinesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/DeleteAzurePipeline.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewPipelinesClient().Delete(ctx, "myAspNetWebAppPipeline-rg", "myAspNetWebAppPipeline", nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*PipelinesClient) Get

func (client *PipelinesClient) Get(ctx context.Context, resourceGroupName string, pipelineName string, options *PipelinesClientGetOptions) (PipelinesClientGetResponse, error)

Get - Gets an existing Azure Pipeline. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-01-preview

  • resourceGroupName - Name of the resource group within the Azure subscription.
  • pipelineName - The name of the Azure Pipeline resource in ARM.
  • options - PipelinesClientGetOptions contains the optional parameters for the PipelinesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/GetAzurePipeline.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPipelinesClient().Get(ctx, "myAspNetWebAppPipeline-rg", "myAspNetWebAppPipeline", 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.Pipeline = armdevops.Pipeline{
	// 	Name: to.Ptr("myAspNetWebAppPipeline"),
	// 	Type: to.Ptr("Microsoft.DevOps/pipelines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline"),
	// 	Location: to.Ptr("South India"),
	// 	Properties: &armdevops.PipelineProperties{
	// 		BootstrapConfiguration: &armdevops.BootstrapConfiguration{
	// 			Template: &armdevops.PipelineTemplate{
	// 				ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
	// 				Parameters: map[string]*string{
	// 					"appInsightLocation": to.Ptr("South India"),
	// 					"appServicePlan": to.Ptr("S1 Standard"),
	// 					"azureAuth": nil,
	// 					"location": to.Ptr("South India"),
	// 					"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
	// 					"subscriptionId": to.Ptr("{subscriptionId}"),
	// 					"webAppName": to.Ptr("myAspNetWebApp"),
	// 				},
	// 			},
	// 		},
	// 		Organization: &armdevops.OrganizationReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-org"),
	// 		},
	// 		Project: &armdevops.ProjectReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-project"),
	// 		},
	// 	},
	// }
}
Output:

func (*PipelinesClient) NewListByResourceGroupPager added in v0.4.0

func (client *PipelinesClient) NewListByResourceGroupPager(resourceGroupName string, options *PipelinesClientListByResourceGroupOptions) *runtime.Pager[PipelinesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Lists all Azure Pipelines under the specified resource group.

Generated from API version 2019-07-01-preview

  • resourceGroupName - Name of the resource group within the Azure subscription.
  • options - PipelinesClientListByResourceGroupOptions contains the optional parameters for the PipelinesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPipelinesClient().NewListByResourceGroupPager("myAspNetWebAppPipeline-rg", 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.PipelineListResult = armdevops.PipelineListResult{
		// 	Value: []*armdevops.Pipeline{
		// 		{
		// 			Name: to.Ptr("myAspNetWebAppPipeline"),
		// 			Type: to.Ptr("Microsoft.DevOps/pipelines"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline"),
		// 			Location: to.Ptr("South India"),
		// 			Properties: &armdevops.PipelineProperties{
		// 				BootstrapConfiguration: &armdevops.BootstrapConfiguration{
		// 					Template: &armdevops.PipelineTemplate{
		// 						ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
		// 						Parameters: map[string]*string{
		// 							"appInsightLocation": to.Ptr("South India"),
		// 							"appServicePlan": to.Ptr("S1 Standard"),
		// 							"azureAuth": nil,
		// 							"location": to.Ptr("South India"),
		// 							"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
		// 							"subscriptionId": to.Ptr("{subscriptionId}"),
		// 							"webAppName": to.Ptr("myAspNetWebApp"),
		// 						},
		// 					},
		// 				},
		// 				Organization: &armdevops.OrganizationReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-org"),
		// 				},
		// 				Project: &armdevops.ProjectReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-project"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PipelinesClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - Lists all Azure Pipelines under the specified subscription.

Generated from API version 2019-07-01-preview

  • options - PipelinesClientListBySubscriptionOptions contains the optional parameters for the PipelinesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewPipelinesClient().NewListBySubscriptionPager(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.PipelineListResult = armdevops.PipelineListResult{
		// 	Value: []*armdevops.Pipeline{
		// 		{
		// 			Name: to.Ptr("myAspNetWebAppPipeline"),
		// 			Type: to.Ptr("Microsoft.DevOps/pipelines"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline"),
		// 			Location: to.Ptr("South India"),
		// 			Properties: &armdevops.PipelineProperties{
		// 				BootstrapConfiguration: &armdevops.BootstrapConfiguration{
		// 					Template: &armdevops.PipelineTemplate{
		// 						ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
		// 						Parameters: map[string]*string{
		// 							"appInsightLocation": to.Ptr("South India"),
		// 							"appServicePlan": to.Ptr("S1 Standard"),
		// 							"azureAuth": nil,
		// 							"location": to.Ptr("South India"),
		// 							"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
		// 							"subscriptionId": to.Ptr("{subscriptionId}"),
		// 							"webAppName": to.Ptr("myAspNetWebApp"),
		// 						},
		// 					},
		// 				},
		// 				Organization: &armdevops.OrganizationReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-org"),
		// 				},
		// 				Project: &armdevops.ProjectReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-project"),
		// 				},
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("myAspNetWebAppPipeline1"),
		// 			Type: to.Ptr("Microsoft.DevOps/pipelines"),
		// 			ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg1/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline1"),
		// 			Location: to.Ptr("South India"),
		// 			Properties: &armdevops.PipelineProperties{
		// 				BootstrapConfiguration: &armdevops.BootstrapConfiguration{
		// 					Template: &armdevops.PipelineTemplate{
		// 						ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
		// 						Parameters: map[string]*string{
		// 							"appInsightLocation": to.Ptr("South India"),
		// 							"appServicePlan": to.Ptr("S1 Standard"),
		// 							"azureAuth": nil,
		// 							"location": to.Ptr("South India"),
		// 							"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
		// 							"subscriptionId": to.Ptr("{subscriptionId}"),
		// 							"webAppName": to.Ptr("myAspNetWebApp"),
		// 						},
		// 					},
		// 				},
		// 				Organization: &armdevops.OrganizationReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-org1"),
		// 				},
		// 				Project: &armdevops.ProjectReference{
		// 					Name: to.Ptr("myAspNetWebAppPipeline-project1"),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PipelinesClient) Update

func (client *PipelinesClient) Update(ctx context.Context, resourceGroupName string, pipelineName string, updateOperationParameters PipelineUpdateParameters, options *PipelinesClientUpdateOptions) (PipelinesClientUpdateResponse, error)

Update - Updates the properties of an Azure Pipeline. Currently, only tags can be updated. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2019-07-01-preview

  • resourceGroupName - Name of the resource group within the Azure subscription.
  • pipelineName - The name of the Azure Pipeline resource.
  • updateOperationParameters - The request payload containing the properties to update in the Azure Pipeline.
  • options - PipelinesClientUpdateOptions contains the optional parameters for the PipelinesClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/UpdateAzurePipeline.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/devops/armdevops"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdevops.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewPipelinesClient().Update(ctx, "myAspNetWebAppPipeline-rg", "myAspNetWebAppPipeline", armdevops.PipelineUpdateParameters{
		Tags: map[string]*string{
			"tagKey": to.Ptr("tagvalue"),
		},
	}, 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.Pipeline = armdevops.Pipeline{
	// 	Name: to.Ptr("myAspNetWebAppPipeline"),
	// 	Type: to.Ptr("Microsoft.DevOps/pipelines"),
	// 	ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myAspNetWebAppPipeline-rg/providers/Microsoft.DevOps/pipelines/myAspNetWebAppPipeline"),
	// 	Location: to.Ptr("South India"),
	// 	Tags: map[string]*string{
	// 		"tagKey": to.Ptr("tagvalue"),
	// 	},
	// 	Properties: &armdevops.PipelineProperties{
	// 		BootstrapConfiguration: &armdevops.BootstrapConfiguration{
	// 			Template: &armdevops.PipelineTemplate{
	// 				ID: to.Ptr("ms.vss-continuous-delivery-pipeline-templates.aspnet-windowswebapp"),
	// 				Parameters: map[string]*string{
	// 					"appInsightLocation": to.Ptr("South India"),
	// 					"appServicePlan": to.Ptr("S1 Standard"),
	// 					"azureAuth": nil,
	// 					"location": to.Ptr("South India"),
	// 					"resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"),
	// 					"subscriptionId": to.Ptr("{subscriptionId}"),
	// 					"webAppName": to.Ptr("myAspNetWebApp"),
	// 				},
	// 			},
	// 		},
	// 		Organization: &armdevops.OrganizationReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-org"),
	// 		},
	// 		Project: &armdevops.ProjectReference{
	// 			Name: to.Ptr("myAspNetWebAppPipeline-project"),
	// 		},
	// 	},
	// }
}
Output:

type PipelinesClientBeginCreateOrUpdateOptions added in v0.2.0

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

PipelinesClientBeginCreateOrUpdateOptions contains the optional parameters for the PipelinesClient.BeginCreateOrUpdate method.

type PipelinesClientCreateOrUpdateResponse added in v0.2.0

type PipelinesClientCreateOrUpdateResponse struct {
	// Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) for Azure resources.
	Pipeline
}

PipelinesClientCreateOrUpdateResponse contains the response from method PipelinesClient.BeginCreateOrUpdate.

type PipelinesClientDeleteOptions added in v0.2.0

type PipelinesClientDeleteOptions struct {
}

PipelinesClientDeleteOptions contains the optional parameters for the PipelinesClient.Delete method.

type PipelinesClientDeleteResponse added in v0.2.0

type PipelinesClientDeleteResponse struct {
}

PipelinesClientDeleteResponse contains the response from method PipelinesClient.Delete.

type PipelinesClientGetOptions added in v0.2.0

type PipelinesClientGetOptions struct {
}

PipelinesClientGetOptions contains the optional parameters for the PipelinesClient.Get method.

type PipelinesClientGetResponse added in v0.2.0

type PipelinesClientGetResponse struct {
	// Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) for Azure resources.
	Pipeline
}

PipelinesClientGetResponse contains the response from method PipelinesClient.Get.

type PipelinesClientListByResourceGroupOptions added in v0.2.0

type PipelinesClientListByResourceGroupOptions struct {
}

PipelinesClientListByResourceGroupOptions contains the optional parameters for the PipelinesClient.NewListByResourceGroupPager method.

type PipelinesClientListByResourceGroupResponse added in v0.2.0

type PipelinesClientListByResourceGroupResponse struct {
	// Result of a request to list all Azure Pipelines under a given scope.
	PipelineListResult
}

PipelinesClientListByResourceGroupResponse contains the response from method PipelinesClient.NewListByResourceGroupPager.

type PipelinesClientListBySubscriptionOptions added in v0.2.0

type PipelinesClientListBySubscriptionOptions struct {
}

PipelinesClientListBySubscriptionOptions contains the optional parameters for the PipelinesClient.NewListBySubscriptionPager method.

type PipelinesClientListBySubscriptionResponse added in v0.2.0

type PipelinesClientListBySubscriptionResponse struct {
	// Result of a request to list all Azure Pipelines under a given scope.
	PipelineListResult
}

PipelinesClientListBySubscriptionResponse contains the response from method PipelinesClient.NewListBySubscriptionPager.

type PipelinesClientUpdateOptions added in v0.2.0

type PipelinesClientUpdateOptions struct {
}

PipelinesClientUpdateOptions contains the optional parameters for the PipelinesClient.Update method.

type PipelinesClientUpdateResponse added in v0.2.0

type PipelinesClientUpdateResponse struct {
	// Azure DevOps Pipeline used to configure Continuous Integration (CI) & Continuous Delivery (CD) for Azure resources.
	Pipeline
}

PipelinesClientUpdateResponse contains the response from method PipelinesClient.Update.

type ProjectReference

type ProjectReference struct {
	// REQUIRED; Name of the Azure DevOps Project.
	Name *string

	// READ-ONLY; Unique immutable identifier of the Azure DevOps Project.
	ID *string
}

ProjectReference - Reference to an Azure DevOps Project.

func (ProjectReference) MarshalJSON added in v0.6.0

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

MarshalJSON implements the json.Marshaller interface for type ProjectReference.

func (*ProjectReference) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type ProjectReference.

type Resource

type Resource struct {
	// Resource Location
	Location *string

	// Resource Tags
	Tags map[string]*string

	// READ-ONLY; Resource Id
	ID *string

	// READ-ONLY; Resource Name
	Name *string

	// READ-ONLY; Resource Type
	Type *string
}

Resource - An Azure Resource Manager (ARM) resource.

func (Resource) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v0.6.0

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

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL