contracts

package
v0.0.0-...-ddafa38 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Package contracts contains API contracts that azd CLI communicates externally in commands via stdout. Currently, all contracts support JSON output.

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthTokenResult

type AuthTokenResult struct {
	// Token is the opaque access token, which may be provided to an Azure service.
	Token string `json:"token"`
	// ExpiresOn is the time at which the token is no longer valid. The time is a quoted string in
	// RFC 3339 format.
	ExpiresOn RFC3339Time `json:"expiresOn"`
}

AuthTokenResult is the value returned by `azd get-access-token`. It matches the shape of `azcore.AccessToken`

type ConsoleMessage

type ConsoleMessage struct {
	Message string `json:"message"`
}

type EnvListEnvironment

type EnvListEnvironment struct {
	Name       string `json:"Name"`
	IsDefault  bool   `json:"IsDefault"`
	DotEnvPath string `json:"DotEnvPath"`
	ConfigPath string `json:"ConfigPath"`
}

type EnvRefreshOutputParameter

type EnvRefreshOutputParameter struct {
	Type  EnvRefreshOutputType `json:"type"`
	Value any                  `json:"value"`
}

EnvRefreshOutputParameter is the contract for the value in the "outputs" map of and EnvRefreshResult.

type EnvRefreshOutputType

type EnvRefreshOutputType string

EvnRefreshOutputType are the values for the "type" property of an output.

const (
	EnvRefreshOutputTypeBoolean EnvRefreshOutputType = "boolean"
	EnvRefreshOutputTypeString  EnvRefreshOutputType = "string"
	EnvRefreshOutputTypeNumber  EnvRefreshOutputType = "number"
	EnvRefreshOutputTypeObject  EnvRefreshOutputType = "object"
	EnvRefreshOutputTypeArray   EnvRefreshOutputType = "array"
)

type EnvRefreshResource

type EnvRefreshResource struct {
	Id string `json:"id"`
}

EnvRefreshResource is the contract for a resource in the "resources" array

type EnvRefreshResult

type EnvRefreshResult struct {
	Outputs   map[string]EnvRefreshOutputParameter `json:"outputs"`
	Resources []EnvRefreshResource                 `json:"resources"`
}

EnvRefreshResult is the contract for the output of `azd env refresh`.

type EventDataType

type EventDataType string
const (
	ConsoleMessageEventDataType EventDataType = "consoleMessage"
)

type EventEnvelope

type EventEnvelope struct {
	Type      EventDataType `json:"type"`
	Timestamp time.Time     `json:"timestamp"`
	Data      any           `json:"data"`
}

type LoginResult

type LoginResult struct {
	// The result of checking for a valid access token.
	Status LoginStatus `json:"status"`
	// When status is `LoginStatusSuccess`, the time at which the access token
	// expires.
	ExpiresOn *time.Time `json:"expiresOn,omitempty"`
}

LoginResult is the contract for the output of `azd auth login`.

type LoginStatus

type LoginStatus string

LoginStatus are the values of the "status" property of a LoginResult

const (
	// The user is logged in and we were able to obtain an access token for them.
	// The "ExpiresOn" property of the result will contain information on when the
	// access token expires.
	LoginStatusSuccess LoginStatus = "success"
	// The user is not logged in.
	LoginStatusUnauthenticated LoginStatus = "unauthenticated"
)

type RFC3339Time

type RFC3339Time time.Time

RFC3339Time is a time.Time that uses time.RFC3339 format when marshaling to JSON, not time.RFC3339Nano as the standard library time.Time does.

func (RFC3339Time) MarshalJSON

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

func (*RFC3339Time) UnmarshalJSON

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

type ShowResult

type ShowResult struct {
	Name     string                 `json:"name"`
	Services map[string]ShowService `json:"services"`
}

ShowResult is the contract for the output of `azd show`

type ShowService

type ShowService struct {
	// Project contains information about the project that backs this service.
	Project ShowServiceProject `json:"project"`
	// Target contains information about the resource that the service is deployed
	// to.
	Target    *ShowTargetArm `json:"target,omitempty"`
	IngresUrl string         `json:"-"`
}

ShowService is the contract for a service returned by `azd show`

type ShowServiceProject

type ShowServiceProject struct {
	// Path contains the path to the project for this service.
	// When 'type' is 'dotnet', this includes the project file (i.e. Todo.Api.csproj).
	Path string `json:"path"`
	// The type of this project.
	Type ShowType `json:"language"`
}

ShowServiceProject is the contract for a service's project as returned by `azd show`

type ShowTargetArm

type ShowTargetArm struct {
	ResourceIds []string `json:"resourceIds"`
}

ShowTargetArm is the contract for information about the resources that a given service is deployed to.

type ShowType

type ShowType string

ShowType are the values for the language property of a ShowServiceProject

const (
	ShowTypeNone   ShowType = ""
	ShowTypeDotNet ShowType = "dotnet"
	ShowTypePython ShowType = "python"
	ShowTypeNode   ShowType = "node"
	ShowTypeJava   ShowType = "java"
)

type VersionResult

type VersionResult struct {
	Azd struct {
		Version string `json:"version"`
		Commit  string `json:"commit"`
	} `json:"azd"`
}

VersionResult is the contract for the output of `azd version`

type VsServerResult

type VsServerResult struct {
	Port int `json:"port"`
	Pid  int `json:"pid"`
	// The certificate that the server uses to secure the TLS connection. This is the base 64 encoding of the raw bytes of
	// the DER encoded certificate. The client should use this to verify the server's identity. In .NET, You can use
	// `X509Certificate2.ctor(byte[])` to construct a certificate from these bytes, after Base64 decoding. When TLS is not
	// used, this will be null.
	CertificateBytes *string `json:"certificateBytes,omitempty"`
	VersionResult
}

Jump to

Keyboard shortcuts

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