Documentation
¶
Index ¶
- type ACR
- type ActionType
- type ArtifactGenerationProperties
- type AuthorizationStatus
- type ClientFactory
- type CreatedByType
- type DeleteWorkflowResponse
- type DeploymentProperties
- type DeveloperHubServiceClient
- func (client *DeveloperHubServiceClient) GeneratePreviewArtifacts(ctx context.Context, location string, parameters ArtifactGenerationProperties, ...) (DeveloperHubServiceClientGeneratePreviewArtifactsResponse, error)
- func (client *DeveloperHubServiceClient) GitHubOAuth(ctx context.Context, location string, ...) (DeveloperHubServiceClientGitHubOAuthResponse, error)
- func (client *DeveloperHubServiceClient) GitHubOAuthCallback(ctx context.Context, location string, code string, state string, ...) (DeveloperHubServiceClientGitHubOAuthCallbackResponse, error)
- func (client *DeveloperHubServiceClient) ListGitHubOAuth(ctx context.Context, location string, ...) (DeveloperHubServiceClientListGitHubOAuthResponse, error)
- type DeveloperHubServiceClientGeneratePreviewArtifactsOptions
- type DeveloperHubServiceClientGeneratePreviewArtifactsResponse
- type DeveloperHubServiceClientGitHubOAuthCallbackOptions
- type DeveloperHubServiceClientGitHubOAuthCallbackResponse
- type DeveloperHubServiceClientGitHubOAuthOptions
- type DeveloperHubServiceClientGitHubOAuthResponse
- type DeveloperHubServiceClientListGitHubOAuthOptions
- type DeveloperHubServiceClientListGitHubOAuthResponse
- type DockerfileGenerationMode
- type ExportTemplateRequest
- type GenerationLanguage
- type GenerationManifestType
- type GitHubOAuthCallRequest
- type GitHubOAuthInfoResponse
- type GitHubOAuthListResponse
- type GitHubOAuthProperties
- type GitHubOAuthResponse
- type GitHubWorkflowProfile
- type GitHubWorkflowProfileOidcCredentials
- type IacGitHubProfile
- type IacProfile
- type IacProfileListResult
- type IacProfileProperties
- type IacProfilesClient
- func (client *IacProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientCreateOrUpdateResponse, error)
- func (client *IacProfilesClient) Delete(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientDeleteResponse, error)
- func (client *IacProfilesClient) Export(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientExportResponse, error)
- func (client *IacProfilesClient) Get(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientGetResponse, error)
- func (client *IacProfilesClient) NewListByResourceGroupPager(resourceGroupName string, options *IacProfilesClientListByResourceGroupOptions) *runtime.Pager[IacProfilesClientListByResourceGroupResponse]
- func (client *IacProfilesClient) NewListPager(options *IacProfilesClientListOptions) *runtime.Pager[IacProfilesClientListResponse]
- func (client *IacProfilesClient) Scale(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientScaleResponse, error)
- func (client *IacProfilesClient) Sync(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientSyncResponse, error)
- func (client *IacProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, iacProfileName string, ...) (IacProfilesClientUpdateTagsResponse, error)
- type IacProfilesClientCreateOrUpdateOptions
- type IacProfilesClientCreateOrUpdateResponse
- type IacProfilesClientDeleteOptions
- type IacProfilesClientDeleteResponse
- type IacProfilesClientExportOptions
- type IacProfilesClientExportResponse
- type IacProfilesClientGetOptions
- type IacProfilesClientGetResponse
- type IacProfilesClientListByResourceGroupOptions
- type IacProfilesClientListByResourceGroupResponse
- type IacProfilesClientListOptions
- type IacProfilesClientListResponse
- type IacProfilesClientScaleOptions
- type IacProfilesClientScaleResponse
- type IacProfilesClientSyncOptions
- type IacProfilesClientSyncResponse
- type IacProfilesClientUpdateTagsOptions
- type IacProfilesClientUpdateTagsResponse
- type IacTemplateDetails
- type IacTemplateProperties
- type ManifestGenerationMode
- type ManifestType
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type PrLinkResponse
- type PullRequestStatus
- type QuickStartTemplateType
- type ScaleProperty
- type ScaleTemplateRequest
- type StageProperties
- type SystemData
- type TagsObject
- type TerraformProfile
- type Workflow
- type WorkflowClient
- func (client *WorkflowClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workflowName string, ...) (WorkflowClientCreateOrUpdateResponse, error)
- func (client *WorkflowClient) Delete(ctx context.Context, resourceGroupName string, workflowName string, ...) (WorkflowClientDeleteResponse, error)
- func (client *WorkflowClient) Get(ctx context.Context, resourceGroupName string, workflowName string, ...) (WorkflowClientGetResponse, error)
- func (client *WorkflowClient) NewListByResourceGroupPager(resourceGroupName string, options *WorkflowClientListByResourceGroupOptions) *runtime.Pager[WorkflowClientListByResourceGroupResponse]
- func (client *WorkflowClient) NewListPager(options *WorkflowClientListOptions) *runtime.Pager[WorkflowClientListResponse]
- func (client *WorkflowClient) UpdateTags(ctx context.Context, resourceGroupName string, workflowName string, ...) (WorkflowClientUpdateTagsResponse, error)
- type WorkflowClientCreateOrUpdateOptions
- type WorkflowClientCreateOrUpdateResponse
- type WorkflowClientDeleteOptions
- type WorkflowClientDeleteResponse
- type WorkflowClientGetOptions
- type WorkflowClientGetResponse
- type WorkflowClientListByResourceGroupOptions
- type WorkflowClientListByResourceGroupResponse
- type WorkflowClientListOptions
- type WorkflowClientListResponse
- type WorkflowClientUpdateTagsOptions
- type WorkflowClientUpdateTagsResponse
- type WorkflowListResult
- type WorkflowProperties
- type WorkflowRun
- type WorkflowRunStatus
Examples ¶
- DeveloperHubServiceClient.GeneratePreviewArtifacts
- DeveloperHubServiceClient.GitHubOAuth
- DeveloperHubServiceClient.GitHubOAuthCallback
- DeveloperHubServiceClient.ListGitHubOAuth
- IacProfilesClient.CreateOrUpdate
- IacProfilesClient.Delete
- IacProfilesClient.Export
- IacProfilesClient.Get
- IacProfilesClient.NewListByResourceGroupPager
- IacProfilesClient.NewListPager
- IacProfilesClient.Scale
- IacProfilesClient.Sync
- IacProfilesClient.UpdateTags
- OperationsClient.List
- WorkflowClient.CreateOrUpdate (CreateWorkflow)
- WorkflowClient.CreateOrUpdate (CreateWorkflowWithArtifactGeneration)
- WorkflowClient.Delete
- WorkflowClient.Get
- WorkflowClient.NewListByResourceGroupPager
- WorkflowClient.NewListPager
- WorkflowClient.UpdateTags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACR ¶
type ACR struct {
// ACR registry
AcrRegistryName *string
// ACR repository
AcrRepositoryName *string
// ACR resource group
AcrResourceGroup *string
// ACR subscription id
AcrSubscriptionID *string
}
ACR - Information on the azure container registry
func (ACR) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type ACR.
func (*ACR) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type ACR.
type ActionType ¶
type ActionType string
ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
const (
ActionTypeInternal ActionType = "Internal"
)
func PossibleActionTypeValues ¶
func PossibleActionTypeValues() []ActionType
PossibleActionTypeValues returns the possible values for the ActionType const type.
type ArtifactGenerationProperties ¶
type ArtifactGenerationProperties struct {
// The name of the app.
AppName *string
// The version of the language image used for building the code in the generated dockerfile.
BuilderVersion *string
// The mode of generation to be used for generating Dockerfiles.
DockerfileGenerationMode *DockerfileGenerationMode
// The directory to output the generated Dockerfile to.
DockerfileOutputDirectory *string
// The programming language used.
GenerationLanguage *GenerationLanguage
// The name of the image to be generated.
ImageName *string
// The tag to apply to the generated image.
ImageTag *string
// The version of the language image used for execution in the generated dockerfile.
LanguageVersion *string
// The mode of generation to be used for generating Manifest.
ManifestGenerationMode *ManifestGenerationMode
// The directory to output the generated manifests to.
ManifestOutputDirectory *string
// Determines the type of manifests to be generated.
ManifestType *GenerationManifestType
// The namespace to deploy the application to.
Namespace *string
// The port the application is exposed on.
Port *string
}
ArtifactGenerationProperties - Properties used for generating artifacts such as Dockerfiles and manifests.
func (ArtifactGenerationProperties) MarshalJSON ¶
func (a ArtifactGenerationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ArtifactGenerationProperties.
func (*ArtifactGenerationProperties) UnmarshalJSON ¶
func (a *ArtifactGenerationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactGenerationProperties.
type AuthorizationStatus ¶
type AuthorizationStatus string
AuthorizationStatus - Determines the authorization status of requests.
const ( // AuthorizationStatusAuthorized - Requests authorized successfully AuthorizationStatusAuthorized AuthorizationStatus = "Authorized" // AuthorizationStatusError - Requests returned other error response AuthorizationStatusError AuthorizationStatus = "Error" // AuthorizationStatusNotFound - Requests returned NotFound response AuthorizationStatusNotFound AuthorizationStatus = "NotFound" )
func PossibleAuthorizationStatusValues ¶
func PossibleAuthorizationStatusValues() []AuthorizationStatus
PossibleAuthorizationStatusValues returns the possible values for the AuthorizationStatus const type.
type ClientFactory ¶
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 ¶
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) NewDeveloperHubServiceClient ¶
func (c *ClientFactory) NewDeveloperHubServiceClient() *DeveloperHubServiceClient
NewDeveloperHubServiceClient creates a new instance of DeveloperHubServiceClient.
func (*ClientFactory) NewIacProfilesClient ¶
func (c *ClientFactory) NewIacProfilesClient() *IacProfilesClient
NewIacProfilesClient creates a new instance of IacProfilesClient.
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewWorkflowClient ¶
func (c *ClientFactory) NewWorkflowClient() *WorkflowClient
NewWorkflowClient creates a new instance of WorkflowClient.
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 DeleteWorkflowResponse ¶
type DeleteWorkflowResponse struct {
// delete status message
Status *string
}
DeleteWorkflowResponse - delete response if content must be provided on delete operation
func (DeleteWorkflowResponse) MarshalJSON ¶
func (d DeleteWorkflowResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteWorkflowResponse.
func (*DeleteWorkflowResponse) UnmarshalJSON ¶
func (d *DeleteWorkflowResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteWorkflowResponse.
type DeploymentProperties ¶
type DeploymentProperties struct {
// Helm chart directory path in repository.
HelmChartPath *string
// Helm Values.yaml file location in repository.
HelmValues *string
KubeManifestLocations []*string
// Determines the type of manifests within the repository.
ManifestType *ManifestType
// Manifest override values.
Overrides map[string]*string
}
func (DeploymentProperties) MarshalJSON ¶
func (d DeploymentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentProperties.
func (*DeploymentProperties) UnmarshalJSON ¶
func (d *DeploymentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.
type DeveloperHubServiceClient ¶
type DeveloperHubServiceClient struct {
// contains filtered or unexported fields
}
DeveloperHubServiceClient contains the methods for the DeveloperHubServiceClient group. Don't use this type directly, use NewDeveloperHubServiceClient() instead.
func NewDeveloperHubServiceClient ¶
func NewDeveloperHubServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeveloperHubServiceClient, error)
NewDeveloperHubServiceClient creates a new instance of DeveloperHubServiceClient 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 (*DeveloperHubServiceClient) GeneratePreviewArtifacts ¶
func (client *DeveloperHubServiceClient) GeneratePreviewArtifacts(ctx context.Context, location string, parameters ArtifactGenerationProperties, options *DeveloperHubServiceClientGeneratePreviewArtifactsOptions) (DeveloperHubServiceClientGeneratePreviewArtifactsResponse, error)
GeneratePreviewArtifacts - Generate preview dockerfile and manifests. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- location - The name of the Azure region.
- options - DeveloperHubServiceClientGeneratePreviewArtifactsOptions contains the optional parameters for the DeveloperHubServiceClient.GeneratePreviewArtifacts method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/GeneratePreviewArtifacts.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDeveloperHubServiceClient().GeneratePreviewArtifacts(ctx, "location1", armdevhub.ArtifactGenerationProperties{
AppName: to.Ptr("my-app"),
DockerfileGenerationMode: to.Ptr(armdevhub.DockerfileGenerationModeEnabled),
DockerfileOutputDirectory: to.Ptr("./"),
GenerationLanguage: to.Ptr(armdevhub.GenerationLanguageJavascript),
ImageName: to.Ptr("myimage"),
ImageTag: to.Ptr("latest"),
LanguageVersion: to.Ptr("14"),
ManifestGenerationMode: to.Ptr(armdevhub.ManifestGenerationModeEnabled),
ManifestOutputDirectory: to.Ptr("./"),
ManifestType: to.Ptr(armdevhub.GenerationManifestTypeKube),
Namespace: to.Ptr("my-namespace"),
Port: to.Ptr("80"),
}, 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.Value = map[string]*string{
// "dockerfiles/example-dockerfile": to.Ptr("dockerfile-content \n including newlines"),
// "manifests/example-manifest-file-1": to.Ptr("manifest file 1 content \n including newlines"),
// "manifests/example-manifest-file-2": to.Ptr("manifest file 2 content \n including newlines"),
// }
}
func (*DeveloperHubServiceClient) GitHubOAuth ¶
func (client *DeveloperHubServiceClient) GitHubOAuth(ctx context.Context, location string, options *DeveloperHubServiceClientGitHubOAuthOptions) (DeveloperHubServiceClientGitHubOAuthResponse, error)
GitHubOAuth - Gets GitHubOAuth info used to authenticate users with the Developer Hub GitHub App. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- location - The name of the Azure region.
- options - DeveloperHubServiceClientGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuth method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/GitHubOAuth.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDeveloperHubServiceClient().GitHubOAuth(ctx, "eastus2euap", &armdevhub.DeveloperHubServiceClientGitHubOAuthOptions{Parameters: &armdevhub.GitHubOAuthCallRequest{
RedirectURL: to.Ptr("https://ms.portal.azure.com/aks"),
},
})
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.GitHubOAuthInfoResponse = armdevhub.GitHubOAuthInfoResponse{
// AuthURL: to.Ptr("https://github.com/login/oauth/authorize?client_id=11111111&redirect_uri=https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth&state=2345678-3456-7890-5678-012345678901&scope=repo,user:email,workflow"),
// Token: to.Ptr(""),
// }
}
func (*DeveloperHubServiceClient) GitHubOAuthCallback ¶
func (client *DeveloperHubServiceClient) GitHubOAuthCallback(ctx context.Context, location string, code string, state string, options *DeveloperHubServiceClientGitHubOAuthCallbackOptions) (DeveloperHubServiceClientGitHubOAuthCallbackResponse, error)
GitHubOAuthCallback - Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- location - The name of the Azure region.
- code - The code response from authenticating the GitHub App.
- state - The state response from authenticating the GitHub App.
- options - DeveloperHubServiceClientGitHubOAuthCallbackOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuthCallback method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/GitHubOAuthCallback.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDeveloperHubServiceClient().GitHubOAuthCallback(ctx, "eastus2euap", "3584d83530557fdd1f46af8289938c8ef79f9dc5", "12345678-3456-7890-5678-012345678901", 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.GitHubOAuthResponse = armdevhub.GitHubOAuthResponse{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.DevHub/locations/githuboauth"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth/default"),
// Properties: &armdevhub.GitHubOAuthProperties{
// Username: to.Ptr("user"),
// },
// }
}
func (*DeveloperHubServiceClient) ListGitHubOAuth ¶
func (client *DeveloperHubServiceClient) ListGitHubOAuth(ctx context.Context, location string, options *DeveloperHubServiceClientListGitHubOAuthOptions) (DeveloperHubServiceClientListGitHubOAuthResponse, error)
ListGitHubOAuth - Callback URL to hit once authenticated with GitHub App to have the service store the OAuth token. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- location - The name of the Azure region.
- options - DeveloperHubServiceClientListGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.ListGitHubOAuth method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/GitHubOAuth_List.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDeveloperHubServiceClient().ListGitHubOAuth(ctx, "eastus2euap", 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.GitHubOAuthListResponse = armdevhub.GitHubOAuthListResponse{
// Value: []*armdevhub.GitHubOAuthResponse{
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.DevHub/locations/githuboauth"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DevHub/locations/eastus2euap/githuboauth/default"),
// Properties: &armdevhub.GitHubOAuthProperties{
// Username: to.Ptr("user"),
// },
// }},
// }
}
type DeveloperHubServiceClientGeneratePreviewArtifactsOptions ¶
type DeveloperHubServiceClientGeneratePreviewArtifactsOptions struct {
}
DeveloperHubServiceClientGeneratePreviewArtifactsOptions contains the optional parameters for the DeveloperHubServiceClient.GeneratePreviewArtifacts method.
type DeveloperHubServiceClientGeneratePreviewArtifactsResponse ¶
type DeveloperHubServiceClientGeneratePreviewArtifactsResponse struct {
// Dockerfile and manifest artifacts generated as a preview are returned as a map<path string,content string>
Value map[string]*string
}
DeveloperHubServiceClientGeneratePreviewArtifactsResponse contains the response from method DeveloperHubServiceClient.GeneratePreviewArtifacts.
type DeveloperHubServiceClientGitHubOAuthCallbackOptions ¶
type DeveloperHubServiceClientGitHubOAuthCallbackOptions struct {
}
DeveloperHubServiceClientGitHubOAuthCallbackOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuthCallback method.
type DeveloperHubServiceClientGitHubOAuthCallbackResponse ¶
type DeveloperHubServiceClientGitHubOAuthCallbackResponse struct {
// Singleton response of GitHubOAuth containing
GitHubOAuthResponse
}
DeveloperHubServiceClientGitHubOAuthCallbackResponse contains the response from method DeveloperHubServiceClient.GitHubOAuthCallback.
type DeveloperHubServiceClientGitHubOAuthOptions ¶
type DeveloperHubServiceClientGitHubOAuthOptions struct {
Parameters *GitHubOAuthCallRequest
}
DeveloperHubServiceClientGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.GitHubOAuth method.
type DeveloperHubServiceClientGitHubOAuthResponse ¶
type DeveloperHubServiceClientGitHubOAuthResponse struct {
// URL used to authorize the Developer Hub GitHub App
GitHubOAuthInfoResponse
}
DeveloperHubServiceClientGitHubOAuthResponse contains the response from method DeveloperHubServiceClient.GitHubOAuth.
type DeveloperHubServiceClientListGitHubOAuthOptions ¶
type DeveloperHubServiceClientListGitHubOAuthOptions struct {
}
DeveloperHubServiceClientListGitHubOAuthOptions contains the optional parameters for the DeveloperHubServiceClient.ListGitHubOAuth method.
type DeveloperHubServiceClientListGitHubOAuthResponse ¶
type DeveloperHubServiceClientListGitHubOAuthResponse struct {
// The response from List GitHubOAuth operation.
GitHubOAuthListResponse
}
DeveloperHubServiceClientListGitHubOAuthResponse contains the response from method DeveloperHubServiceClient.ListGitHubOAuth.
type DockerfileGenerationMode ¶
type DockerfileGenerationMode string
DockerfileGenerationMode - The mode of generation to be used for generating Dockerfiles.
const ( // DockerfileGenerationModeDisabled - Dockerfiles will not be generated DockerfileGenerationModeDisabled DockerfileGenerationMode = "disabled" // DockerfileGenerationModeEnabled - Dockerfiles will be generated DockerfileGenerationModeEnabled DockerfileGenerationMode = "enabled" )
func PossibleDockerfileGenerationModeValues ¶
func PossibleDockerfileGenerationModeValues() []DockerfileGenerationMode
PossibleDockerfileGenerationModeValues returns the possible values for the DockerfileGenerationMode const type.
type ExportTemplateRequest ¶
type ExportTemplateRequest struct {
InstanceName *string
InstanceStage *string
ResourceGroupIDs []*string
SiteID *string
// Template Name
TemplateName *string
}
func (ExportTemplateRequest) MarshalJSON ¶
func (e ExportTemplateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExportTemplateRequest.
func (*ExportTemplateRequest) UnmarshalJSON ¶
func (e *ExportTemplateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExportTemplateRequest.
type GenerationLanguage ¶
type GenerationLanguage string
GenerationLanguage - The programming language used.
const ( // GenerationLanguageClojure - clojure language GenerationLanguageClojure GenerationLanguage = "clojure" // GenerationLanguageCsharp - csharp language GenerationLanguageCsharp GenerationLanguage = "csharp" // GenerationLanguageErlang - erlang language GenerationLanguageErlang GenerationLanguage = "erlang" // GenerationLanguageGo - go language GenerationLanguageGo GenerationLanguage = "go" // GenerationLanguageGomodule - gomodule language GenerationLanguageGomodule GenerationLanguage = "gomodule" // GenerationLanguageGradle - gradle language GenerationLanguageGradle GenerationLanguage = "gradle" // GenerationLanguageJava - java language GenerationLanguageJava GenerationLanguage = "java" // GenerationLanguageJavascript - javascript language GenerationLanguageJavascript GenerationLanguage = "javascript" // GenerationLanguagePhp - php language GenerationLanguagePhp GenerationLanguage = "php" // GenerationLanguagePython - python language GenerationLanguagePython GenerationLanguage = "python" // GenerationLanguageRuby - ruby language GenerationLanguageRuby GenerationLanguage = "ruby" // GenerationLanguageRust - rust language GenerationLanguageRust GenerationLanguage = "rust" // GenerationLanguageSwift - swift language GenerationLanguageSwift GenerationLanguage = "swift" )
func PossibleGenerationLanguageValues ¶
func PossibleGenerationLanguageValues() []GenerationLanguage
PossibleGenerationLanguageValues returns the possible values for the GenerationLanguage const type.
type GenerationManifestType ¶
type GenerationManifestType string
GenerationManifestType - Determines the type of manifests to be generated.
const ( // GenerationManifestTypeHelm - Helm manifests GenerationManifestTypeHelm GenerationManifestType = "helm" // GenerationManifestTypeKube - Kubernetes manifests GenerationManifestTypeKube GenerationManifestType = "kube" )
func PossibleGenerationManifestTypeValues ¶
func PossibleGenerationManifestTypeValues() []GenerationManifestType
PossibleGenerationManifestTypeValues returns the possible values for the GenerationManifestType const type.
type GitHubOAuthCallRequest ¶
type GitHubOAuthCallRequest struct {
// The URL the client will redirect to on successful authentication. If empty, no redirect will occur.
RedirectURL *string
}
GitHubOAuthCallRequest - GitHubOAuth request object
func (GitHubOAuthCallRequest) MarshalJSON ¶
func (g GitHubOAuthCallRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubOAuthCallRequest.
func (*GitHubOAuthCallRequest) UnmarshalJSON ¶
func (g *GitHubOAuthCallRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthCallRequest.
type GitHubOAuthInfoResponse ¶
type GitHubOAuthInfoResponse struct {
// URL for authorizing the Developer Hub GitHub App
AuthURL *string
// OAuth token used to make calls to GitHub
Token *string
}
GitHubOAuthInfoResponse - URL used to authorize the Developer Hub GitHub App
func (GitHubOAuthInfoResponse) MarshalJSON ¶
func (g GitHubOAuthInfoResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubOAuthInfoResponse.
func (*GitHubOAuthInfoResponse) UnmarshalJSON ¶
func (g *GitHubOAuthInfoResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthInfoResponse.
type GitHubOAuthListResponse ¶
type GitHubOAuthListResponse struct {
// Singleton list response containing one GitHubOAuthResponse response
Value []*GitHubOAuthResponse
}
GitHubOAuthListResponse - The response from List GitHubOAuth operation.
func (GitHubOAuthListResponse) MarshalJSON ¶
func (g GitHubOAuthListResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubOAuthListResponse.
func (*GitHubOAuthListResponse) UnmarshalJSON ¶
func (g *GitHubOAuthListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthListResponse.
type GitHubOAuthProperties ¶
type GitHubOAuthProperties struct {
// user making request
Username *string
}
GitHubOAuthProperties - The response from List GitHubOAuth operation.
func (GitHubOAuthProperties) MarshalJSON ¶
func (g GitHubOAuthProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubOAuthProperties.
func (*GitHubOAuthProperties) UnmarshalJSON ¶
func (g *GitHubOAuthProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthProperties.
type GitHubOAuthResponse ¶
type GitHubOAuthResponse struct {
// Properties of a workflow.
Properties *GitHubOAuthProperties
// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
GitHubOAuthResponse - Singleton response of GitHubOAuth containing
func (GitHubOAuthResponse) MarshalJSON ¶
func (g GitHubOAuthResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubOAuthResponse.
func (*GitHubOAuthResponse) UnmarshalJSON ¶
func (g *GitHubOAuthResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOAuthResponse.
type GitHubWorkflowProfile ¶
type GitHubWorkflowProfile struct {
// Information on the azure container registry
Acr *ACR
// The Azure Kubernetes Cluster Resource the application will be deployed to.
AksResourceID *string
// Repository Branch Name
BranchName *string
DeploymentProperties *DeploymentProperties
// Path to Dockerfile Build Context within the repository.
DockerBuildContext *string
// Path to the Dockerfile within the repository.
Dockerfile *string
LastWorkflowRun *WorkflowRun
// Kubernetes namespace the application is deployed to.
Namespace *string
// The fields needed for OIDC with GitHub.
OidcCredentials *GitHubWorkflowProfileOidcCredentials
// Repository Name
RepositoryName *string
// Repository Owner
RepositoryOwner *string
// READ-ONLY; Determines the authorization status of requests.
AuthStatus *AuthorizationStatus
// READ-ONLY; The status of the Pull Request submitted against the users repository.
PrStatus *PullRequestStatus
// READ-ONLY; The URL to the Pull Request submitted against the users repository.
PrURL *string
// READ-ONLY; The number associated with the submitted pull request.
PullNumber *int32
}
GitHubWorkflowProfile - GitHub Workflow Profile
func (GitHubWorkflowProfile) MarshalJSON ¶
func (g GitHubWorkflowProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubWorkflowProfile.
func (*GitHubWorkflowProfile) UnmarshalJSON ¶
func (g *GitHubWorkflowProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubWorkflowProfile.
type GitHubWorkflowProfileOidcCredentials ¶
type GitHubWorkflowProfileOidcCredentials struct {
// Azure Application Client ID
AzureClientID *string
// Azure Directory (tenant) ID
AzureTenantID *string
}
GitHubWorkflowProfileOidcCredentials - The fields needed for OIDC with GitHub.
func (GitHubWorkflowProfileOidcCredentials) MarshalJSON ¶
func (g GitHubWorkflowProfileOidcCredentials) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GitHubWorkflowProfileOidcCredentials.
func (*GitHubWorkflowProfileOidcCredentials) UnmarshalJSON ¶
func (g *GitHubWorkflowProfileOidcCredentials) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GitHubWorkflowProfileOidcCredentials.
type IacGitHubProfile ¶
type IacGitHubProfile struct {
// Repository Branch Name
BranchName *string
// Repository Main Branch
RepositoryMainBranch *string
// Repository Name
RepositoryName *string
// Repository Owner
RepositoryOwner *string
// READ-ONLY; Determines the authorization status of requests.
AuthStatus *AuthorizationStatus
// READ-ONLY; The status of the Pull Request submitted against the users repository.
PrStatus *PullRequestStatus
// READ-ONLY; The number associated with the submitted pull request.
PullNumber *int32
}
IacGitHubProfile - GitHub Profile of a IacProfile.
func (IacGitHubProfile) MarshalJSON ¶
func (i IacGitHubProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacGitHubProfile.
func (*IacGitHubProfile) UnmarshalJSON ¶
func (i *IacGitHubProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacGitHubProfile.
type IacProfile ¶
type IacProfile struct {
// REQUIRED; The geo-location where the resource lives
Location *string
// Properties of a IacProfile.
Properties *IacProfileProperties
// Resource tags.
Tags map[string]*string
// READ-ONLY; A unique read-only string that changes whenever the resource is updated.
Etag *string
// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
IacProfile - Resource representation of a IacProfile.
func (IacProfile) MarshalJSON ¶
func (i IacProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacProfile.
func (*IacProfile) UnmarshalJSON ¶
func (i *IacProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacProfile.
type IacProfileListResult ¶
type IacProfileListResult struct {
// The list of IacProfiles.
Value []*IacProfile
// READ-ONLY; The URL to the next set of IacProfile results.
NextLink *string
}
func (IacProfileListResult) MarshalJSON ¶
func (i IacProfileListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacProfileListResult.
func (*IacProfileListResult) UnmarshalJSON ¶
func (i *IacProfileListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacProfileListResult.
type IacProfileProperties ¶
type IacProfileProperties struct {
// GitHub Profile of a IacProfile
GithubProfile *IacGitHubProfile
Stages []*StageProperties
Templates []*IacTemplateProperties
// Terraform Profile of a IacProfile
TerraformProfile *TerraformProfile
}
IacProfileProperties - Properties of a IacProfile.
func (IacProfileProperties) MarshalJSON ¶
func (i IacProfileProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacProfileProperties.
func (*IacProfileProperties) UnmarshalJSON ¶
func (i *IacProfileProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacProfileProperties.
type IacProfilesClient ¶
type IacProfilesClient struct {
// contains filtered or unexported fields
}
IacProfilesClient contains the methods for the IacProfiles group. Don't use this type directly, use NewIacProfilesClient() instead.
func NewIacProfilesClient ¶
func NewIacProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IacProfilesClient, error)
NewIacProfilesClient creates a new instance of IacProfilesClient 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 (*IacProfilesClient) CreateOrUpdate ¶
func (client *IacProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, iacProfileName string, parameters IacProfile, options *IacProfilesClientCreateOrUpdateOptions) (IacProfilesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a IacProfile If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientCreateOrUpdateOptions contains the optional parameters for the IacProfilesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_CreateOrUpdate.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIacProfilesClient().CreateOrUpdate(ctx, "resourceGroup1", "profile1", armdevhub.IacProfile{
Location: to.Ptr("eastus"),
Properties: &armdevhub.IacProfileProperties{
GithubProfile: &armdevhub.IacGitHubProfile{
RepositoryName: to.Ptr("localtest"),
RepositoryOwner: to.Ptr("qfai"),
},
Stages: []*armdevhub.StageProperties{
{
Dependencies: []*string{},
GitEnvironment: to.Ptr("Terraform"),
StageName: to.Ptr("dev"),
},
{
Dependencies: []*string{
to.Ptr("dev")},
GitEnvironment: to.Ptr("Terraform"),
StageName: to.Ptr("qa"),
}},
Templates: []*armdevhub.IacTemplateProperties{
{
InstanceName: to.Ptr("quickinstance"),
InstanceStage: to.Ptr("dev"),
QuickStartTemplateType: to.Ptr(armdevhub.QuickStartTemplateTypeHCIAKS),
TemplateName: to.Ptr("hciaksss"),
}},
TerraformProfile: &armdevhub.TerraformProfile{
StorageAccountName: to.Ptr("iacbackend"),
StorageAccountResourceGroup: to.Ptr("test"),
StorageAccountSubscription: to.Ptr("586c20df-c465-4f10-8673-65aa4859e7ca"),
StorageContainerName: to.Ptr("tfbackend"),
},
},
}, 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.IacProfile = armdevhub.IacProfile{
// Name: to.Ptr("profile1"),
// Type: to.Ptr("Micfosoft.DevHub/iacProfiles"),
// ID: to.Ptr("/subscriptions/a0a37f63-7183-4e86-9ac7-ce8036a3ed31/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/iacProfiles/profile1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:23.933Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:30.783Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.IacProfileProperties{
// GithubProfile: &armdevhub.IacGitHubProfile{
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatus("Unspecified")),
// BranchName: to.Ptr("aks-devhub-ybvmw"),
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PullNumber: to.Ptr[int32](8),
// RepositoryMainBranch: to.Ptr("main"),
// RepositoryName: to.Ptr("localtest"),
// RepositoryOwner: to.Ptr("owner"),
// },
// Stages: []*armdevhub.StageProperties{
// {
// Dependencies: []*string{
// },
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("dev"),
// },
// {
// Dependencies: []*string{
// to.Ptr("dev")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("qa"),
// },
// {
// Dependencies: []*string{
// to.Ptr("qa")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("prod"),
// }},
// Templates: []*armdevhub.IacTemplateProperties{
// {
// InstanceName: to.Ptr("contoso"),
// InstanceStage: to.Ptr("dev"),
// SourceResourceID: to.Ptr("/subscriptions/xxxx/resourceGroups/xxxx"),
// TemplateDetails: []*armdevhub.IacTemplateDetails{
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-hci"),
// ProductName: to.Ptr("HCI"),
// },
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-aks"),
// ProductName: to.Ptr("AKSarc"),
// }},
// TemplateName: to.Ptr("base"),
// }},
// TerraformProfile: &armdevhub.TerraformProfile{
// StorageAccountName: to.Ptr("hybridiac"),
// StorageAccountResourceGroup: to.Ptr("hybrid-iac"),
// StorageAccountSubscription: to.Ptr("subscription"),
// StorageContainerName: to.Ptr("hybridiac"),
// },
// },
// }
}
func (*IacProfilesClient) Delete ¶
func (client *IacProfilesClient) Delete(ctx context.Context, resourceGroupName string, iacProfileName string, options *IacProfilesClientDeleteOptions) (IacProfilesClientDeleteResponse, error)
Delete - Deletes a IacProfile If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientDeleteOptions contains the optional parameters for the IacProfilesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_Delete.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewIacProfilesClient().Delete(ctx, "resourceGroup1", "iacprofile", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
func (*IacProfilesClient) Export ¶
func (client *IacProfilesClient) Export(ctx context.Context, resourceGroupName string, iacProfileName string, parameters ExportTemplateRequest, options *IacProfilesClientExportOptions) (IacProfilesClientExportResponse, error)
Export - Export a template If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientExportOptions contains the optional parameters for the IacProfilesClient.Export method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_ExportTemplate.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIacProfilesClient().Export(ctx, "resourceGroup1", "iacprofile", armdevhub.ExportTemplateRequest{
InstanceName: to.Ptr("iac208"),
InstanceStage: to.Ptr("dev"),
ResourceGroupIDs: []*string{
to.Ptr("/subscriptions/de3c4d5e-af08-451a-a873-438d86ab6f4b/resourceGroups/iac208-rg")},
TemplateName: to.Ptr("test"),
}, 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.PrLinkResponse = armdevhub.PrLinkResponse{
// PrLink: to.Ptr("xxxx"),
// }
}
func (*IacProfilesClient) Get ¶
func (client *IacProfilesClient) Get(ctx context.Context, resourceGroupName string, iacProfileName string, options *IacProfilesClientGetOptions) (IacProfilesClientGetResponse, error)
Get - Gets a IacProfile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientGetOptions contains the optional parameters for the IacProfilesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_Get.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIacProfilesClient().Get(ctx, "resourceGroup1", "iacprofile", 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.IacProfile = armdevhub.IacProfile{
// Name: to.Ptr("iacprofile"),
// Type: to.Ptr("Micfosoft.DevHub/iacProfiles"),
// ID: to.Ptr("/subscriptions/a0a37f63-7183-4e86-9ac7-ce8036a3ed31/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/iacProfiles/iacprofile"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:23.933Z"); return t}()),
// CreatedBy: to.Ptr(""),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T14:35:15.206Z"); return t}()),
// LastModifiedBy: to.Ptr("aks-dev-hub-devhub"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeApplication),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.IacProfileProperties{
// GithubProfile: &armdevhub.IacGitHubProfile{
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("aks-devhub-ybvmw"),
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PullNumber: to.Ptr[int32](8),
// RepositoryMainBranch: to.Ptr("main"),
// RepositoryName: to.Ptr("localtest"),
// RepositoryOwner: to.Ptr("owner"),
// },
// Stages: []*armdevhub.StageProperties{
// {
// Dependencies: []*string{
// },
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("dev"),
// },
// {
// Dependencies: []*string{
// to.Ptr("dev")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("qa"),
// },
// {
// Dependencies: []*string{
// to.Ptr("qa")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("prod"),
// }},
// Templates: []*armdevhub.IacTemplateProperties{
// {
// InstanceName: to.Ptr("contoso"),
// InstanceStage: to.Ptr("dev"),
// SourceResourceID: to.Ptr("/subscriptions/xxxx/resourceGroups/xxxx"),
// TemplateDetails: []*armdevhub.IacTemplateDetails{
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-hci"),
// ProductName: to.Ptr("HCI"),
// },
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-aks"),
// ProductName: to.Ptr("AKSarc"),
// }},
// TemplateName: to.Ptr("base"),
// }},
// TerraformProfile: &armdevhub.TerraformProfile{
// StorageAccountName: to.Ptr("hybridiac"),
// StorageAccountResourceGroup: to.Ptr("hybrid-iac"),
// StorageAccountSubscription: to.Ptr("subscriptions"),
// StorageContainerName: to.Ptr("hybridiac"),
// },
// },
// }
}
func (*IacProfilesClient) NewListByResourceGroupPager ¶
func (client *IacProfilesClient) NewListByResourceGroupPager(resourceGroupName string, options *IacProfilesClientListByResourceGroupOptions) *runtime.Pager[IacProfilesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Gets a list of iacProfiles within a resource group.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - IacProfilesClientListByResourceGroupOptions contains the optional parameters for the IacProfilesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_ListByResourceGroup.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewIacProfilesClient().NewListByResourceGroupPager("resourceGroup1", 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.IacProfileListResult = armdevhub.IacProfileListResult{
// Value: []*armdevhub.IacProfile{
// {
// Name: to.Ptr("profilename"),
// Type: to.Ptr("Microsoft.DevHub/iacProfiles"),
// ID: to.Ptr("/subscriptions/a0a37f63-7183-4e86-9ac7-ce8036a3ed31/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/iacProfiles/profilename"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:23.933Z"); return t}()),
// CreatedBy: to.Ptr(""),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T14:32:00.783Z"); return t}()),
// LastModifiedBy: to.Ptr("aks-dev-hub-devhub"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeApplication),
// },
// Location: to.Ptr(""),
// Tags: map[string]*string{
// },
// Properties: &armdevhub.IacProfileProperties{
// GithubProfile: &armdevhub.IacGitHubProfile{
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("aks-devhub-ybvmw"),
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PullNumber: to.Ptr[int32](8),
// RepositoryMainBranch: to.Ptr("main"),
// RepositoryName: to.Ptr("localtest"),
// RepositoryOwner: to.Ptr("owner"),
// },
// Stages: []*armdevhub.StageProperties{
// {
// Dependencies: []*string{
// },
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("dev"),
// },
// {
// Dependencies: []*string{
// to.Ptr("dev")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("qa"),
// },
// {
// Dependencies: []*string{
// to.Ptr("qa")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("prod"),
// }},
// Templates: []*armdevhub.IacTemplateProperties{
// {
// InstanceName: to.Ptr("contoso"),
// InstanceStage: to.Ptr("dev"),
// SourceResourceID: to.Ptr("/subscriptions/xxxx/resourceGroups/xxxx"),
// TemplateDetails: []*armdevhub.IacTemplateDetails{
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-hci"),
// ProductName: to.Ptr("HCI"),
// },
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-aks"),
// ProductName: to.Ptr("AKSarc"),
// }},
// TemplateName: to.Ptr("base"),
// }},
// TerraformProfile: &armdevhub.TerraformProfile{
// StorageAccountName: to.Ptr("hybridiac"),
// StorageAccountResourceGroup: to.Ptr("hybrid-iac"),
// StorageAccountSubscription: to.Ptr("subscription"),
// StorageContainerName: to.Ptr("hybridiac"),
// },
// },
// }},
// }
}
}
func (*IacProfilesClient) NewListPager ¶
func (client *IacProfilesClient) NewListPager(options *IacProfilesClientListOptions) *runtime.Pager[IacProfilesClientListResponse]
NewListPager - Gets a list of IacProfiles associated with the specified subscription.
Generated from API version 2024-05-01-preview
- options - IacProfilesClientListOptions contains the optional parameters for the IacProfilesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_List.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewIacProfilesClient().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.IacProfileListResult = armdevhub.IacProfileListResult{
// Value: []*armdevhub.IacProfile{
// {
// Name: to.Ptr("profilename"),
// Type: to.Ptr("Microsoft.DevHub/iacProfiles"),
// ID: to.Ptr("/subscriptions/a0a37f63-7183-4e86-9ac7-ce8036a3ed31/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/iacProfiles/profilename"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:23.933Z"); return t}()),
// CreatedBy: to.Ptr(""),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T14:32:00.783Z"); return t}()),
// LastModifiedBy: to.Ptr("aks-dev-hub-devhub"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeApplication),
// },
// Location: to.Ptr(""),
// Tags: map[string]*string{
// },
// Properties: &armdevhub.IacProfileProperties{
// GithubProfile: &armdevhub.IacGitHubProfile{
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("aks-devhub-ybvmw"),
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PullNumber: to.Ptr[int32](8),
// RepositoryMainBranch: to.Ptr("main"),
// RepositoryName: to.Ptr("localtest"),
// RepositoryOwner: to.Ptr("owner"),
// },
// Stages: []*armdevhub.StageProperties{
// {
// Dependencies: []*string{
// },
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("dev"),
// },
// {
// Dependencies: []*string{
// to.Ptr("dev")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("qa"),
// },
// {
// Dependencies: []*string{
// to.Ptr("qa")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("prod"),
// }},
// Templates: []*armdevhub.IacTemplateProperties{
// {
// InstanceName: to.Ptr("contoso"),
// InstanceStage: to.Ptr("dev"),
// SourceResourceID: to.Ptr("/subscriptions/xxxx/resourceGroups/xxxx"),
// TemplateDetails: []*armdevhub.IacTemplateDetails{
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-hci"),
// ProductName: to.Ptr("HCI"),
// },
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-aks"),
// ProductName: to.Ptr("AKSarc"),
// }},
// TemplateName: to.Ptr("base"),
// }},
// TerraformProfile: &armdevhub.TerraformProfile{
// StorageAccountName: to.Ptr("hybridiac"),
// StorageAccountResourceGroup: to.Ptr("hybrid-iac"),
// StorageAccountSubscription: to.Ptr("subscription"),
// StorageContainerName: to.Ptr("hybridiac"),
// },
// },
// }},
// }
}
}
func (*IacProfilesClient) Scale ¶
func (client *IacProfilesClient) Scale(ctx context.Context, resourceGroupName string, iacProfileName string, parameters ScaleTemplateRequest, options *IacProfilesClientScaleOptions) (IacProfilesClientScaleResponse, error)
Scale - Scale by template If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientScaleOptions contains the optional parameters for the IacProfilesClient.Scale method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_ScaleTemplate.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIacProfilesClient().Scale(ctx, "resourceGroup1", "iacprofile", armdevhub.ScaleTemplateRequest{
ScaleProperties: []*armdevhub.ScaleProperty{
{
NumberOfStores: to.Ptr[int32](1),
Region: to.Ptr("useast"),
Stage: to.Ptr("dev"),
}},
TemplateName: to.Ptr("hciaksss"),
}, 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.PrLinkResponse = armdevhub.PrLinkResponse{
// PrLink: to.Ptr("xxxx"),
// }
}
func (*IacProfilesClient) Sync ¶
func (client *IacProfilesClient) Sync(ctx context.Context, resourceGroupName string, iacProfileName string, options *IacProfilesClientSyncOptions) (IacProfilesClientSyncResponse, error)
Sync - Sync template If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- options - IacProfilesClientSyncOptions contains the optional parameters for the IacProfilesClient.Sync method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_SyncTemplate.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewIacProfilesClient().Sync(ctx, "resourceGroup1", "iacprofile", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}
func (*IacProfilesClient) UpdateTags ¶
func (client *IacProfilesClient) UpdateTags(ctx context.Context, resourceGroupName string, iacProfileName string, parameters TagsObject, options *IacProfilesClientUpdateTagsOptions) (IacProfilesClientUpdateTagsResponse, error)
UpdateTags - Updates tags on a IacProfile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- iacProfileName - The name of the IacProfile.
- parameters - Parameters supplied to the Update TagsObject Tags operation.
- options - IacProfilesClientUpdateTagsOptions contains the optional parameters for the IacProfilesClient.UpdateTags method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/IacProfile_UpdateTags.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewIacProfilesClient().UpdateTags(ctx, "resourceGroup1", "iacprofile", armdevhub.TagsObject{
Tags: map[string]*string{
"promote": to.Ptr("false"),
"resourceEnv": to.Ptr("testing"),
},
}, 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.IacProfile = armdevhub.IacProfile{
// Name: to.Ptr("iacprofile"),
// Type: to.Ptr("Micfosoft.DevHub/iacProfiles"),
// ID: to.Ptr("/subscriptions/a0a37f63-7183-4e86-9ac7-ce8036a3ed31/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/iacProfiles/iacprofile"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T09:56:23.933Z"); return t}()),
// CreatedBy: to.Ptr(""),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-16T14:35:15.206Z"); return t}()),
// LastModifiedBy: to.Ptr("aks-dev-hub-devhub"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeApplication),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// "promote": to.Ptr("false"),
// "resourceEnv": to.Ptr("testing"),
// },
// Properties: &armdevhub.IacProfileProperties{
// GithubProfile: &armdevhub.IacGitHubProfile{
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("aks-devhub-ybvmw"),
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PullNumber: to.Ptr[int32](8),
// RepositoryMainBranch: to.Ptr("main"),
// RepositoryName: to.Ptr("localtest"),
// RepositoryOwner: to.Ptr("owner"),
// },
// Stages: []*armdevhub.StageProperties{
// {
// Dependencies: []*string{
// },
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("dev"),
// },
// {
// Dependencies: []*string{
// to.Ptr("dev")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("qa"),
// },
// {
// Dependencies: []*string{
// to.Ptr("qa")},
// GitEnvironment: to.Ptr("Terraform"),
// StageName: to.Ptr("prod"),
// }},
// Templates: []*armdevhub.IacTemplateProperties{
// {
// TemplateDetails: []*armdevhub.IacTemplateDetails{
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-hci"),
// ProductName: to.Ptr("HCI"),
// },
// {
// Count: to.Ptr[int32](1),
// NamingConvention: to.Ptr("$sitid-aks"),
// ProductName: to.Ptr("AKSarc"),
// }},
// TemplateName: to.Ptr("base"),
// }},
// TerraformProfile: &armdevhub.TerraformProfile{
// StorageAccountName: to.Ptr("hybridiac"),
// StorageAccountResourceGroup: to.Ptr("hybrid-iac"),
// StorageAccountSubscription: to.Ptr("subscriptions"),
// StorageContainerName: to.Ptr("hybridiac"),
// },
// },
// }
}
type IacProfilesClientCreateOrUpdateOptions ¶
type IacProfilesClientCreateOrUpdateOptions struct {
}
IacProfilesClientCreateOrUpdateOptions contains the optional parameters for the IacProfilesClient.CreateOrUpdate method.
type IacProfilesClientCreateOrUpdateResponse ¶
type IacProfilesClientCreateOrUpdateResponse struct {
// Resource representation of a IacProfile.
IacProfile
}
IacProfilesClientCreateOrUpdateResponse contains the response from method IacProfilesClient.CreateOrUpdate.
type IacProfilesClientDeleteOptions ¶
type IacProfilesClientDeleteOptions struct {
}
IacProfilesClientDeleteOptions contains the optional parameters for the IacProfilesClient.Delete method.
type IacProfilesClientDeleteResponse ¶
type IacProfilesClientDeleteResponse struct {
}
IacProfilesClientDeleteResponse contains the response from method IacProfilesClient.Delete.
type IacProfilesClientExportOptions ¶
type IacProfilesClientExportOptions struct {
}
IacProfilesClientExportOptions contains the optional parameters for the IacProfilesClient.Export method.
type IacProfilesClientExportResponse ¶
type IacProfilesClientExportResponse struct {
PrLinkResponse
}
IacProfilesClientExportResponse contains the response from method IacProfilesClient.Export.
type IacProfilesClientGetOptions ¶
type IacProfilesClientGetOptions struct {
}
IacProfilesClientGetOptions contains the optional parameters for the IacProfilesClient.Get method.
type IacProfilesClientGetResponse ¶
type IacProfilesClientGetResponse struct {
// Resource representation of a IacProfile.
IacProfile
}
IacProfilesClientGetResponse contains the response from method IacProfilesClient.Get.
type IacProfilesClientListByResourceGroupOptions ¶
type IacProfilesClientListByResourceGroupOptions struct {
}
IacProfilesClientListByResourceGroupOptions contains the optional parameters for the IacProfilesClient.NewListByResourceGroupPager method.
type IacProfilesClientListByResourceGroupResponse ¶
type IacProfilesClientListByResourceGroupResponse struct {
IacProfileListResult
}
IacProfilesClientListByResourceGroupResponse contains the response from method IacProfilesClient.NewListByResourceGroupPager.
type IacProfilesClientListOptions ¶
type IacProfilesClientListOptions struct {
}
IacProfilesClientListOptions contains the optional parameters for the IacProfilesClient.NewListPager method.
type IacProfilesClientListResponse ¶
type IacProfilesClientListResponse struct {
IacProfileListResult
}
IacProfilesClientListResponse contains the response from method IacProfilesClient.NewListPager.
type IacProfilesClientScaleOptions ¶
type IacProfilesClientScaleOptions struct {
}
IacProfilesClientScaleOptions contains the optional parameters for the IacProfilesClient.Scale method.
type IacProfilesClientScaleResponse ¶
type IacProfilesClientScaleResponse struct {
PrLinkResponse
}
IacProfilesClientScaleResponse contains the response from method IacProfilesClient.Scale.
type IacProfilesClientSyncOptions ¶
type IacProfilesClientSyncOptions struct {
}
IacProfilesClientSyncOptions contains the optional parameters for the IacProfilesClient.Sync method.
type IacProfilesClientSyncResponse ¶
type IacProfilesClientSyncResponse struct {
}
IacProfilesClientSyncResponse contains the response from method IacProfilesClient.Sync.
type IacProfilesClientUpdateTagsOptions ¶
type IacProfilesClientUpdateTagsOptions struct {
}
IacProfilesClientUpdateTagsOptions contains the optional parameters for the IacProfilesClient.UpdateTags method.
type IacProfilesClientUpdateTagsResponse ¶
type IacProfilesClientUpdateTagsResponse struct {
// Resource representation of a IacProfile.
IacProfile
}
IacProfilesClientUpdateTagsResponse contains the response from method IacProfilesClient.UpdateTags.
type IacTemplateDetails ¶
type IacTemplateDetails struct {
// Count of the product
Count *int32
// Naming convention of this product
NamingConvention *string
// The name of the products.
ProductName *string
}
func (IacTemplateDetails) MarshalJSON ¶
func (i IacTemplateDetails) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacTemplateDetails.
func (*IacTemplateDetails) UnmarshalJSON ¶
func (i *IacTemplateDetails) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacTemplateDetails.
type IacTemplateProperties ¶
type IacTemplateProperties struct {
// the sample instance name of the template
InstanceName *string
// the source stage of the template
InstanceStage *string
// Determines the authorization status of requests.
QuickStartTemplateType *QuickStartTemplateType
// the source store of the template
SourceResourceID *string
TemplateDetails []*IacTemplateDetails
// Template Name
TemplateName *string
}
IacTemplateProperties - Properties of a IacTemplate.
func (IacTemplateProperties) MarshalJSON ¶
func (i IacTemplateProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type IacTemplateProperties.
func (*IacTemplateProperties) UnmarshalJSON ¶
func (i *IacTemplateProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type IacTemplateProperties.
type ManifestGenerationMode ¶
type ManifestGenerationMode string
ManifestGenerationMode - The mode of generation to be used for generating Manifest.
const ( // ManifestGenerationModeDisabled - Manifests will not be generated ManifestGenerationModeDisabled ManifestGenerationMode = "disabled" // ManifestGenerationModeEnabled - Manifests will be generated ManifestGenerationModeEnabled ManifestGenerationMode = "enabled" )
func PossibleManifestGenerationModeValues ¶
func PossibleManifestGenerationModeValues() []ManifestGenerationMode
PossibleManifestGenerationModeValues returns the possible values for the ManifestGenerationMode const type.
type ManifestType ¶
type ManifestType string
ManifestType - Determines the type of manifests within the repository.
const ( // ManifestTypeHelm - Repositories using helm ManifestTypeHelm ManifestType = "helm" // ManifestTypeKube - Repositories using kubernetes manifests ManifestTypeKube ManifestType = "kube" )
func PossibleManifestTypeValues ¶
func PossibleManifestTypeValues() []ManifestType
PossibleManifestTypeValues returns the possible values for the ManifestType const type.
type Operation ¶
type Operation struct {
// Localized display information for this particular operation.
Display *OperationDisplay
// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
ActionType *ActionType
// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
// operations.
IsDataAction *bool
// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
// "Microsoft.Compute/virtualMachines/capture/action"
Name *string
// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
// value is "user,system"
Origin *Origin
}
Operation - Details of a REST API operation, returned from the Resource Provider Operations API
func (Operation) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct {
// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
Description *string
// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
// Machine", "Restart Virtual Machine".
Operation *string
// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
// Compute".
Provider *string
// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
// Schedule Collections".
Resource *string
}
OperationDisplay - Localized display information for this particular operation.
func (OperationDisplay) MarshalJSON ¶
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationListResult ¶
type OperationListResult struct {
// READ-ONLY; URL to get the next set of operation list results (if there are any).
NextLink *string
// READ-ONLY; List of operations supported by the resource provider
Value []*Operation
}
OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
func (OperationListResult) MarshalJSON ¶
func (o OperationListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationListResult.
func (*OperationListResult) UnmarshalJSON ¶
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) List ¶
func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error)
List - Returns list of operations. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Operation_List.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOperationsClient().List(ctx, 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.OperationListResult = armdevhub.OperationListResult{
// Value: []*armdevhub.Operation{
// {
// Name: to.Ptr("Microsoft.DevHub/workflows/read"),
// Display: &armdevhub.OperationDisplay{
// Description: to.Ptr("Gets workflow"),
// Operation: to.Ptr("Get workflow"),
// Provider: to.Ptr("Microsoft Developer Hub"),
// Resource: to.Ptr("Workflows"),
// },
// }},
// }
}
type OperationsClientListOptions ¶
type OperationsClientListOptions struct {
}
OperationsClientListOptions contains the optional parameters for the OperationsClient.List method.
type OperationsClientListResponse ¶
type OperationsClientListResponse struct {
// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
OperationListResult
}
OperationsClientListResponse contains the response from method OperationsClient.List.
type Origin ¶
type Origin string
Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
func PossibleOriginValues ¶
func PossibleOriginValues() []Origin
PossibleOriginValues returns the possible values for the Origin const type.
type PrLinkResponse ¶
type PrLinkResponse struct {
// The link of the pull request.
PrLink *string
}
func (PrLinkResponse) MarshalJSON ¶
func (p PrLinkResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PrLinkResponse.
func (*PrLinkResponse) UnmarshalJSON ¶
func (p *PrLinkResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PrLinkResponse.
type PullRequestStatus ¶
type PullRequestStatus string
PullRequestStatus - The status of the Pull Request submitted against the users repository.
const ( // PullRequestStatusMerged - Pull Request merged into repository. PullRequestStatusMerged PullRequestStatus = "merged" // PullRequestStatusRemoved - Workflow no longer found within repository. PullRequestStatusRemoved PullRequestStatus = "removed" // PullRequestStatusSubmitted - Pull Request submitted to repository. PullRequestStatusSubmitted PullRequestStatus = "submitted" // PullRequestStatusUnknown - Pull Request state unknown. PullRequestStatusUnknown PullRequestStatus = "unknown" )
func PossiblePullRequestStatusValues ¶
func PossiblePullRequestStatusValues() []PullRequestStatus
PossiblePullRequestStatusValues returns the possible values for the PullRequestStatus const type.
type QuickStartTemplateType ¶
type QuickStartTemplateType string
QuickStartTemplateType - Determines the authorization status of requests.
const ( // QuickStartTemplateTypeALL - The template use quick start template of All supported products QuickStartTemplateTypeALL QuickStartTemplateType = "ALL" // QuickStartTemplateTypeHCI - The template use quick start template of HCI QuickStartTemplateTypeHCI QuickStartTemplateType = "HCI" // QuickStartTemplateTypeHCIAKS - The template use quick start template of HCI and AKS QuickStartTemplateTypeHCIAKS QuickStartTemplateType = "HCIAKS" // QuickStartTemplateTypeHCIARCVM - The template use quick start template of HCI and ArcVM QuickStartTemplateTypeHCIARCVM QuickStartTemplateType = "HCIARCVM" // QuickStartTemplateTypeNone - The template has not use quick start template QuickStartTemplateTypeNone QuickStartTemplateType = "None" )
func PossibleQuickStartTemplateTypeValues ¶
func PossibleQuickStartTemplateTypeValues() []QuickStartTemplateType
PossibleQuickStartTemplateTypeValues returns the possible values for the QuickStartTemplateType const type.
type ScaleProperty ¶
type ScaleProperty struct {
// Number of the store
NumberOfStores *int32
// The region of the store
Region *string
// The stage of the store
Stage *string
}
func (ScaleProperty) MarshalJSON ¶
func (s ScaleProperty) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleProperty.
func (*ScaleProperty) UnmarshalJSON ¶
func (s *ScaleProperty) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleProperty.
type ScaleTemplateRequest ¶
type ScaleTemplateRequest struct {
ScaleProperties []*ScaleProperty
// Template Name
TemplateName *string
}
func (ScaleTemplateRequest) MarshalJSON ¶
func (s ScaleTemplateRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ScaleTemplateRequest.
func (*ScaleTemplateRequest) UnmarshalJSON ¶
func (s *ScaleTemplateRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ScaleTemplateRequest.
type StageProperties ¶
type StageProperties struct {
Dependencies []*string
GitEnvironment *string
// Stage Name
StageName *string
}
StageProperties - Properties of a Stage.
func (StageProperties) MarshalJSON ¶
func (s StageProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type StageProperties.
func (*StageProperties) UnmarshalJSON ¶
func (s *StageProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type StageProperties.
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 last modification (UTC)
LastModifiedAt *time.Time
// The identity that last modified the resource.
LastModifiedBy *string
// The type of identity that last modified the resource.
LastModifiedByType *CreatedByType
}
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 TagsObject ¶
TagsObject - Resource tags.
func (TagsObject) MarshalJSON ¶
func (t TagsObject) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TagsObject.
func (*TagsObject) UnmarshalJSON ¶
func (t *TagsObject) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TagsObject.
type TerraformProfile ¶
type TerraformProfile struct {
// Terraform Storage Account Name
StorageAccountName *string
// Terraform Storage Account Resource Group
StorageAccountResourceGroup *string
// Terraform Storage Account Subscription
StorageAccountSubscription *string
// Terraform Container Name
StorageContainerName *string
}
TerraformProfile - Terraform backend profile.
func (TerraformProfile) MarshalJSON ¶
func (t TerraformProfile) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TerraformProfile.
func (*TerraformProfile) UnmarshalJSON ¶
func (t *TerraformProfile) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TerraformProfile.
type Workflow ¶
type Workflow struct {
// REQUIRED; The geo-location where the resource lives
Location *string
// Properties of a workflow.
Properties *WorkflowProperties
// Resource tags.
Tags map[string]*string
// READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
ID *string
// READ-ONLY; The name of the resource
Name *string
// READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information.
SystemData *SystemData
// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type *string
}
Workflow - Resource representation of a workflow
func (Workflow) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Workflow.
func (*Workflow) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Workflow.
type WorkflowClient ¶
type WorkflowClient struct {
// contains filtered or unexported fields
}
WorkflowClient contains the methods for the Workflow group. Don't use this type directly, use NewWorkflowClient() instead.
func NewWorkflowClient ¶
func NewWorkflowClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkflowClient, error)
NewWorkflowClient creates a new instance of WorkflowClient 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 (*WorkflowClient) CreateOrUpdate ¶
func (client *WorkflowClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workflowName string, parameters Workflow, options *WorkflowClientCreateOrUpdateOptions) (WorkflowClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates or updates a workflow If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- workflowName - The name of the workflow resource.
- options - WorkflowClientCreateOrUpdateOptions contains the optional parameters for the WorkflowClient.CreateOrUpdate method.
Example (CreateWorkflow) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_CreateOrUpdate.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkflowClient().CreateOrUpdate(ctx, "resourceGroup1", "workflow1", armdevhub.Workflow{
Location: to.Ptr("location1"),
Tags: map[string]*string{
"appname": to.Ptr("testApp"),
},
Properties: &armdevhub.WorkflowProperties{
GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
Acr: &armdevhub.ACR{
AcrRegistryName: to.Ptr("registry1"),
AcrRepositoryName: to.Ptr("repo1"),
AcrResourceGroup: to.Ptr("resourceGroup1"),
AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
},
AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
BranchName: to.Ptr("branch1"),
DeploymentProperties: &armdevhub.DeploymentProperties{
KubeManifestLocations: []*string{
to.Ptr("/src/manifests/")},
ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
Overrides: map[string]*string{
"key1": to.Ptr("value1"),
},
},
DockerBuildContext: to.Ptr("repo1/src/"),
Dockerfile: to.Ptr("repo1/images/Dockerfile"),
Namespace: to.Ptr("namespace1"),
OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
},
RepositoryName: to.Ptr("repo1"),
RepositoryOwner: to.Ptr("owner1"),
},
},
}, 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.Workflow = armdevhub.Workflow{
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch2"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// HelmChartPath: to.Ptr("/src/charts"),
// HelmValues: to.Ptr("/src/chars/values.yaml"),
// ManifestType: to.Ptr(armdevhub.ManifestTypeHelm),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo2/src/"),
// Dockerfile: to.Ptr("repo2/images/Dockerfile"),
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PrURL: to.Ptr("https://github.com/User/repo2/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo2"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }
}
Example (CreateWorkflowWithArtifactGeneration) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_CreateOrUpdate_WithArtifactGen.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkflowClient().CreateOrUpdate(ctx, "resourceGroup1", "workflow1", armdevhub.Workflow{
Location: to.Ptr("location1"),
Tags: map[string]*string{
"appname": to.Ptr("testApp"),
},
Properties: &armdevhub.WorkflowProperties{
ArtifactGenerationProperties: &armdevhub.ArtifactGenerationProperties{
AppName: to.Ptr("my-app"),
DockerfileGenerationMode: to.Ptr(armdevhub.DockerfileGenerationModeEnabled),
DockerfileOutputDirectory: to.Ptr("./"),
GenerationLanguage: to.Ptr(armdevhub.GenerationLanguageJavascript),
ImageName: to.Ptr("myimage"),
ImageTag: to.Ptr("latest"),
LanguageVersion: to.Ptr("14"),
ManifestGenerationMode: to.Ptr(armdevhub.ManifestGenerationModeEnabled),
ManifestOutputDirectory: to.Ptr("./"),
ManifestType: to.Ptr(armdevhub.GenerationManifestTypeKube),
Namespace: to.Ptr("my-namespace"),
Port: to.Ptr("80"),
},
GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
Acr: &armdevhub.ACR{
AcrRegistryName: to.Ptr("registry1"),
AcrRepositoryName: to.Ptr("repo1"),
AcrResourceGroup: to.Ptr("resourceGroup1"),
AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
},
AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
BranchName: to.Ptr("branch1"),
DeploymentProperties: &armdevhub.DeploymentProperties{
KubeManifestLocations: []*string{
to.Ptr("/src/manifests/")},
ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
Overrides: map[string]*string{
"key1": to.Ptr("value1"),
},
},
DockerBuildContext: to.Ptr("repo1/src/"),
Dockerfile: to.Ptr("repo1/images/Dockerfile"),
OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
},
RepositoryName: to.Ptr("repo1"),
RepositoryOwner: to.Ptr("owner1"),
},
},
}, 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.Workflow = armdevhub.Workflow{
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch2"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// HelmChartPath: to.Ptr("/src/charts"),
// HelmValues: to.Ptr("/src/chars/values.yaml"),
// ManifestType: to.Ptr(armdevhub.ManifestTypeHelm),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo2/src/"),
// Dockerfile: to.Ptr("repo2/images/Dockerfile"),
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PrURL: to.Ptr("https://github.com/User/repo2/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo2"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }
}
func (*WorkflowClient) Delete ¶
func (client *WorkflowClient) Delete(ctx context.Context, resourceGroupName string, workflowName string, options *WorkflowClientDeleteOptions) (WorkflowClientDeleteResponse, error)
Delete - Deletes a workflow If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- workflowName - The name of the workflow resource.
- options - WorkflowClientDeleteOptions contains the optional parameters for the WorkflowClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_Delete.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkflowClient().Delete(ctx, "resourceGroup1", "workflow1", 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.DeleteWorkflowResponse = armdevhub.DeleteWorkflowResponse{
// Status: to.Ptr("workflow deleted successfully"),
// }
}
func (*WorkflowClient) Get ¶
func (client *WorkflowClient) Get(ctx context.Context, resourceGroupName string, workflowName string, options *WorkflowClientGetOptions) (WorkflowClientGetResponse, error)
Get - Gets a workflow. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- workflowName - The name of the workflow resource.
- options - WorkflowClientGetOptions contains the optional parameters for the WorkflowClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_Get.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkflowClient().Get(ctx, "resourceGroup1", "workflow1", 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.Workflow = armdevhub.Workflow{
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch1"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo1/src/"),
// Dockerfile: to.Ptr("repo1/images/Dockerfile"),
// LastWorkflowRun: &armdevhub.WorkflowRun{
// LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
// Succeeded: to.Ptr(true),
// WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
// WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
// },
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
// PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo1"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }
}
func (*WorkflowClient) NewListByResourceGroupPager ¶
func (client *WorkflowClient) NewListByResourceGroupPager(resourceGroupName string, options *WorkflowClientListByResourceGroupOptions) *runtime.Pager[WorkflowClientListByResourceGroupResponse]
NewListByResourceGroupPager - Gets a list of workflows within a resource group.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - WorkflowClientListByResourceGroupOptions contains the optional parameters for the WorkflowClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_ListByResourceGroup.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewWorkflowClient().NewListByResourceGroupPager("resourceGroup1", &armdevhub.WorkflowClientListByResourceGroupOptions{ManagedClusterResource: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1")})
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.WorkflowListResult = armdevhub.WorkflowListResult{
// Value: []*armdevhub.Workflow{
// {
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch1"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo1/src/"),
// Dockerfile: to.Ptr("repo1/images/Dockerfile"),
// LastWorkflowRun: &armdevhub.WorkflowRun{
// LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
// Succeeded: to.Ptr(true),
// WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
// WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
// },
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
// PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo1"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }},
// }
}
}
func (*WorkflowClient) NewListPager ¶
func (client *WorkflowClient) NewListPager(options *WorkflowClientListOptions) *runtime.Pager[WorkflowClientListResponse]
NewListPager - Gets a list of workflows associated with the specified subscription.
Generated from API version 2024-05-01-preview
- options - WorkflowClientListOptions contains the optional parameters for the WorkflowClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_List.json
package main
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewWorkflowClient().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.WorkflowListResult = armdevhub.WorkflowListResult{
// Value: []*armdevhub.Workflow{
// {
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "appname": to.Ptr("testapp"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch1"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo1/src/"),
// Dockerfile: to.Ptr("repo1/images/Dockerfile"),
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusSubmitted),
// PrURL: to.Ptr("https://github.com/User/repo1/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo1"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }},
// }
}
}
func (*WorkflowClient) UpdateTags ¶
func (client *WorkflowClient) UpdateTags(ctx context.Context, resourceGroupName string, workflowName string, parameters TagsObject, options *WorkflowClientUpdateTagsOptions) (WorkflowClientUpdateTagsResponse, error)
UpdateTags - Updates tags on a workflow. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-05-01-preview
- resourceGroupName - The name of the resource group. The name is case insensitive.
- workflowName - The name of the workflow resource.
- parameters - Parameters supplied to the Update Workflow Tags operation.
- options - WorkflowClientUpdateTagsOptions contains the optional parameters for the WorkflowClient.UpdateTags method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/34f5146bc945549d087d38a8a593c0a5f475ad7f/specification/developerhub/resource-manager/Microsoft.DevHub/preview/2024-05-01-preview/examples/Workflow_UpdateTags.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/devhub/armdevhub"
)
func main() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdevhub.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWorkflowClient().UpdateTags(ctx, "resourceGroup1", "workflow1", armdevhub.TagsObject{
Tags: map[string]*string{
"promote": to.Ptr("false"),
"resourceEnv": to.Ptr("testing"),
},
}, 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.Workflow = armdevhub.Workflow{
// Name: to.Ptr("workflow1"),
// Type: to.Ptr("Micfosoft.DevHub/Workflow"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.DevHub/workflow/workflow1"),
// SystemData: &armdevhub.SystemData{
// CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// CreatedBy: to.Ptr("foo@contoso.com"),
// CreatedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-24T16:30:55.000Z"); return t}()),
// LastModifiedBy: to.Ptr("foo@contoso.com"),
// LastModifiedByType: to.Ptr(armdevhub.CreatedByTypeUser),
// },
// Location: to.Ptr("location1"),
// Tags: map[string]*string{
// "previousValue": to.Ptr("stillExists"),
// "promote": to.Ptr("false"),
// "resourceEnv": to.Ptr("testing"),
// },
// Properties: &armdevhub.WorkflowProperties{
// GithubWorkflowProfile: &armdevhub.GitHubWorkflowProfile{
// Acr: &armdevhub.ACR{
// AcrRegistryName: to.Ptr("registry1"),
// AcrRepositoryName: to.Ptr("repo1"),
// AcrResourceGroup: to.Ptr("resourceGroup1"),
// AcrSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// },
// AksResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resourceGroup1/providers/Microsoft.ContainerService/managedClusters/cluster1"),
// AuthStatus: to.Ptr(armdevhub.AuthorizationStatusAuthorized),
// BranchName: to.Ptr("branch1"),
// DeploymentProperties: &armdevhub.DeploymentProperties{
// ManifestType: to.Ptr(armdevhub.ManifestTypeKube),
// Overrides: map[string]*string{
// "key1": to.Ptr("value1"),
// },
// },
// DockerBuildContext: to.Ptr("repo1/src/"),
// Dockerfile: to.Ptr("repo1/images/Dockerfile"),
// LastWorkflowRun: &armdevhub.WorkflowRun{
// LastRunAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T12:34:56.000Z"); return t}()),
// Succeeded: to.Ptr(true),
// WorkflowRunStatus: to.Ptr(armdevhub.WorkflowRunStatusCompleted),
// WorkflowRunURL: to.Ptr("https://github.com/User/repo1/actions/runs/1820640230"),
// },
// OidcCredentials: &armdevhub.GitHubWorkflowProfileOidcCredentials{
// AzureClientID: to.Ptr("12345678-3456-7890-5678-012345678901"),
// AzureTenantID: to.Ptr("66666666-3456-7890-5678-012345678901"),
// },
// PrStatus: to.Ptr(armdevhub.PullRequestStatusMerged),
// PrURL: to.Ptr("https://github.com/owner1/repo1/pull/6567"),
// PullNumber: to.Ptr[int32](6567),
// RepositoryName: to.Ptr("repo1"),
// RepositoryOwner: to.Ptr("owner1"),
// },
// },
// }
}
type WorkflowClientCreateOrUpdateOptions ¶
type WorkflowClientCreateOrUpdateOptions struct {
}
WorkflowClientCreateOrUpdateOptions contains the optional parameters for the WorkflowClient.CreateOrUpdate method.
type WorkflowClientCreateOrUpdateResponse ¶
type WorkflowClientCreateOrUpdateResponse struct {
// Resource representation of a workflow
Workflow
}
WorkflowClientCreateOrUpdateResponse contains the response from method WorkflowClient.CreateOrUpdate.
type WorkflowClientDeleteOptions ¶
type WorkflowClientDeleteOptions struct {
}
WorkflowClientDeleteOptions contains the optional parameters for the WorkflowClient.Delete method.
type WorkflowClientDeleteResponse ¶
type WorkflowClientDeleteResponse struct {
// delete response if content must be provided on delete operation
DeleteWorkflowResponse
}
WorkflowClientDeleteResponse contains the response from method WorkflowClient.Delete.
type WorkflowClientGetOptions ¶
type WorkflowClientGetOptions struct {
}
WorkflowClientGetOptions contains the optional parameters for the WorkflowClient.Get method.
type WorkflowClientGetResponse ¶
type WorkflowClientGetResponse struct {
// Resource representation of a workflow
Workflow
}
WorkflowClientGetResponse contains the response from method WorkflowClient.Get.
type WorkflowClientListByResourceGroupOptions ¶
type WorkflowClientListByResourceGroupOptions struct {
// The ManagedCluster resource associated with the workflows.
ManagedClusterResource *string
}
WorkflowClientListByResourceGroupOptions contains the optional parameters for the WorkflowClient.NewListByResourceGroupPager method.
type WorkflowClientListByResourceGroupResponse ¶
type WorkflowClientListByResourceGroupResponse struct {
// The response from List Workflows operation.
WorkflowListResult
}
WorkflowClientListByResourceGroupResponse contains the response from method WorkflowClient.NewListByResourceGroupPager.
type WorkflowClientListOptions ¶
type WorkflowClientListOptions struct {
}
WorkflowClientListOptions contains the optional parameters for the WorkflowClient.NewListPager method.
type WorkflowClientListResponse ¶
type WorkflowClientListResponse struct {
// The response from List Workflows operation.
WorkflowListResult
}
WorkflowClientListResponse contains the response from method WorkflowClient.NewListPager.
type WorkflowClientUpdateTagsOptions ¶
type WorkflowClientUpdateTagsOptions struct {
}
WorkflowClientUpdateTagsOptions contains the optional parameters for the WorkflowClient.UpdateTags method.
type WorkflowClientUpdateTagsResponse ¶
type WorkflowClientUpdateTagsResponse struct {
// Resource representation of a workflow
Workflow
}
WorkflowClientUpdateTagsResponse contains the response from method WorkflowClient.UpdateTags.
type WorkflowListResult ¶
type WorkflowListResult struct {
// The list of workflows.
Value []*Workflow
// READ-ONLY; The URL to the next set of workflow results.
NextLink *string
}
WorkflowListResult - The response from List Workflows operation.
func (WorkflowListResult) MarshalJSON ¶
func (w WorkflowListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkflowListResult.
func (*WorkflowListResult) UnmarshalJSON ¶
func (w *WorkflowListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowListResult.
type WorkflowProperties ¶
type WorkflowProperties struct {
// Properties for generating artifacts like dockerfile and manifests.
ArtifactGenerationProperties *ArtifactGenerationProperties
// Profile of a github workflow.
GithubWorkflowProfile *GitHubWorkflowProfile
}
WorkflowProperties - Workflow properties
func (WorkflowProperties) MarshalJSON ¶
func (w WorkflowProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkflowProperties.
func (*WorkflowProperties) UnmarshalJSON ¶
func (w *WorkflowProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowProperties.
type WorkflowRun ¶
type WorkflowRun struct {
// Describes the status of the workflow run
WorkflowRunStatus *WorkflowRunStatus
// READ-ONLY; The timestamp of the last workflow run.
LastRunAt *time.Time
// READ-ONLY; Describes if the workflow run succeeded.
Succeeded *bool
// READ-ONLY; URL to the run of the workflow.
WorkflowRunURL *string
}
func (WorkflowRun) MarshalJSON ¶
func (w WorkflowRun) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkflowRun.
func (*WorkflowRun) UnmarshalJSON ¶
func (w *WorkflowRun) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowRun.
type WorkflowRunStatus ¶
type WorkflowRunStatus string
WorkflowRunStatus - Describes the status of the workflow run
const ( // WorkflowRunStatusCompleted - Workflow run is completed WorkflowRunStatusCompleted WorkflowRunStatus = "completed" // WorkflowRunStatusInprogress - Workflow run is inprogress WorkflowRunStatusInprogress WorkflowRunStatus = "inprogress" // WorkflowRunStatusQueued - Workflow run is queued WorkflowRunStatusQueued WorkflowRunStatus = "queued" )
func PossibleWorkflowRunStatusValues ¶
func PossibleWorkflowRunStatusValues() []WorkflowRunStatus
PossibleWorkflowRunStatusValues returns the possible values for the WorkflowRunStatus const type.