azsdk

package
v0.0.0-...-4d33260 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const MsCorrelationIdHeader = "x-ms-correlation-request-id"

See https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/common-api-details.md#client-request-headers

Variables

This section is empty.

Functions

func NewMsCorrelationPolicy

func NewMsCorrelationPolicy() policy.Policy

NewMsCorrelationPolicy creates a policy that sets Microsoft correlation ID headers on HTTP requests. This works for Azure REST API, and could also work for other Microsoft-hosted services that do not yet honor distributed tracing.

func NewMsGraphCorrelationPolicy

func NewMsGraphCorrelationPolicy() policy.Policy

NewMsGraphCorrelationPolicy creates a policy that sets Microsoft Graph correlation ID headers on HTTP requests.

func NewUserAgentPolicy

func NewUserAgentPolicy(userAgent string) policy.Policy

Policy to ensure the AZD custom user agent is set on all HTTP requests.

Types

type DeployResponse

type DeployResponse struct {
	DeployStatus
}

type DeployStatus

type DeployStatus struct {
	Id           string     `json:"id"`
	Status       int        `json:"status"`
	StatusText   string     `json:"status_text"`
	Message      string     `json:"message"`
	Progress     *string    `json:"progress"`
	ReceivedTime *time.Time `json:"received_time"`
	StartTime    *time.Time `json:"start_time"`
	EndTime      *time.Time `json:"end_time"`
	Complete     bool       `json:"complete"`
	Active       bool       `json:"active"`
	LogUrl       string     `json:"log_url"`
	SiteName     string     `json:"site_name"`
}

type DeployStatusResponse

type DeployStatusResponse struct {
	DeployStatus
}

type FuncAppHostClient

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

FuncAppHostClient contains methods for interacting with the Azure Functions application host, usually located at *.scm.azurewebsites.net

func NewFuncAppHostClient

func NewFuncAppHostClient(
	hostName string,
	credential azcore.TokenCredential,
	options *arm.ClientOptions,
) (*FuncAppHostClient, error)

func (*FuncAppHostClient) Publish

func (c *FuncAppHostClient) Publish(
	ctx context.Context,
	zipFile io.ReadSeeker,
	options *PublishOptions) (PublishResponse, error)

Publish deploys an application zip file to the function app host. This is currently only supported for flexconsumption plans.

type PublishBuildSummary

type PublishBuildSummary struct {
	Errors   []string `json:"errors"`
	Warnings []string `json:"warnings"`
}

type PublishOptions

type PublishOptions struct {
	// If true, the remote host will run Oryx remote build steps after publishing.
	// This would run steps like `npm i` or `npm run build` for Node apps,
	// or activating the virtual environment for Python apps.
	RemoteBuild bool
}

type PublishResponse

type PublishResponse struct {
	Id                 string              `json:"id"`
	Status             PublishStatus       `json:"status"`
	StatusText         string              `json:"status_text"`
	AuthorEmail        string              `json:"author_email"`
	Author             string              `json:"author"`
	Deployer           string              `json:"deployer"`
	RemoteBuild        bool                `json:"remoteBuild"`
	Message            string              `json:"message"`
	Progress           string              `json:"progress"`
	ReceivedTime       time.Time           `json:"received_time"`
	StartTime          time.Time           `json:"start_time"`
	EndTime            time.Time           `json:"end_time"`
	LastSuccessEndTime time.Time           `json:"last_success_end_time"`
	Complete           bool                `json:"complete"`
	Active             bool                `json:"active"`
	IsTemp             bool                `json:"is_temp"`
	IsReadonly         bool                `json:"is_readonly"`
	Url                string              `json:"url"`
	LogUrl             string              `json:"log_url"`
	SiteName           string              `json:"site_name"`
	BuildSummary       PublishBuildSummary `json:"build_summary"`
}

The response for a deployment located at api/deployments/{id} that represents the deployment initiated by api/publish.

type PublishStatus

type PublishStatus int
const (
	PublishStatusCancelled      PublishStatus = -1
	PublishStatusPending        PublishStatus = 0
	PublishStatusBuilding       PublishStatus = 1
	PublishStatusDeploying      PublishStatus = 2
	PublishStatusFailed         PublishStatus = 3
	PublishStatusSuccess        PublishStatus = 4
	PublishStatusConflict       PublishStatus = 5
	PublishStatusPartialSuccess PublishStatus = 6
)

type ZipDeployClient

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

ZipDeployClient wraps usage of app service zip deploy used for application deployments More info can be found at the following: https://github.com/MicrosoftDocs/azure-docs/blob/main/includes/app-service-deploy-zip-push-rest.md https://github.com/projectkudu/kudu/wiki/REST-API

func NewZipDeployClient

func NewZipDeployClient(
	hostName string,
	credential azcore.TokenCredential,
	armClientOptions *arm.ClientOptions,
) (*ZipDeployClient, error)

Creates a new ZipDeployClient instance

func (*ZipDeployClient) BeginDeploy

func (c *ZipDeployClient) BeginDeploy(
	ctx context.Context,
	zipFile io.ReadSeeker,
) (*runtime.Poller[*DeployResponse], error)

Begins a zip deployment and returns a poller to check for status

func (*ZipDeployClient) BeginDeployTrackStatus

func (c *ZipDeployClient) BeginDeployTrackStatus(
	ctx context.Context,
	zipFile io.ReadSeeker,
	subscriptionId,
	resourceGroup,
	appName string,
) (*runtime.Poller[armappservice.WebAppsClientGetProductionSiteDeploymentStatusResponse], error)

Deploys the specified application zip to the azure app service using deployment status api and waits for completion

func (*ZipDeployClient) Deploy

func (c *ZipDeployClient) Deploy(ctx context.Context, zipFile io.ReadSeeker) (*DeployResponse, error)

Deploys the specified application zip to the azure app service and waits for completion

func (*ZipDeployClient) DeployTrackStatus

func (c *ZipDeployClient) DeployTrackStatus(
	ctx context.Context,
	zipFile io.ReadSeeker,
	subscriptionId string,
	resourceGroup string,
	appName string,
	progressLog func(string)) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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