Documentation
¶
Index ¶
- type API
- type APIDefinition
- type APIDefinitionListResult
- type APIDefinitionProperties
- type APIDefinitionPropertiesSpecification
- type APIDefinitionsClient
- func (client *APIDefinitionsClient) BeginExportSpecification(ctx context.Context, resourceGroupName string, serviceName string, ...) (*runtime.Poller[APIDefinitionsClientExportSpecificationResponse], error)
- func (client *APIDefinitionsClient) BeginImportSpecification(ctx context.Context, resourceGroupName string, serviceName string, ...) (*runtime.Poller[APIDefinitionsClientImportSpecificationResponse], error)
- func (client *APIDefinitionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIDefinitionsClientCreateOrUpdateResponse, error)
- func (client *APIDefinitionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIDefinitionsClientDeleteResponse, error)
- func (client *APIDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIDefinitionsClientGetResponse, error)
- func (client *APIDefinitionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIDefinitionsClientHeadResponse, error)
- func (client *APIDefinitionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, ...) *runtime.Pager[APIDefinitionsClientListResponse]
- type APIDefinitionsClientBeginExportSpecificationOptions
- type APIDefinitionsClientBeginImportSpecificationOptions
- type APIDefinitionsClientCreateOrUpdateOptions
- type APIDefinitionsClientCreateOrUpdateResponse
- type APIDefinitionsClientDeleteOptions
- type APIDefinitionsClientDeleteResponse
- type APIDefinitionsClientExportSpecificationResponse
- type APIDefinitionsClientGetOptions
- type APIDefinitionsClientGetResponse
- type APIDefinitionsClientHeadOptions
- type APIDefinitionsClientHeadResponse
- type APIDefinitionsClientImportSpecificationResponse
- type APIDefinitionsClientListOptions
- type APIDefinitionsClientListResponse
- type APIKind
- type APIListResult
- type APIProperties
- type APISpecExportResult
- type APISpecExportResultFormat
- type APISpecImportRequest
- type APISpecImportRequestSpecification
- type APISpecImportSourceFormat
- type APIVersion
- type APIVersionListResult
- type APIVersionProperties
- type APIVersionsClient
- func (client *APIVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIVersionsClientCreateOrUpdateResponse, error)
- func (client *APIVersionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIVersionsClientDeleteResponse, error)
- func (client *APIVersionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIVersionsClientGetResponse, error)
- func (client *APIVersionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (APIVersionsClientHeadResponse, error)
- func (client *APIVersionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, ...) *runtime.Pager[APIVersionsClientListResponse]
- type APIVersionsClientCreateOrUpdateOptions
- type APIVersionsClientCreateOrUpdateResponse
- type APIVersionsClientDeleteOptions
- type APIVersionsClientDeleteResponse
- type APIVersionsClientGetOptions
- type APIVersionsClientGetResponse
- type APIVersionsClientHeadOptions
- type APIVersionsClientHeadResponse
- type APIVersionsClientListOptions
- type APIVersionsClientListResponse
- type ActionType
- type ApisClient
- func (client *ApisClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (ApisClientCreateOrUpdateResponse, error)
- func (client *ApisClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (ApisClientDeleteResponse, error)
- func (client *ApisClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (ApisClientGetResponse, error)
- func (client *ApisClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (ApisClientHeadResponse, error)
- func (client *ApisClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, ...) *runtime.Pager[ApisClientListResponse]
- type ApisClientCreateOrUpdateOptions
- type ApisClientCreateOrUpdateResponse
- type ApisClientDeleteOptions
- type ApisClientDeleteResponse
- type ApisClientGetOptions
- type ApisClientGetResponse
- type ApisClientHeadOptions
- type ApisClientHeadResponse
- type ApisClientListOptions
- type ApisClientListResponse
- type ClientFactory
- func (c *ClientFactory) NewAPIDefinitionsClient() *APIDefinitionsClient
- func (c *ClientFactory) NewAPIVersionsClient() *APIVersionsClient
- func (c *ClientFactory) NewApisClient() *ApisClient
- func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient
- func (c *ClientFactory) NewEnvironmentsClient() *EnvironmentsClient
- func (c *ClientFactory) NewMetadataSchemasClient() *MetadataSchemasClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewServicesClient() *ServicesClient
- func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient
- type Contact
- type CreatedByType
- type Deployment
- type DeploymentListResult
- type DeploymentProperties
- type DeploymentServer
- type DeploymentState
- type DeploymentsClient
- func (client *DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (DeploymentsClientCreateOrUpdateResponse, error)
- func (client *DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (DeploymentsClientDeleteResponse, error)
- func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (DeploymentsClientGetResponse, error)
- func (client *DeploymentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (DeploymentsClientHeadResponse, error)
- func (client *DeploymentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, ...) *runtime.Pager[DeploymentsClientListResponse]
- type DeploymentsClientCreateOrUpdateOptions
- type DeploymentsClientCreateOrUpdateResponse
- type DeploymentsClientDeleteOptions
- type DeploymentsClientDeleteResponse
- type DeploymentsClientGetOptions
- type DeploymentsClientGetResponse
- type DeploymentsClientHeadOptions
- type DeploymentsClientHeadResponse
- type DeploymentsClientListOptions
- type DeploymentsClientListResponse
- type Environment
- type EnvironmentKind
- type EnvironmentListResult
- type EnvironmentProperties
- type EnvironmentServer
- type EnvironmentServerType
- type EnvironmentsClient
- func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (EnvironmentsClientCreateOrUpdateResponse, error)
- func (client *EnvironmentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (EnvironmentsClientDeleteResponse, error)
- func (client *EnvironmentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (EnvironmentsClientGetResponse, error)
- func (client *EnvironmentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (EnvironmentsClientHeadResponse, error)
- func (client *EnvironmentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, ...) *runtime.Pager[EnvironmentsClientListResponse]
- type EnvironmentsClientCreateOrUpdateOptions
- type EnvironmentsClientCreateOrUpdateResponse
- type EnvironmentsClientDeleteOptions
- type EnvironmentsClientDeleteResponse
- type EnvironmentsClientGetOptions
- type EnvironmentsClientGetResponse
- type EnvironmentsClientHeadOptions
- type EnvironmentsClientHeadResponse
- type EnvironmentsClientListOptions
- type EnvironmentsClientListResponse
- type ExternalDocumentation
- type License
- type LifecycleStage
- type ManagedServiceIdentity
- type ManagedServiceIdentityType
- type MetadataAssignment
- type MetadataAssignmentEntity
- type MetadataSchema
- type MetadataSchemaExportFormat
- type MetadataSchemaExportRequest
- type MetadataSchemaExportResult
- type MetadataSchemaListResult
- type MetadataSchemaProperties
- type MetadataSchemasClient
- func (client *MetadataSchemasClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (MetadataSchemasClientCreateOrUpdateResponse, error)
- func (client *MetadataSchemasClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (MetadataSchemasClientDeleteResponse, error)
- func (client *MetadataSchemasClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (MetadataSchemasClientGetResponse, error)
- func (client *MetadataSchemasClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (MetadataSchemasClientHeadResponse, error)
- func (client *MetadataSchemasClient) NewListPager(resourceGroupName string, serviceName string, ...) *runtime.Pager[MetadataSchemasClientListResponse]
- type MetadataSchemasClientCreateOrUpdateOptions
- type MetadataSchemasClientCreateOrUpdateResponse
- type MetadataSchemasClientDeleteOptions
- type MetadataSchemasClientDeleteResponse
- type MetadataSchemasClientGetOptions
- type MetadataSchemasClientGetResponse
- type MetadataSchemasClientHeadOptions
- type MetadataSchemasClientHeadResponse
- type MetadataSchemasClientListOptions
- type MetadataSchemasClientListResponse
- type Onboarding
- type Operation
- type OperationDisplay
- type OperationListResult
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Origin
- type ProvisioningState
- type Service
- type ServiceListResult
- type ServiceProperties
- type ServiceUpdate
- type ServicesClient
- func (client *ServicesClient) BeginExportMetadataSchema(ctx context.Context, resourceGroupName string, serviceName string, ...) (*runtime.Poller[ServicesClientExportMetadataSchemaResponse], error)
- func (client *ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (ServicesClientCreateOrUpdateResponse, error)
- func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (ServicesClientDeleteResponse, error)
- func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (ServicesClientGetResponse, error)
- func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse]
- func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse]
- func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ...) (ServicesClientUpdateResponse, error)
- type ServicesClientBeginExportMetadataSchemaOptions
- type ServicesClientCreateOrUpdateOptions
- type ServicesClientCreateOrUpdateResponse
- type ServicesClientDeleteOptions
- type ServicesClientDeleteResponse
- type ServicesClientExportMetadataSchemaResponse
- type ServicesClientGetOptions
- type ServicesClientGetResponse
- type ServicesClientListByResourceGroupOptions
- type ServicesClientListByResourceGroupResponse
- type ServicesClientListBySubscriptionOptions
- type ServicesClientListBySubscriptionResponse
- type ServicesClientUpdateOptions
- type ServicesClientUpdateResponse
- type SystemData
- type TermsOfService
- type UserAssignedIdentity
- type Workspace
- type WorkspaceListResult
- type WorkspaceProperties
- type WorkspacesClient
- func (client *WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, ...) (WorkspacesClientCreateOrUpdateResponse, error)
- func (client *WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, ...) (WorkspacesClientDeleteResponse, error)
- func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, ...) (WorkspacesClientGetResponse, error)
- func (client *WorkspacesClient) Head(ctx context.Context, resourceGroupName string, serviceName string, ...) (WorkspacesClientHeadResponse, error)
- func (client *WorkspacesClient) NewListPager(resourceGroupName string, serviceName string, ...) *runtime.Pager[WorkspacesClientListResponse]
- type WorkspacesClientCreateOrUpdateOptions
- type WorkspacesClientCreateOrUpdateResponse
- type WorkspacesClientDeleteOptions
- type WorkspacesClientDeleteResponse
- type WorkspacesClientGetOptions
- type WorkspacesClientGetResponse
- type WorkspacesClientHeadOptions
- type WorkspacesClientHeadResponse
- type WorkspacesClientListOptions
- type WorkspacesClientListResponse
Examples ¶
- APIDefinitionsClient.BeginExportSpecification
- APIDefinitionsClient.BeginImportSpecification
- APIDefinitionsClient.CreateOrUpdate
- APIDefinitionsClient.Delete
- APIDefinitionsClient.Get
- APIDefinitionsClient.Head
- APIDefinitionsClient.NewListPager
- APIVersionsClient.CreateOrUpdate
- APIVersionsClient.Delete
- APIVersionsClient.Get
- APIVersionsClient.Head
- APIVersionsClient.NewListPager
- ApisClient.CreateOrUpdate
- ApisClient.Delete
- ApisClient.Get
- ApisClient.Head
- ApisClient.NewListPager
- DeploymentsClient.CreateOrUpdate
- DeploymentsClient.Delete
- DeploymentsClient.Get
- DeploymentsClient.Head
- DeploymentsClient.NewListPager
- EnvironmentsClient.CreateOrUpdate
- EnvironmentsClient.Delete
- EnvironmentsClient.Get
- EnvironmentsClient.Head
- EnvironmentsClient.NewListPager
- MetadataSchemasClient.CreateOrUpdate
- MetadataSchemasClient.Delete
- MetadataSchemasClient.Get
- MetadataSchemasClient.Head
- MetadataSchemasClient.NewListPager
- OperationsClient.NewListPager
- ServicesClient.BeginExportMetadataSchema
- ServicesClient.CreateOrUpdate
- ServicesClient.Delete
- ServicesClient.Get
- ServicesClient.NewListByResourceGroupPager
- ServicesClient.NewListBySubscriptionPager
- ServicesClient.Update
- WorkspacesClient.CreateOrUpdate
- WorkspacesClient.Delete
- WorkspacesClient.Get
- WorkspacesClient.Head
- WorkspacesClient.NewListPager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v1.0.0
type API struct { // The resource-specific properties for this resource. Properties *APIProperties // 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 }
API entity.
func (API) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type API.
func (*API) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type API.
type APIDefinition ¶ added in v1.0.0
type APIDefinition struct { // The resource-specific properties for this resource. Properties *APIDefinitionProperties // 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 }
APIDefinition - API definition entity.
func (APIDefinition) MarshalJSON ¶ added in v1.0.0
func (a APIDefinition) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIDefinition.
func (*APIDefinition) UnmarshalJSON ¶ added in v1.0.0
func (a *APIDefinition) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinition.
type APIDefinitionListResult ¶ added in v1.0.0
type APIDefinitionListResult struct { // READ-ONLY; The ApiDefinition items on this page Value []*APIDefinition // READ-ONLY; The link to the next page of items NextLink *string }
APIDefinitionListResult - The response of a ApiDefinition list operation.
func (APIDefinitionListResult) MarshalJSON ¶ added in v1.0.0
func (a APIDefinitionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIDefinitionListResult.
func (*APIDefinitionListResult) UnmarshalJSON ¶ added in v1.0.0
func (a *APIDefinitionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionListResult.
type APIDefinitionProperties ¶ added in v1.0.0
type APIDefinitionProperties struct { // REQUIRED; API definition title. Title *string // API definition description. Description *string // READ-ONLY; API specification details. Specification *APIDefinitionPropertiesSpecification }
APIDefinitionProperties - API definition properties entity.
func (APIDefinitionProperties) MarshalJSON ¶ added in v1.0.0
func (a APIDefinitionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIDefinitionProperties.
func (*APIDefinitionProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *APIDefinitionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionProperties.
type APIDefinitionPropertiesSpecification ¶ added in v1.0.0
type APIDefinitionPropertiesSpecification struct { // Specification name. Name *string // Specification version. Version *string }
APIDefinitionPropertiesSpecification - API specification details.
func (APIDefinitionPropertiesSpecification) MarshalJSON ¶ added in v1.0.0
func (a APIDefinitionPropertiesSpecification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIDefinitionPropertiesSpecification.
func (*APIDefinitionPropertiesSpecification) UnmarshalJSON ¶ added in v1.0.0
func (a *APIDefinitionPropertiesSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIDefinitionPropertiesSpecification.
type APIDefinitionsClient ¶ added in v1.0.0
type APIDefinitionsClient struct {
// contains filtered or unexported fields
}
APIDefinitionsClient contains the methods for the APIDefinitions group. Don't use this type directly, use NewAPIDefinitionsClient() instead.
func NewAPIDefinitionsClient ¶ added in v1.0.0
func NewAPIDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIDefinitionsClient, error)
NewAPIDefinitionsClient creates a new instance of APIDefinitionsClient 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 (*APIDefinitionsClient) BeginExportSpecification ¶ added in v1.0.0
func (client *APIDefinitionsClient) BeginExportSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientBeginExportSpecificationOptions) (*runtime.Poller[APIDefinitionsClientExportSpecificationResponse], error)
BeginExportSpecification - Exports the API specification. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- options - APIDefinitionsClientBeginExportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginExportSpecification method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ExportSpecification.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAPIDefinitionsClient().BeginExportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.APISpecExportResult = armapicenter.APISpecExportResult{ // Format: to.Ptr(armapicenter.APISpecExportResultFormatInline), // Value: to.Ptr("{ ... }"), // } }
Output:
func (*APIDefinitionsClient) BeginImportSpecification ¶ added in v1.0.0
func (client *APIDefinitionsClient) BeginImportSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, body APISpecImportRequest, options *APIDefinitionsClientBeginImportSpecificationOptions) (*runtime.Poller[APIDefinitionsClientImportSpecificationResponse], error)
BeginImportSpecification - Imports the API specification. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- body - The content of the action request
- options - APIDefinitionsClientBeginImportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginImportSpecification method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ImportSpecification.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewAPIDefinitionsClient().BeginImportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", armapicenter.APISpecImportRequest{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } }
Output:
func (*APIDefinitionsClient) CreateOrUpdate ¶ added in v1.0.0
func (client *APIDefinitionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, resource APIDefinition, options *APIDefinitionsClientCreateOrUpdateOptions) (APIDefinitionsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing API definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- resource - Resource create parameters.
- options - APIDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the APIDefinitionsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAPIDefinitionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "openapi", "2023-01-01", "openapi", armapicenter.APIDefinition{}, 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.APIDefinition = armapicenter.APIDefinition{ // Name: to.Ptr("openapi"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIDefinitionProperties{ // Description: to.Ptr("Default spec"), // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ // Name: to.Ptr("openapi"), // Version: to.Ptr("3.0.6"), // }, // Title: to.Ptr("OpenAPI"), // }, // } }
Output:
func (*APIDefinitionsClient) Delete ¶ added in v1.0.0
func (client *APIDefinitionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientDeleteOptions) (APIDefinitionsClientDeleteResponse, error)
Delete - Deletes specified API definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- options - APIDefinitionsClientDeleteOptions contains the optional parameters for the APIDefinitionsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAPIDefinitionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*APIDefinitionsClient) Get ¶ added in v1.0.0
func (client *APIDefinitionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientGetOptions) (APIDefinitionsClientGetResponse, error)
Get - Returns details of the API definition. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- options - APIDefinitionsClientGetOptions contains the optional parameters for the APIDefinitionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAPIDefinitionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", 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.APIDefinition = armapicenter.APIDefinition{ // Name: to.Ptr("openapi"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIDefinitionProperties{ // Description: to.Ptr("Default spec"), // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ // Name: to.Ptr("openapi"), // Version: to.Ptr("3.0.6"), // }, // Title: to.Ptr("OpenAPI"), // }, // } }
Output:
func (*APIDefinitionsClient) Head ¶ added in v1.0.0
func (client *APIDefinitionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientHeadOptions) (APIDefinitionsClientHeadResponse, error)
Head - Checks if specified API definition exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- definitionName - The name of the API definition.
- options - APIDefinitionsClientHeadOptions contains the optional parameters for the APIDefinitionsClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAPIDefinitionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*APIDefinitionsClient) NewListPager ¶ added in v1.0.0
func (client *APIDefinitionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIDefinitionsClientListOptions) *runtime.Pager[APIDefinitionsClientListResponse]
NewListPager - Returns a collection of API definitions.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- options - APIDefinitionsClientListOptions contains the optional parameters for the APIDefinitionsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAPIDefinitionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", "2023-01-01", &armapicenter.APIDefinitionsClientListOptions{Filter: 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.APIDefinitionListResult = armapicenter.APIDefinitionListResult{ // Value: []*armapicenter.APIDefinition{ // { // Name: to.Ptr("openapi"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIDefinitionProperties{ // Description: to.Ptr("Default spec"), // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ // Name: to.Ptr("openapi"), // Version: to.Ptr("3.0.6"), // }, // Title: to.Ptr("OpenAPI"), // }, // }}, // } } }
Output:
type APIDefinitionsClientBeginExportSpecificationOptions ¶ added in v1.0.0
type APIDefinitionsClientBeginExportSpecificationOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
APIDefinitionsClientBeginExportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginExportSpecification method.
type APIDefinitionsClientBeginImportSpecificationOptions ¶ added in v1.0.0
type APIDefinitionsClientBeginImportSpecificationOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
APIDefinitionsClientBeginImportSpecificationOptions contains the optional parameters for the APIDefinitionsClient.BeginImportSpecification method.
type APIDefinitionsClientCreateOrUpdateOptions ¶ added in v1.0.0
type APIDefinitionsClientCreateOrUpdateOptions struct { }
APIDefinitionsClientCreateOrUpdateOptions contains the optional parameters for the APIDefinitionsClient.CreateOrUpdate method.
type APIDefinitionsClientCreateOrUpdateResponse ¶ added in v1.0.0
type APIDefinitionsClientCreateOrUpdateResponse struct { // API definition entity. APIDefinition // ETag contains the information returned from the ETag header response. ETag *string }
APIDefinitionsClientCreateOrUpdateResponse contains the response from method APIDefinitionsClient.CreateOrUpdate.
type APIDefinitionsClientDeleteOptions ¶ added in v1.0.0
type APIDefinitionsClientDeleteOptions struct { }
APIDefinitionsClientDeleteOptions contains the optional parameters for the APIDefinitionsClient.Delete method.
type APIDefinitionsClientDeleteResponse ¶ added in v1.0.0
type APIDefinitionsClientDeleteResponse struct { }
APIDefinitionsClientDeleteResponse contains the response from method APIDefinitionsClient.Delete.
type APIDefinitionsClientExportSpecificationResponse ¶ added in v1.0.0
type APIDefinitionsClientExportSpecificationResponse struct { // The API specification export result. APISpecExportResult }
APIDefinitionsClientExportSpecificationResponse contains the response from method APIDefinitionsClient.BeginExportSpecification.
type APIDefinitionsClientGetOptions ¶ added in v1.0.0
type APIDefinitionsClientGetOptions struct { }
APIDefinitionsClientGetOptions contains the optional parameters for the APIDefinitionsClient.Get method.
type APIDefinitionsClientGetResponse ¶ added in v1.0.0
type APIDefinitionsClientGetResponse struct { // API definition entity. APIDefinition // ETag contains the information returned from the ETag header response. ETag *string }
APIDefinitionsClientGetResponse contains the response from method APIDefinitionsClient.Get.
type APIDefinitionsClientHeadOptions ¶ added in v1.0.0
type APIDefinitionsClientHeadOptions struct { }
APIDefinitionsClientHeadOptions contains the optional parameters for the APIDefinitionsClient.Head method.
type APIDefinitionsClientHeadResponse ¶ added in v1.0.0
type APIDefinitionsClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
APIDefinitionsClientHeadResponse contains the response from method APIDefinitionsClient.Head.
type APIDefinitionsClientImportSpecificationResponse ¶ added in v1.0.0
type APIDefinitionsClientImportSpecificationResponse struct { }
APIDefinitionsClientImportSpecificationResponse contains the response from method APIDefinitionsClient.BeginImportSpecification.
type APIDefinitionsClientListOptions ¶ added in v1.0.0
type APIDefinitionsClientListOptions struct { // OData filter parameter. Filter *string }
APIDefinitionsClientListOptions contains the optional parameters for the APIDefinitionsClient.NewListPager method.
type APIDefinitionsClientListResponse ¶ added in v1.0.0
type APIDefinitionsClientListResponse struct { // The response of a ApiDefinition list operation. APIDefinitionListResult }
APIDefinitionsClientListResponse contains the response from method APIDefinitionsClient.NewListPager.
type APIKind ¶ added in v1.0.0
type APIKind string
APIKind - The kind of the API
const ( // APIKindGraphql - A Graph query language Api APIKindGraphql APIKind = "graphql" // APIKindGrpc - A gRPC Api APIKindGrpc APIKind = "grpc" // APIKindRest - A Representational State Transfer Api APIKindRest APIKind = "rest" // APIKindSoap - A SOAP Api APIKindSoap APIKind = "soap" // APIKindWebhook - Web Hook APIKindWebhook APIKind = "webhook" // APIKindWebsocket - Web Socket APIKindWebsocket APIKind = "websocket" )
func PossibleAPIKindValues ¶ added in v1.0.0
func PossibleAPIKindValues() []APIKind
PossibleAPIKindValues returns the possible values for the APIKind const type.
type APIListResult ¶ added in v1.0.0
type APIListResult struct { // READ-ONLY; The Api items on this page Value []*API // READ-ONLY; The link to the next page of items NextLink *string }
APIListResult - The response of a Api list operation.
func (APIListResult) MarshalJSON ¶ added in v1.0.0
func (a APIListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIListResult.
func (*APIListResult) UnmarshalJSON ¶ added in v1.0.0
func (a *APIListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIListResult.
type APIProperties ¶ added in v1.0.0
type APIProperties struct { // REQUIRED; Kind of API. For example, REST or GraphQL. Kind *APIKind // REQUIRED; API title. Title *string // The set of contacts Contacts []*Contact // The custom metadata defined for API catalog entities. CustomProperties any // Description of the API. Description *string // The set of external documentation ExternalDocumentation []*ExternalDocumentation // The license information for the API. License *License // Short description of the API. Summary *string // Terms of service for the API. TermsOfService *TermsOfService // READ-ONLY; Current lifecycle stage of the API. LifecycleStage *LifecycleStage }
APIProperties - API properties.
func (APIProperties) MarshalJSON ¶ added in v1.0.0
func (a APIProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIProperties.
func (*APIProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *APIProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIProperties.
type APISpecExportResult ¶ added in v1.0.0
type APISpecExportResult struct { // The format of exported result Format *APISpecExportResultFormat // The result of the export operation. Value *string }
APISpecExportResult - The API specification export result.
func (APISpecExportResult) MarshalJSON ¶ added in v1.0.0
func (a APISpecExportResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APISpecExportResult.
func (*APISpecExportResult) UnmarshalJSON ¶ added in v1.0.0
func (a *APISpecExportResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APISpecExportResult.
type APISpecExportResultFormat ¶ added in v1.0.0
type APISpecExportResultFormat string
APISpecExportResultFormat - Result format for exported Api spec
const ( // APISpecExportResultFormatInline - The inlined content of a specification document. APISpecExportResultFormatInline APISpecExportResultFormat = "inline" // APISpecExportResultFormatLink - The link to the result of the export operation. The URL is valid for 5 minutes. APISpecExportResultFormatLink APISpecExportResultFormat = "link" )
func PossibleAPISpecExportResultFormatValues ¶ added in v1.0.0
func PossibleAPISpecExportResultFormatValues() []APISpecExportResultFormat
PossibleAPISpecExportResultFormatValues returns the possible values for the APISpecExportResultFormat const type.
type APISpecImportRequest ¶ added in v1.0.0
type APISpecImportRequest struct { // Format of the API specification source. Format *APISpecImportSourceFormat // API specification details. Specification *APISpecImportRequestSpecification // Value of the API specification source. Value *string }
APISpecImportRequest - The API specification source entity properties.
func (APISpecImportRequest) MarshalJSON ¶ added in v1.0.0
func (a APISpecImportRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APISpecImportRequest.
func (*APISpecImportRequest) UnmarshalJSON ¶ added in v1.0.0
func (a *APISpecImportRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APISpecImportRequest.
type APISpecImportRequestSpecification ¶ added in v1.0.0
type APISpecImportRequestSpecification struct { // Specification name. Name *string // Specification version. Version *string }
APISpecImportRequestSpecification - API specification details.
func (APISpecImportRequestSpecification) MarshalJSON ¶ added in v1.0.0
func (a APISpecImportRequestSpecification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APISpecImportRequestSpecification.
func (*APISpecImportRequestSpecification) UnmarshalJSON ¶ added in v1.0.0
func (a *APISpecImportRequestSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APISpecImportRequestSpecification.
type APISpecImportSourceFormat ¶ added in v1.0.0
type APISpecImportSourceFormat string
APISpecImportSourceFormat - Source format for imported Api spec
const ( // APISpecImportSourceFormatInline - The inlined content of a specification document. APISpecImportSourceFormatInline APISpecImportSourceFormat = "inline" // APISpecImportSourceFormatLink - The link to a specification document hosted on a publicly accessible internet // address. APISpecImportSourceFormatLink APISpecImportSourceFormat = "link" )
func PossibleAPISpecImportSourceFormatValues ¶ added in v1.0.0
func PossibleAPISpecImportSourceFormatValues() []APISpecImportSourceFormat
PossibleAPISpecImportSourceFormatValues returns the possible values for the APISpecImportSourceFormat const type.
type APIVersion ¶ added in v1.0.0
type APIVersion struct { // The resource-specific properties for this resource. Properties *APIVersionProperties // 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 }
APIVersion - API version entity.
func (APIVersion) MarshalJSON ¶ added in v1.0.0
func (a APIVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIVersion.
func (*APIVersion) UnmarshalJSON ¶ added in v1.0.0
func (a *APIVersion) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIVersion.
type APIVersionListResult ¶ added in v1.0.0
type APIVersionListResult struct { // READ-ONLY; The ApiVersion items on this page Value []*APIVersion // READ-ONLY; The link to the next page of items NextLink *string }
APIVersionListResult - The response of a ApiVersion list operation.
func (APIVersionListResult) MarshalJSON ¶ added in v1.0.0
func (a APIVersionListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIVersionListResult.
func (*APIVersionListResult) UnmarshalJSON ¶ added in v1.0.0
func (a *APIVersionListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionListResult.
type APIVersionProperties ¶ added in v1.0.0
type APIVersionProperties struct { // REQUIRED; Current lifecycle stage of the API. LifecycleStage *LifecycleStage // REQUIRED; API version title. Title *string }
APIVersionProperties - API version properties entity.
func (APIVersionProperties) MarshalJSON ¶ added in v1.0.0
func (a APIVersionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type APIVersionProperties.
func (*APIVersionProperties) UnmarshalJSON ¶ added in v1.0.0
func (a *APIVersionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionProperties.
type APIVersionsClient ¶ added in v1.0.0
type APIVersionsClient struct {
// contains filtered or unexported fields
}
APIVersionsClient contains the methods for the APIVersions group. Don't use this type directly, use NewAPIVersionsClient() instead.
func NewAPIVersionsClient ¶ added in v1.0.0
func NewAPIVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIVersionsClient, error)
NewAPIVersionsClient creates a new instance of APIVersionsClient 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 (*APIVersionsClient) CreateOrUpdate ¶ added in v1.0.0
func (client *APIVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, resource APIVersion, options *APIVersionsClientCreateOrUpdateOptions) (APIVersionsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing API version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- resource - Resource create parameters.
- options - APIVersionsClientCreateOrUpdateOptions contains the optional parameters for the APIVersionsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAPIVersionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", armapicenter.APIVersion{}, 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.APIVersion = armapicenter.APIVersion{ // Name: to.Ptr("2023-01-01"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIVersionProperties{ // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), // Title: to.Ptr("2023-01-01"), // }, // } }
Output:
func (*APIVersionsClient) Delete ¶ added in v1.0.0
func (client *APIVersionsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientDeleteOptions) (APIVersionsClientDeleteResponse, error)
Delete - Deletes specified API version If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- options - APIVersionsClientDeleteOptions contains the optional parameters for the APIVersionsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAPIVersionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*APIVersionsClient) Get ¶ added in v1.0.0
func (client *APIVersionsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientGetOptions) (APIVersionsClientGetResponse, error)
Get - Returns details of the API version. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- options - APIVersionsClientGetOptions contains the optional parameters for the APIVersionsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewAPIVersionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", 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.APIVersion = armapicenter.APIVersion{ // Name: to.Ptr("2023-01-01"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIVersionProperties{ // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), // Title: to.Ptr("2023-01-01"), // }, // } }
Output:
func (*APIVersionsClient) Head ¶ added in v1.0.0
func (client *APIVersionsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, options *APIVersionsClientHeadOptions) (APIVersionsClientHeadResponse, error)
Head - Checks if specified API version exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- versionName - The name of the API version.
- options - APIVersionsClientHeadOptions contains the optional parameters for the APIVersionsClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewAPIVersionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*APIVersionsClient) NewListPager ¶ added in v1.0.0
func (client *APIVersionsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, options *APIVersionsClientListOptions) *runtime.Pager[APIVersionsClientListResponse]
NewListPager - Returns a collection of API versions.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- options - APIVersionsClientListOptions contains the optional parameters for the APIVersionsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewAPIVersionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.APIVersionsClientListOptions{Filter: 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.APIVersionListResult = armapicenter.APIVersionListResult{ // Value: []*armapicenter.APIVersion{ // { // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIVersionProperties{ // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), // Title: to.Ptr("2023-01-01"), // }, // }}, // } } }
Output:
type APIVersionsClientCreateOrUpdateOptions ¶ added in v1.0.0
type APIVersionsClientCreateOrUpdateOptions struct { }
APIVersionsClientCreateOrUpdateOptions contains the optional parameters for the APIVersionsClient.CreateOrUpdate method.
type APIVersionsClientCreateOrUpdateResponse ¶ added in v1.0.0
type APIVersionsClientCreateOrUpdateResponse struct { // API version entity. APIVersion // ETag contains the information returned from the ETag header response. ETag *string }
APIVersionsClientCreateOrUpdateResponse contains the response from method APIVersionsClient.CreateOrUpdate.
type APIVersionsClientDeleteOptions ¶ added in v1.0.0
type APIVersionsClientDeleteOptions struct { }
APIVersionsClientDeleteOptions contains the optional parameters for the APIVersionsClient.Delete method.
type APIVersionsClientDeleteResponse ¶ added in v1.0.0
type APIVersionsClientDeleteResponse struct { }
APIVersionsClientDeleteResponse contains the response from method APIVersionsClient.Delete.
type APIVersionsClientGetOptions ¶ added in v1.0.0
type APIVersionsClientGetOptions struct { }
APIVersionsClientGetOptions contains the optional parameters for the APIVersionsClient.Get method.
type APIVersionsClientGetResponse ¶ added in v1.0.0
type APIVersionsClientGetResponse struct { // API version entity. APIVersion // ETag contains the information returned from the ETag header response. ETag *string }
APIVersionsClientGetResponse contains the response from method APIVersionsClient.Get.
type APIVersionsClientHeadOptions ¶ added in v1.0.0
type APIVersionsClientHeadOptions struct { }
APIVersionsClientHeadOptions contains the optional parameters for the APIVersionsClient.Head method.
type APIVersionsClientHeadResponse ¶ added in v1.0.0
type APIVersionsClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
APIVersionsClientHeadResponse contains the response from method APIVersionsClient.Head.
type APIVersionsClientListOptions ¶ added in v1.0.0
type APIVersionsClientListOptions struct { // OData filter parameter. Filter *string }
APIVersionsClientListOptions contains the optional parameters for the APIVersionsClient.NewListPager method.
type APIVersionsClientListResponse ¶ added in v1.0.0
type APIVersionsClientListResponse struct { // The response of a ApiVersion list operation. APIVersionListResult }
APIVersionsClientListResponse contains the response from method APIVersionsClient.NewListPager.
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 ApisClient ¶ added in v1.0.0
type ApisClient struct {
// contains filtered or unexported fields
}
ApisClient contains the methods for the Apis group. Don't use this type directly, use NewApisClient() instead.
func NewApisClient ¶ added in v1.0.0
func NewApisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApisClient, error)
NewApisClient creates a new instance of ApisClient 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 (*ApisClient) CreateOrUpdate ¶ added in v1.0.0
func (client *ApisClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, resource API, options *ApisClientCreateOrUpdateOptions) (ApisClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- resource - Resource create parameters.
- options - ApisClientCreateOrUpdateOptions contains the optional parameters for the ApisClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewApisClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", armapicenter.API{}, 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.API = armapicenter.API{ // Name: to.Ptr("echo-api"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIProperties{ // Description: to.Ptr("A simple HTTP request/response service."), // CustomProperties: map[string]any{ // "author": "John Doe", // }, // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ // { // Title: to.Ptr("Onboarding docs"), // URL: to.Ptr("https://docs.contoso.com"), // }}, // Kind: to.Ptr(armapicenter.APIKindRest), // License: &armapicenter.License{ // URL: to.Ptr("https://contoso.com/license"), // }, // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), // TermsOfService: &armapicenter.TermsOfService{ // URL: to.Ptr("https://contoso.com/terms-of-service"), // }, // Title: to.Ptr("Echo API"), // }, // } }
Output:
func (*ApisClient) Delete ¶ added in v1.0.0
func (client *ApisClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientDeleteOptions) (ApisClientDeleteResponse, error)
Delete - Deletes specified API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- options - ApisClientDeleteOptions contains the optional parameters for the ApisClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewApisClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ApisClient) Get ¶ added in v1.0.0
func (client *ApisClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientGetOptions) (ApisClientGetResponse, error)
Get - Returns details of the API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- options - ApisClientGetOptions contains the optional parameters for the ApisClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewApisClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", 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.API = armapicenter.API{ // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIProperties{ // Description: to.Ptr("A simple HTTP request/response service."), // CustomProperties: map[string]any{ // "author": "John Doe", // }, // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ // { // Title: to.Ptr("Onboarding docs"), // URL: to.Ptr("https://docs.contoso.com"), // }}, // Kind: to.Ptr(armapicenter.APIKindRest), // License: &armapicenter.License{ // URL: to.Ptr("https://contoso.com/license"), // }, // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), // TermsOfService: &armapicenter.TermsOfService{ // URL: to.Ptr("https://contoso.com/terms-of-service"), // }, // Title: to.Ptr("Echo API"), // }, // } }
Output:
func (*ApisClient) Head ¶ added in v1.0.0
func (client *ApisClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, options *ApisClientHeadOptions) (ApisClientHeadResponse, error)
Head - Checks if specified API exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- options - ApisClientHeadOptions contains the optional parameters for the ApisClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewApisClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ApisClient) NewListPager ¶ added in v1.0.0
func (client *ApisClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, options *ApisClientListOptions) *runtime.Pager[ApisClientListResponse]
NewListPager - Returns a collection of APIs.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- options - ApisClientListOptions contains the optional parameters for the ApisClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewApisClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.ApisClientListOptions{Filter: 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.APIListResult = armapicenter.APIListResult{ // Value: []*armapicenter.API{ // { // Name: to.Ptr("echo-api"), // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.APIProperties{ // Description: to.Ptr("A simple HTTP request/response service."), // CustomProperties: map[string]any{ // "author": "John Doe", // }, // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ // { // Title: to.Ptr("Onboarding docs"), // URL: to.Ptr("https://docs.contoso.com"), // }}, // Kind: to.Ptr(armapicenter.APIKindRest), // License: &armapicenter.License{ // URL: to.Ptr("https://contoso.com/license"), // }, // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), // TermsOfService: &armapicenter.TermsOfService{ // URL: to.Ptr("https://contoso.com/terms-of-service"), // }, // Title: to.Ptr("Echo API"), // }, // }}, // } } }
Output:
type ApisClientCreateOrUpdateOptions ¶ added in v1.0.0
type ApisClientCreateOrUpdateOptions struct { }
ApisClientCreateOrUpdateOptions contains the optional parameters for the ApisClient.CreateOrUpdate method.
type ApisClientCreateOrUpdateResponse ¶ added in v1.0.0
type ApisClientCreateOrUpdateResponse struct { // API entity. API // ETag contains the information returned from the ETag header response. ETag *string }
ApisClientCreateOrUpdateResponse contains the response from method ApisClient.CreateOrUpdate.
type ApisClientDeleteOptions ¶ added in v1.0.0
type ApisClientDeleteOptions struct { }
ApisClientDeleteOptions contains the optional parameters for the ApisClient.Delete method.
type ApisClientDeleteResponse ¶ added in v1.0.0
type ApisClientDeleteResponse struct { }
ApisClientDeleteResponse contains the response from method ApisClient.Delete.
type ApisClientGetOptions ¶ added in v1.0.0
type ApisClientGetOptions struct { }
ApisClientGetOptions contains the optional parameters for the ApisClient.Get method.
type ApisClientGetResponse ¶ added in v1.0.0
type ApisClientGetResponse struct { // API entity. API // ETag contains the information returned from the ETag header response. ETag *string }
ApisClientGetResponse contains the response from method ApisClient.Get.
type ApisClientHeadOptions ¶ added in v1.0.0
type ApisClientHeadOptions struct { }
ApisClientHeadOptions contains the optional parameters for the ApisClient.Head method.
type ApisClientHeadResponse ¶ added in v1.0.0
type ApisClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
ApisClientHeadResponse contains the response from method ApisClient.Head.
type ApisClientListOptions ¶ added in v1.0.0
type ApisClientListOptions struct { // OData filter parameter. Filter *string }
ApisClientListOptions contains the optional parameters for the ApisClient.NewListPager method.
type ApisClientListResponse ¶ added in v1.0.0
type ApisClientListResponse struct { // The response of a Api list operation. APIListResult }
ApisClientListResponse contains the response from method ApisClient.NewListPager.
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) NewAPIDefinitionsClient ¶ added in v1.0.0
func (c *ClientFactory) NewAPIDefinitionsClient() *APIDefinitionsClient
NewAPIDefinitionsClient creates a new instance of APIDefinitionsClient.
func (*ClientFactory) NewAPIVersionsClient ¶ added in v1.0.0
func (c *ClientFactory) NewAPIVersionsClient() *APIVersionsClient
NewAPIVersionsClient creates a new instance of APIVersionsClient.
func (*ClientFactory) NewApisClient ¶ added in v1.0.0
func (c *ClientFactory) NewApisClient() *ApisClient
NewApisClient creates a new instance of ApisClient.
func (*ClientFactory) NewDeploymentsClient ¶ added in v1.0.0
func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient
NewDeploymentsClient creates a new instance of DeploymentsClient.
func (*ClientFactory) NewEnvironmentsClient ¶ added in v1.0.0
func (c *ClientFactory) NewEnvironmentsClient() *EnvironmentsClient
NewEnvironmentsClient creates a new instance of EnvironmentsClient.
func (*ClientFactory) NewMetadataSchemasClient ¶ added in v1.0.0
func (c *ClientFactory) NewMetadataSchemasClient() *MetadataSchemasClient
NewMetadataSchemasClient creates a new instance of MetadataSchemasClient.
func (*ClientFactory) NewOperationsClient ¶
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewServicesClient ¶
func (c *ClientFactory) NewServicesClient() *ServicesClient
NewServicesClient creates a new instance of ServicesClient.
func (*ClientFactory) NewWorkspacesClient ¶ added in v1.0.0
func (c *ClientFactory) NewWorkspacesClient() *WorkspacesClient
NewWorkspacesClient creates a new instance of WorkspacesClient.
type Contact ¶ added in v1.0.0
type Contact struct { // Email address of the contact. Email *string // Name of the contact. Name *string // URL for the contact. URL *string }
Contact information
func (Contact) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Contact.
func (*Contact) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Contact.
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 Deployment ¶ added in v1.0.0
type Deployment struct { // The resource-specific properties for this resource. Properties *DeploymentProperties // 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 }
Deployment - API deployment entity.
func (Deployment) MarshalJSON ¶ added in v1.0.0
func (d Deployment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Deployment.
func (*Deployment) UnmarshalJSON ¶ added in v1.0.0
func (d *Deployment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Deployment.
type DeploymentListResult ¶ added in v1.0.0
type DeploymentListResult struct { // READ-ONLY; The Deployment items on this page Value []*Deployment // READ-ONLY; The link to the next page of items NextLink *string }
DeploymentListResult - The response of a Deployment list operation.
func (DeploymentListResult) MarshalJSON ¶ added in v1.0.0
func (d DeploymentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentListResult.
func (*DeploymentListResult) UnmarshalJSON ¶ added in v1.0.0
func (d *DeploymentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentListResult.
type DeploymentProperties ¶ added in v1.0.0
type DeploymentProperties struct { // The custom metadata defined for API catalog entities. CustomProperties any // API center-scoped definition resource ID. DefinitionID *string // Description of the deployment. Description *string // API center-scoped environment resource ID. EnvironmentID *string // The deployment server Server *DeploymentServer // State of API deployment. State *DeploymentState // API deployment title Title *string }
DeploymentProperties - API deployment entity properties.
func (DeploymentProperties) MarshalJSON ¶ added in v1.0.0
func (d DeploymentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentProperties.
func (*DeploymentProperties) UnmarshalJSON ¶ added in v1.0.0
func (d *DeploymentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentProperties.
type DeploymentServer ¶ added in v1.0.0
type DeploymentServer struct { // Base runtime URLs for this deployment. RuntimeURI []*string }
DeploymentServer - Server
func (DeploymentServer) MarshalJSON ¶ added in v1.0.0
func (d DeploymentServer) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeploymentServer.
func (*DeploymentServer) UnmarshalJSON ¶ added in v1.0.0
func (d *DeploymentServer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentServer.
type DeploymentState ¶ added in v1.0.0
type DeploymentState string
DeploymentState - State of the Deployment
const ( // DeploymentStateActive - Active State DeploymentStateActive DeploymentState = "active" // DeploymentStateInactive - Inactive State DeploymentStateInactive DeploymentState = "inactive" )
func PossibleDeploymentStateValues ¶ added in v1.0.0
func PossibleDeploymentStateValues() []DeploymentState
PossibleDeploymentStateValues returns the possible values for the DeploymentState const type.
type DeploymentsClient ¶ added in v1.0.0
type DeploymentsClient struct {
// contains filtered or unexported fields
}
DeploymentsClient contains the methods for the Deployments group. Don't use this type directly, use NewDeploymentsClient() instead.
func NewDeploymentsClient ¶ added in v1.0.0
func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeploymentsClient, error)
NewDeploymentsClient creates a new instance of DeploymentsClient 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 (*DeploymentsClient) CreateOrUpdate ¶ added in v1.0.0
func (client *DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, resource Deployment, options *DeploymentsClientCreateOrUpdateOptions) (DeploymentsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing API deployment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- deploymentName - The name of the API deployment.
- resource - Resource create parameters.
- options - DeploymentsClientCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDeploymentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", armapicenter.Deployment{}, 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.Deployment = armapicenter.Deployment{ // Name: to.Ptr("production"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.DeploymentProperties{ // Description: to.Ptr("Public cloud production deployment."), // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), // Server: &armapicenter.DeploymentServer{ // RuntimeURI: []*string{ // to.Ptr("https://api.contoso.com")}, // }, // State: to.Ptr(armapicenter.DeploymentStateActive), // Title: to.Ptr("Production deployment"), // }, // } }
Output:
func (*DeploymentsClient) Delete ¶ added in v1.0.0
func (client *DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientDeleteOptions) (DeploymentsClientDeleteResponse, error)
Delete - Deletes API deployment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- deploymentName - The name of the API deployment.
- options - DeploymentsClientDeleteOptions contains the optional parameters for the DeploymentsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDeploymentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DeploymentsClient) Get ¶ added in v1.0.0
func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientGetOptions) (DeploymentsClientGetResponse, error)
Get - Returns details of the API deployment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- deploymentName - The name of the API deployment.
- options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDeploymentsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", 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.Deployment = armapicenter.Deployment{ // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.DeploymentProperties{ // Description: to.Ptr("Public cloud production deployment."), // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), // Server: &armapicenter.DeploymentServer{ // RuntimeURI: []*string{ // to.Ptr("https://api.contoso.com")}, // }, // State: to.Ptr(armapicenter.DeploymentStateActive), // Title: to.Ptr("Production deployment"), // }, // } }
Output:
func (*DeploymentsClient) Head ¶ added in v1.0.0
func (client *DeploymentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, deploymentName string, options *DeploymentsClientHeadOptions) (DeploymentsClientHeadResponse, error)
Head - Checks if specified API deployment exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- deploymentName - The name of the API deployment.
- options - DeploymentsClientHeadOptions contains the optional parameters for the DeploymentsClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDeploymentsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DeploymentsClient) NewListPager ¶ added in v1.0.0
func (client *DeploymentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, apiName string, options *DeploymentsClientListOptions) *runtime.Pager[DeploymentsClientListResponse]
NewListPager - Returns a collection of API deployments.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- apiName - The name of the API.
- options - DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDeploymentsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.DeploymentsClientListOptions{Filter: 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.DeploymentListResult = armapicenter.DeploymentListResult{ // Value: []*armapicenter.Deployment{ // { // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.DeploymentProperties{ // Description: to.Ptr("Public cloud production deployment."), // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), // Server: &armapicenter.DeploymentServer{ // RuntimeURI: []*string{ // to.Ptr("https://api.contoso.com")}, // }, // State: to.Ptr(armapicenter.DeploymentStateActive), // Title: to.Ptr("Development"), // }, // }}, // } } }
Output:
type DeploymentsClientCreateOrUpdateOptions ¶ added in v1.0.0
type DeploymentsClientCreateOrUpdateOptions struct { }
DeploymentsClientCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.CreateOrUpdate method.
type DeploymentsClientCreateOrUpdateResponse ¶ added in v1.0.0
type DeploymentsClientCreateOrUpdateResponse struct { // API deployment entity. Deployment // ETag contains the information returned from the ETag header response. ETag *string }
DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.CreateOrUpdate.
type DeploymentsClientDeleteOptions ¶ added in v1.0.0
type DeploymentsClientDeleteOptions struct { }
DeploymentsClientDeleteOptions contains the optional parameters for the DeploymentsClient.Delete method.
type DeploymentsClientDeleteResponse ¶ added in v1.0.0
type DeploymentsClientDeleteResponse struct { }
DeploymentsClientDeleteResponse contains the response from method DeploymentsClient.Delete.
type DeploymentsClientGetOptions ¶ added in v1.0.0
type DeploymentsClientGetOptions struct { }
DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method.
type DeploymentsClientGetResponse ¶ added in v1.0.0
type DeploymentsClientGetResponse struct { // API deployment entity. Deployment // ETag contains the information returned from the ETag header response. ETag *string }
DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get.
type DeploymentsClientHeadOptions ¶ added in v1.0.0
type DeploymentsClientHeadOptions struct { }
DeploymentsClientHeadOptions contains the optional parameters for the DeploymentsClient.Head method.
type DeploymentsClientHeadResponse ¶ added in v1.0.0
type DeploymentsClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
DeploymentsClientHeadResponse contains the response from method DeploymentsClient.Head.
type DeploymentsClientListOptions ¶ added in v1.0.0
type DeploymentsClientListOptions struct { // OData filter parameter. Filter *string }
DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method.
type DeploymentsClientListResponse ¶ added in v1.0.0
type DeploymentsClientListResponse struct { // The response of a Deployment list operation. DeploymentListResult }
DeploymentsClientListResponse contains the response from method DeploymentsClient.NewListPager.
type Environment ¶ added in v1.0.0
type Environment struct { // The resource-specific properties for this resource. Properties *EnvironmentProperties // 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 }
Environment entity.
func (Environment) MarshalJSON ¶ added in v1.0.0
func (e Environment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Environment.
func (*Environment) UnmarshalJSON ¶ added in v1.0.0
func (e *Environment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Environment.
type EnvironmentKind ¶ added in v1.0.0
type EnvironmentKind string
EnvironmentKind - The kind of environment
const ( // EnvironmentKindDevelopment - Development environment EnvironmentKindDevelopment EnvironmentKind = "development" // EnvironmentKindProduction - Production environment EnvironmentKindProduction EnvironmentKind = "production" // EnvironmentKindStaging - Staging environment EnvironmentKindStaging EnvironmentKind = "staging" // EnvironmentKindTesting - Testing environment EnvironmentKindTesting EnvironmentKind = "testing" )
func PossibleEnvironmentKindValues ¶ added in v1.0.0
func PossibleEnvironmentKindValues() []EnvironmentKind
PossibleEnvironmentKindValues returns the possible values for the EnvironmentKind const type.
type EnvironmentListResult ¶ added in v1.0.0
type EnvironmentListResult struct { // READ-ONLY; The Environment items on this page Value []*Environment // READ-ONLY; The link to the next page of items NextLink *string }
EnvironmentListResult - The response of a Environment list operation.
func (EnvironmentListResult) MarshalJSON ¶ added in v1.0.0
func (e EnvironmentListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnvironmentListResult.
func (*EnvironmentListResult) UnmarshalJSON ¶ added in v1.0.0
func (e *EnvironmentListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentListResult.
type EnvironmentProperties ¶ added in v1.0.0
type EnvironmentProperties struct { // REQUIRED; Environment kind. Kind *EnvironmentKind // REQUIRED; Environment title. Title *string // The custom metadata defined for API catalog entities. CustomProperties any // The environment description. Description *string // Environment onboarding information Onboarding *Onboarding // Server information of the environment. Server *EnvironmentServer }
EnvironmentProperties - Environment properties entity.
func (EnvironmentProperties) MarshalJSON ¶ added in v1.0.0
func (e EnvironmentProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnvironmentProperties.
func (*EnvironmentProperties) UnmarshalJSON ¶ added in v1.0.0
func (e *EnvironmentProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentProperties.
type EnvironmentServer ¶ added in v1.0.0
type EnvironmentServer struct { // The location of the management portal ManagementPortalURI []*string // Type of the server that represents the environment. Type *EnvironmentServerType }
EnvironmentServer - Server information of the environment.
func (EnvironmentServer) MarshalJSON ¶ added in v1.0.0
func (e EnvironmentServer) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EnvironmentServer.
func (*EnvironmentServer) UnmarshalJSON ¶ added in v1.0.0
func (e *EnvironmentServer) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentServer.
type EnvironmentServerType ¶ added in v1.0.0
type EnvironmentServerType string
EnvironmentServerType - The type of environment server
const ( // EnvironmentServerTypeAWSAPIGateway - AWS Api Gateway server EnvironmentServerTypeAWSAPIGateway EnvironmentServerType = "AWS API Gateway" // EnvironmentServerTypeApigeeAPIManagement - Apigee server EnvironmentServerTypeApigeeAPIManagement EnvironmentServerType = "Apigee API Management" // EnvironmentServerTypeAzureAPIManagement - Api Management Server EnvironmentServerTypeAzureAPIManagement EnvironmentServerType = "Azure API Management" // EnvironmentServerTypeAzureComputeService - Compute server EnvironmentServerTypeAzureComputeService EnvironmentServerType = "Azure compute service" // EnvironmentServerTypeKongAPIGateway - Kong API Gateway server EnvironmentServerTypeKongAPIGateway EnvironmentServerType = "Kong API Gateway" // EnvironmentServerTypeKubernetes - Kubernetes server EnvironmentServerTypeKubernetes EnvironmentServerType = "Kubernetes" // EnvironmentServerTypeMuleSoftAPIManagement - Mulesoft Api Management server EnvironmentServerTypeMuleSoftAPIManagement EnvironmentServerType = "MuleSoft API Management" )
func PossibleEnvironmentServerTypeValues ¶ added in v1.0.0
func PossibleEnvironmentServerTypeValues() []EnvironmentServerType
PossibleEnvironmentServerTypeValues returns the possible values for the EnvironmentServerType const type.
type EnvironmentsClient ¶ added in v1.0.0
type EnvironmentsClient struct {
// contains filtered or unexported fields
}
EnvironmentsClient contains the methods for the Environments group. Don't use this type directly, use NewEnvironmentsClient() instead.
func NewEnvironmentsClient ¶ added in v1.0.0
func NewEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EnvironmentsClient, error)
NewEnvironmentsClient creates a new instance of EnvironmentsClient 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 (*EnvironmentsClient) CreateOrUpdate ¶ added in v1.0.0
func (client *EnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, resource Environment, options *EnvironmentsClientCreateOrUpdateOptions) (EnvironmentsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing environment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- environmentName - The name of the environment.
- resource - Resource create parameters.
- options - EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEnvironmentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "public", armapicenter.Environment{}, 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.Environment = armapicenter.Environment{ // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/environments"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.EnvironmentProperties{ // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), // Onboarding: &armapicenter.Onboarding{ // DeveloperPortalURI: []*string{ // to.Ptr("https://developer.contoso.com")}, // Instructions: to.Ptr("Sign in or sign up in the specified developer portal to request API access. You must complete the internal privacy training for your account to be approved."), // }, // Server: &armapicenter.EnvironmentServer{ // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), // ManagementPortalURI: []*string{ // to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso")}, // }, // Title: to.Ptr("Contoso Europe Azure API Management"), // }, // } }
Output:
func (*EnvironmentsClient) Delete ¶ added in v1.0.0
func (client *EnvironmentsClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientDeleteOptions) (EnvironmentsClientDeleteResponse, error)
Delete - Deletes the environment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- environmentName - The name of the environment.
- options - EnvironmentsClientDeleteOptions contains the optional parameters for the EnvironmentsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewEnvironmentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "public", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*EnvironmentsClient) Get ¶ added in v1.0.0
func (client *EnvironmentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientGetOptions) (EnvironmentsClientGetResponse, error)
Get - Returns details of the environment. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- environmentName - The name of the environment.
- options - EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEnvironmentsClient().Get(ctx, "contoso-resources", "contoso", "default", "public", 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.Environment = armapicenter.Environment{ // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.EnvironmentProperties{ // CustomProperties: map[string]any{ // }, // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), // Onboarding: &armapicenter.Onboarding{ // DeveloperPortalURI: []*string{ // }, // }, // Server: &armapicenter.EnvironmentServer{ // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), // ManagementPortalURI: []*string{ // }, // }, // Title: to.Ptr("Public"), // }, // } }
Output:
func (*EnvironmentsClient) Head ¶ added in v1.0.0
func (client *EnvironmentsClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, environmentName string, options *EnvironmentsClientHeadOptions) (EnvironmentsClientHeadResponse, error)
Head - Checks if specified environment exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- environmentName - The name of the environment.
- options - EnvironmentsClientHeadOptions contains the optional parameters for the EnvironmentsClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewEnvironmentsClient().Head(ctx, "contoso-resources", "contoso", "default", "public", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*EnvironmentsClient) NewListPager ¶ added in v1.0.0
func (client *EnvironmentsClient) NewListPager(resourceGroupName string, serviceName string, workspaceName string, options *EnvironmentsClientListOptions) *runtime.Pager[EnvironmentsClientListResponse]
NewListPager - Returns a collection of environments.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- options - EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewEnvironmentsClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.EnvironmentsClientListOptions{Filter: 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.EnvironmentListResult = armapicenter.EnvironmentListResult{ // Value: []*armapicenter.Environment{ // { // Name: to.Ptr("public"), // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.EnvironmentProperties{ // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), // CustomProperties: map[string]any{ // }, // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), // Onboarding: &armapicenter.Onboarding{ // DeveloperPortalURI: []*string{ // }, // }, // Server: &armapicenter.EnvironmentServer{ // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), // ManagementPortalURI: []*string{ // }, // }, // Title: to.Ptr("Contoso Europe Azure API Management"), // }, // }}, // } } }
Output:
type EnvironmentsClientCreateOrUpdateOptions ¶ added in v1.0.0
type EnvironmentsClientCreateOrUpdateOptions struct { }
EnvironmentsClientCreateOrUpdateOptions contains the optional parameters for the EnvironmentsClient.CreateOrUpdate method.
type EnvironmentsClientCreateOrUpdateResponse ¶ added in v1.0.0
type EnvironmentsClientCreateOrUpdateResponse struct { // Environment entity. Environment // ETag contains the information returned from the ETag header response. ETag *string }
EnvironmentsClientCreateOrUpdateResponse contains the response from method EnvironmentsClient.CreateOrUpdate.
type EnvironmentsClientDeleteOptions ¶ added in v1.0.0
type EnvironmentsClientDeleteOptions struct { }
EnvironmentsClientDeleteOptions contains the optional parameters for the EnvironmentsClient.Delete method.
type EnvironmentsClientDeleteResponse ¶ added in v1.0.0
type EnvironmentsClientDeleteResponse struct { }
EnvironmentsClientDeleteResponse contains the response from method EnvironmentsClient.Delete.
type EnvironmentsClientGetOptions ¶ added in v1.0.0
type EnvironmentsClientGetOptions struct { }
EnvironmentsClientGetOptions contains the optional parameters for the EnvironmentsClient.Get method.
type EnvironmentsClientGetResponse ¶ added in v1.0.0
type EnvironmentsClientGetResponse struct { // Environment entity. Environment // ETag contains the information returned from the ETag header response. ETag *string }
EnvironmentsClientGetResponse contains the response from method EnvironmentsClient.Get.
type EnvironmentsClientHeadOptions ¶ added in v1.0.0
type EnvironmentsClientHeadOptions struct { }
EnvironmentsClientHeadOptions contains the optional parameters for the EnvironmentsClient.Head method.
type EnvironmentsClientHeadResponse ¶ added in v1.0.0
type EnvironmentsClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
EnvironmentsClientHeadResponse contains the response from method EnvironmentsClient.Head.
type EnvironmentsClientListOptions ¶ added in v1.0.0
type EnvironmentsClientListOptions struct { // OData filter parameter. Filter *string }
EnvironmentsClientListOptions contains the optional parameters for the EnvironmentsClient.NewListPager method.
type EnvironmentsClientListResponse ¶ added in v1.0.0
type EnvironmentsClientListResponse struct { // The response of a Environment list operation. EnvironmentListResult }
EnvironmentsClientListResponse contains the response from method EnvironmentsClient.NewListPager.
type ExternalDocumentation ¶ added in v1.0.0
type ExternalDocumentation struct { // REQUIRED; URL pointing to the documentation. URL *string // Description of the documentation. Description *string // Title of the documentation. Title *string }
ExternalDocumentation - Additional, external documentation for the API.
func (ExternalDocumentation) MarshalJSON ¶ added in v1.0.0
func (e ExternalDocumentation) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ExternalDocumentation.
func (*ExternalDocumentation) UnmarshalJSON ¶ added in v1.0.0
func (e *ExternalDocumentation) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ExternalDocumentation.
type License ¶ added in v1.0.0
type License struct { // SPDX license information for the API. The identifier field is mutually exclusive of the URL field. Identifier *string // Name of the license. Name *string // URL pointing to the license details. The URL field is mutually exclusive of the identifier field. URL *string }
License - The license information for the API.
func (License) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type License.
func (*License) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type License.
type LifecycleStage ¶ added in v1.0.0
type LifecycleStage string
LifecycleStage - The stage of the Api development lifecycle
const ( // LifecycleStageDeprecated - deprecated stage LifecycleStageDeprecated LifecycleStage = "deprecated" // LifecycleStageDesign - design stage LifecycleStageDesign LifecycleStage = "design" // LifecycleStageDevelopment - development stage LifecycleStageDevelopment LifecycleStage = "development" // LifecycleStagePreview - In preview LifecycleStagePreview LifecycleStage = "preview" // LifecycleStageProduction - In production LifecycleStageProduction LifecycleStage = "production" // LifecycleStageRetired - Retired stage LifecycleStageRetired LifecycleStage = "retired" // LifecycleStageTesting - testing stage LifecycleStageTesting LifecycleStage = "testing" )
func PossibleLifecycleStageValues ¶ added in v1.0.0
func PossibleLifecycleStageValues() []LifecycleStage
PossibleLifecycleStageValues returns the possible values for the LifecycleStage const type.
type ManagedServiceIdentity ¶
type ManagedServiceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). Type *ManagedServiceIdentityType // The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM // resource ids in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. // The dictionary values can be empty objects ({}) in // requests. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned // identity. PrincipalID *string // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string }
ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities)
func (ManagedServiceIdentity) MarshalJSON ¶
func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity.
func (*ManagedServiceIdentity) UnmarshalJSON ¶
func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity.
type ManagedServiceIdentityType ¶
type ManagedServiceIdentityType string
ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
const ( ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" )
func PossibleManagedServiceIdentityTypeValues ¶
func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType
PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type.
type MetadataAssignment ¶ added in v1.0.0
type MetadataAssignment struct { // Deprecated assignment Deprecated *bool // The entities this metadata schema component gets applied to. Entity *MetadataAssignmentEntity // Required assignment Required *bool }
MetadataAssignment - Assignment metadata
func (MetadataAssignment) MarshalJSON ¶ added in v1.0.0
func (m MetadataAssignment) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataAssignment.
func (*MetadataAssignment) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataAssignment) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataAssignment.
type MetadataAssignmentEntity ¶ added in v1.0.0
type MetadataAssignmentEntity string
MetadataAssignmentEntity - Assignment entity for Metadata
const ( // MetadataAssignmentEntityAPI - Assigned to API MetadataAssignmentEntityAPI MetadataAssignmentEntity = "api" // MetadataAssignmentEntityDeployment - Assigned to Deployment MetadataAssignmentEntityDeployment MetadataAssignmentEntity = "deployment" // MetadataAssignmentEntityEnvironment - Assigned to Environment MetadataAssignmentEntityEnvironment MetadataAssignmentEntity = "environment" )
func PossibleMetadataAssignmentEntityValues ¶ added in v1.0.0
func PossibleMetadataAssignmentEntityValues() []MetadataAssignmentEntity
PossibleMetadataAssignmentEntityValues returns the possible values for the MetadataAssignmentEntity const type.
type MetadataSchema ¶ added in v1.0.0
type MetadataSchema struct { // The resource-specific properties for this resource. Properties *MetadataSchemaProperties // 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 }
MetadataSchema - Metadata schema entity. Used to define metadata for the entities in API catalog.
func (MetadataSchema) MarshalJSON ¶ added in v1.0.0
func (m MetadataSchema) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataSchema.
func (*MetadataSchema) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataSchema) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchema.
type MetadataSchemaExportFormat ¶ added in v1.0.0
type MetadataSchemaExportFormat string
MetadataSchemaExportFormat - The format for schema export
const ( // MetadataSchemaExportFormatInline - The inlined content of a schema document. MetadataSchemaExportFormatInline MetadataSchemaExportFormat = "inline" // MetadataSchemaExportFormatLink - The link to a schema document. The URL is valid for 5 minutes. MetadataSchemaExportFormatLink MetadataSchemaExportFormat = "link" )
func PossibleMetadataSchemaExportFormatValues ¶ added in v1.0.0
func PossibleMetadataSchemaExportFormatValues() []MetadataSchemaExportFormat
PossibleMetadataSchemaExportFormatValues returns the possible values for the MetadataSchemaExportFormat const type.
type MetadataSchemaExportRequest ¶ added in v1.0.0
type MetadataSchemaExportRequest struct { // An entity the metadata schema is requested for. AssignedTo *MetadataAssignmentEntity }
MetadataSchemaExportRequest - The metadata schema export request.
func (MetadataSchemaExportRequest) MarshalJSON ¶ added in v1.0.0
func (m MetadataSchemaExportRequest) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataSchemaExportRequest.
func (*MetadataSchemaExportRequest) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataSchemaExportRequest) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaExportRequest.
type MetadataSchemaExportResult ¶ added in v1.0.0
type MetadataSchemaExportResult struct { // The export format for the schema Format *MetadataSchemaExportFormat // The result of the export operation. Value *string }
MetadataSchemaExportResult - The metadata schema export result.
func (MetadataSchemaExportResult) MarshalJSON ¶ added in v1.0.0
func (m MetadataSchemaExportResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataSchemaExportResult.
func (*MetadataSchemaExportResult) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataSchemaExportResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaExportResult.
type MetadataSchemaListResult ¶ added in v1.0.0
type MetadataSchemaListResult struct { // READ-ONLY; The MetadataSchema items on this page Value []*MetadataSchema // READ-ONLY; The link to the next page of items NextLink *string }
MetadataSchemaListResult - The response of a MetadataSchema list operation.
func (MetadataSchemaListResult) MarshalJSON ¶ added in v1.0.0
func (m MetadataSchemaListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataSchemaListResult.
func (*MetadataSchemaListResult) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataSchemaListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaListResult.
type MetadataSchemaProperties ¶ added in v1.0.0
type MetadataSchemaProperties struct { // REQUIRED; The schema defining the type. Schema *string // The assignees AssignedTo []*MetadataAssignment }
MetadataSchemaProperties - Metadata schema properties.
func (MetadataSchemaProperties) MarshalJSON ¶ added in v1.0.0
func (m MetadataSchemaProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MetadataSchemaProperties.
func (*MetadataSchemaProperties) UnmarshalJSON ¶ added in v1.0.0
func (m *MetadataSchemaProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MetadataSchemaProperties.
type MetadataSchemasClient ¶ added in v1.0.0
type MetadataSchemasClient struct {
// contains filtered or unexported fields
}
MetadataSchemasClient contains the methods for the MetadataSchemas group. Don't use this type directly, use NewMetadataSchemasClient() instead.
func NewMetadataSchemasClient ¶ added in v1.0.0
func NewMetadataSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetadataSchemasClient, error)
NewMetadataSchemasClient creates a new instance of MetadataSchemasClient 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 (*MetadataSchemasClient) CreateOrUpdate ¶ added in v1.0.0
func (client *MetadataSchemasClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, resource MetadataSchema, options *MetadataSchemasClientCreateOrUpdateOptions) (MetadataSchemasClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing metadata schema. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- metadataSchemaName - The name of the metadata schema.
- resource - Resource create parameters.
- options - MetadataSchemasClientCreateOrUpdateOptions contains the optional parameters for the MetadataSchemasClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetadataSchemasClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "author", armapicenter.MetadataSchema{}, 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.MetadataSchema = armapicenter.MetadataSchema{ // Name: to.Ptr("author"), // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.MetadataSchemaProperties{ // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), // AssignedTo: []*armapicenter.MetadataAssignment{ // { // Deprecated: to.Ptr(true), // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), // }}, // }, // } }
Output:
func (*MetadataSchemasClient) Delete ¶ added in v1.0.0
func (client *MetadataSchemasClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientDeleteOptions) (MetadataSchemasClientDeleteResponse, error)
Delete - Deletes specified metadata schema. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- metadataSchemaName - The name of the metadata schema.
- options - MetadataSchemasClientDeleteOptions contains the optional parameters for the MetadataSchemasClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewMetadataSchemasClient().Delete(ctx, "contoso-resources", "contoso", "author", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*MetadataSchemasClient) Get ¶ added in v1.0.0
func (client *MetadataSchemasClient) Get(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientGetOptions) (MetadataSchemasClientGetResponse, error)
Get - Returns details of the metadata schema. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- metadataSchemaName - The name of the metadata schema.
- options - MetadataSchemasClientGetOptions contains the optional parameters for the MetadataSchemasClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewMetadataSchemasClient().Get(ctx, "contoso-resources", "contoso", "lastName", 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.MetadataSchema = armapicenter.MetadataSchema{ // Name: to.Ptr("author"), // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.MetadataSchemaProperties{ // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), // AssignedTo: []*armapicenter.MetadataAssignment{ // { // Deprecated: to.Ptr(true), // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), // }}, // }, // } }
Output:
func (*MetadataSchemasClient) Head ¶ added in v1.0.0
func (client *MetadataSchemasClient) Head(ctx context.Context, resourceGroupName string, serviceName string, metadataSchemaName string, options *MetadataSchemasClientHeadOptions) (MetadataSchemasClientHeadResponse, error)
Head - Checks if specified metadata schema exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- metadataSchemaName - The name of the metadata schema.
- options - MetadataSchemasClientHeadOptions contains the optional parameters for the MetadataSchemasClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewMetadataSchemasClient().Head(ctx, "contoso-resources", "contoso", "author", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*MetadataSchemasClient) NewListPager ¶ added in v1.0.0
func (client *MetadataSchemasClient) NewListPager(resourceGroupName string, serviceName string, options *MetadataSchemasClientListOptions) *runtime.Pager[MetadataSchemasClientListResponse]
NewListPager - Returns a collection of metadata schemas.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- options - MetadataSchemasClientListOptions contains the optional parameters for the MetadataSchemasClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewMetadataSchemasClient().NewListPager("contoso-resources", "contoso", &armapicenter.MetadataSchemasClientListOptions{Filter: 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.MetadataSchemaListResult = armapicenter.MetadataSchemaListResult{ // Value: []*armapicenter.MetadataSchema{ // { // Name: to.Ptr("author"), // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.MetadataSchemaProperties{ // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), // AssignedTo: []*armapicenter.MetadataAssignment{ // { // Deprecated: to.Ptr(true), // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), // }}, // }, // }}, // } } }
Output:
type MetadataSchemasClientCreateOrUpdateOptions ¶ added in v1.0.0
type MetadataSchemasClientCreateOrUpdateOptions struct { }
MetadataSchemasClientCreateOrUpdateOptions contains the optional parameters for the MetadataSchemasClient.CreateOrUpdate method.
type MetadataSchemasClientCreateOrUpdateResponse ¶ added in v1.0.0
type MetadataSchemasClientCreateOrUpdateResponse struct { // Metadata schema entity. Used to define metadata for the entities in API catalog. MetadataSchema // ETag contains the information returned from the ETag header response. ETag *string }
MetadataSchemasClientCreateOrUpdateResponse contains the response from method MetadataSchemasClient.CreateOrUpdate.
type MetadataSchemasClientDeleteOptions ¶ added in v1.0.0
type MetadataSchemasClientDeleteOptions struct { }
MetadataSchemasClientDeleteOptions contains the optional parameters for the MetadataSchemasClient.Delete method.
type MetadataSchemasClientDeleteResponse ¶ added in v1.0.0
type MetadataSchemasClientDeleteResponse struct { }
MetadataSchemasClientDeleteResponse contains the response from method MetadataSchemasClient.Delete.
type MetadataSchemasClientGetOptions ¶ added in v1.0.0
type MetadataSchemasClientGetOptions struct { }
MetadataSchemasClientGetOptions contains the optional parameters for the MetadataSchemasClient.Get method.
type MetadataSchemasClientGetResponse ¶ added in v1.0.0
type MetadataSchemasClientGetResponse struct { // Metadata schema entity. Used to define metadata for the entities in API catalog. MetadataSchema // ETag contains the information returned from the ETag header response. ETag *string }
MetadataSchemasClientGetResponse contains the response from method MetadataSchemasClient.Get.
type MetadataSchemasClientHeadOptions ¶ added in v1.0.0
type MetadataSchemasClientHeadOptions struct { }
MetadataSchemasClientHeadOptions contains the optional parameters for the MetadataSchemasClient.Head method.
type MetadataSchemasClientHeadResponse ¶ added in v1.0.0
type MetadataSchemasClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
MetadataSchemasClientHeadResponse contains the response from method MetadataSchemasClient.Head.
type MetadataSchemasClientListOptions ¶ added in v1.0.0
type MetadataSchemasClientListOptions struct { // OData filter parameter. Filter *string }
MetadataSchemasClientListOptions contains the optional parameters for the MetadataSchemasClient.NewListPager method.
type MetadataSchemasClientListResponse ¶ added in v1.0.0
type MetadataSchemasClientListResponse struct { // The response of a MetadataSchema list operation. MetadataSchemaListResult }
MetadataSchemasClientListResponse contains the response from method MetadataSchemasClient.NewListPager.
type Onboarding ¶ added in v1.0.0
type Onboarding struct { // The location of the development portal DeveloperPortalURI []*string // Onboarding guide. Instructions *string }
Onboarding information
func (Onboarding) MarshalJSON ¶ added in v1.0.0
func (o Onboarding) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type Onboarding.
func (*Onboarding) UnmarshalJSON ¶ added in v1.0.0
func (o *Onboarding) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type Onboarding.
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) NewListPager ¶
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List the operations for the provider
Generated from API version 2024-03-01
- options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Operations_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewOperationsClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.OperationListResult = armapicenter.OperationListResult{ // Value: []*armapicenter.Operation{ // { // Name: to.Ptr("Microsoft.ApiCenter/services/read"), // Display: &armapicenter.OperationDisplay{ // Description: to.Ptr("Lists registered services"), // Operation: to.Ptr("Lists services"), // Provider: to.Ptr("Microsoft.ApiCenter"), // Resource: to.Ptr("services"), // }, // IsDataAction: to.Ptr(false), // }}, // } } }
Output:
type OperationsClientListOptions ¶
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager 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.NewListPager.
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 ProvisioningState ¶
type ProvisioningState string
ProvisioningState - The provisioning state of the resource
const ( // ProvisioningStateCanceled - Resource creation was canceled. ProvisioningStateCanceled ProvisioningState = "Canceled" // ProvisioningStateFailed - Resource creation failed. ProvisioningStateFailed ProvisioningState = "Failed" // ProvisioningStateSucceeded - Resource has been created. ProvisioningStateSucceeded ProvisioningState = "Succeeded" )
func PossibleProvisioningStateValues ¶
func PossibleProvisioningStateValues() []ProvisioningState
PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.
type Service ¶
type Service struct { // REQUIRED; The geo-location where the resource lives Location *string // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity // The resource-specific properties for this resource. Properties *ServiceProperties // 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 }
Service - The service entity.
func (Service) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Service.
func (*Service) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Service.
type ServiceListResult ¶ added in v1.0.0
type ServiceListResult struct { // READ-ONLY; The Service items on this page Value []*Service // READ-ONLY; The link to the next page of items NextLink *string }
ServiceListResult - The response of a Service list operation.
func (ServiceListResult) MarshalJSON ¶ added in v1.0.0
func (s ServiceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceListResult.
func (*ServiceListResult) UnmarshalJSON ¶ added in v1.0.0
func (s *ServiceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult.
type ServiceProperties ¶
type ServiceProperties struct { // READ-ONLY; Provisioning state of the service. ProvisioningState *ProvisioningState }
ServiceProperties - The properties of the service.
func (ServiceProperties) MarshalJSON ¶
func (s ServiceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceProperties.
func (*ServiceProperties) UnmarshalJSON ¶
func (s *ServiceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.
type ServiceUpdate ¶
type ServiceUpdate struct { // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity // Resource tags. Tags map[string]*string }
ServiceUpdate - The type used for update operations of the Service.
func (ServiceUpdate) MarshalJSON ¶
func (s ServiceUpdate) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ServiceUpdate.
func (*ServiceUpdate) UnmarshalJSON ¶
func (s *ServiceUpdate) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdate.
type ServicesClient ¶
type ServicesClient struct {
// contains filtered or unexported fields
}
ServicesClient contains the methods for the Services group. Don't use this type directly, use NewServicesClient() instead.
func NewServicesClient ¶
func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error)
NewServicesClient creates a new instance of ServicesClient 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 (*ServicesClient) BeginExportMetadataSchema ¶ added in v1.0.0
func (client *ServicesClient) BeginExportMetadataSchema(ctx context.Context, resourceGroupName string, serviceName string, body MetadataSchemaExportRequest, options *ServicesClientBeginExportMetadataSchemaOptions) (*runtime.Poller[ServicesClientExportMetadataSchemaResponse], error)
BeginExportMetadataSchema - Exports the effective metadata schema. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- body - The content of the action request
- options - ServicesClientBeginExportMetadataSchemaOptions contains the optional parameters for the ServicesClient.BeginExportMetadataSchema method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ExportMetadataSchema.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewServicesClient().BeginExportMetadataSchema(ctx, "contoso-resources", "contoso", armapicenter.MetadataSchemaExportRequest{}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.MetadataSchemaExportResult = armapicenter.MetadataSchemaExportResult{ // Format: to.Ptr(armapicenter.MetadataSchemaExportFormat("json-schema")), // Value: to.Ptr("{\"type\":\"object\",\"properties\":{ ... }}"), // } }
Output:
func (*ServicesClient) CreateOrUpdate ¶
func (client *ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource Service, options *ServicesClientCreateOrUpdateOptions) (ServicesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing API. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- resource - Resource create parameters.
- options - ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServicesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", armapicenter.Service{ Location: to.Ptr("East US"), Tags: map[string]*string{}, Identity: &armapicenter.ManagedServiceIdentity{ Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}, }, }, Properties: &armapicenter.ServiceProperties{}, }, 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.Service = armapicenter.Service{ // Name: to.Ptr("contoso"), // Type: to.Ptr("Microsoft.ApiCenter/services"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // }, // Identity: &armapicenter.ManagedServiceIdentity{ // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // }, // }, // Properties: &armapicenter.ServiceProperties{ // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), // }, // } }
Output:
func (*ServicesClient) Delete ¶
func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientDeleteOptions) (ServicesClientDeleteResponse, error)
Delete - Deletes specified service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewServicesClient().Delete(ctx, "contoso-resources", "contoso", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*ServicesClient) Get ¶
func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error)
Get - Returns details of the service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServicesClient().Get(ctx, "contoso-resources", "contoso", 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.Service = armapicenter.Service{ // Name: to.Ptr("contoso"), // Type: to.Ptr("Microsoft.ApiCenter/services"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // }, // Identity: &armapicenter.ManagedServiceIdentity{ // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // }, // }, // Properties: &armapicenter.ServiceProperties{ // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), // }, // } }
Output:
func (*ServicesClient) NewListByResourceGroupPager ¶
func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName string, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Returns a collection of services within the resource group.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("contoso-resources", 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.ServiceListResult = armapicenter.ServiceListResult{ // Value: []*armapicenter.Service{ // { // Name: to.Ptr("contoso"), // Type: to.Ptr("Microsoft.ApiCenter/services"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // }, // Identity: &armapicenter.ManagedServiceIdentity{ // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // }, // }, // Properties: &armapicenter.ServiceProperties{ // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), // }, // }}, // } } }
Output:
func (*ServicesClient) NewListBySubscriptionPager ¶
func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists services within an Azure subscription.
Generated from API version 2024-03-01
- options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ListBySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ServiceListResult = armapicenter.ServiceListResult{ // Value: []*armapicenter.Service{ // { // Name: to.Ptr("contoso"), // Type: to.Ptr("Microsoft.ApiCenter/services"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // }, // Identity: &armapicenter.ManagedServiceIdentity{ // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // }, // }, // Properties: &armapicenter.ServiceProperties{ // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), // }, // }}, // } } }
Output:
func (*ServicesClient) Update ¶
func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, serviceName string, properties ServiceUpdate, options *ServicesClientUpdateOptions) (ServicesClientUpdateResponse, error)
Update - Updates existing service. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- properties - The resource properties to be updated.
- options - ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Update.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewServicesClient().Update(ctx, "contoso-resources", "contoso", armapicenter.ServiceUpdate{}, 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.Service = armapicenter.Service{ // Name: to.Ptr("contoso"), // Type: to.Ptr("Microsoft.ApiCenter/services"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), // Location: to.Ptr("East US"), // Tags: map[string]*string{ // }, // Identity: &armapicenter.ManagedServiceIdentity{ // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), // }, // }, // }, // Properties: &armapicenter.ServiceProperties{ // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), // }, // } }
Output:
type ServicesClientBeginExportMetadataSchemaOptions ¶ added in v1.0.0
type ServicesClientBeginExportMetadataSchemaOptions struct { // Resumes the LRO from the provided token. ResumeToken string }
ServicesClientBeginExportMetadataSchemaOptions contains the optional parameters for the ServicesClient.BeginExportMetadataSchema method.
type ServicesClientCreateOrUpdateOptions ¶
type ServicesClientCreateOrUpdateOptions struct { }
ServicesClientCreateOrUpdateOptions contains the optional parameters for the ServicesClient.CreateOrUpdate method.
type ServicesClientCreateOrUpdateResponse ¶
type ServicesClientCreateOrUpdateResponse struct { // The service entity. Service }
ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate.
type ServicesClientDeleteOptions ¶
type ServicesClientDeleteOptions struct { }
ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.
type ServicesClientDeleteResponse ¶
type ServicesClientDeleteResponse struct { }
ServicesClientDeleteResponse contains the response from method ServicesClient.Delete.
type ServicesClientExportMetadataSchemaResponse ¶ added in v1.0.0
type ServicesClientExportMetadataSchemaResponse struct { // The metadata schema export result. MetadataSchemaExportResult }
ServicesClientExportMetadataSchemaResponse contains the response from method ServicesClient.BeginExportMetadataSchema.
type ServicesClientGetOptions ¶
type ServicesClientGetOptions struct { }
ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.
type ServicesClientGetResponse ¶
type ServicesClientGetResponse struct { // The service entity. Service }
ServicesClientGetResponse contains the response from method ServicesClient.Get.
type ServicesClientListByResourceGroupOptions ¶
type ServicesClientListByResourceGroupOptions struct { }
ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.
type ServicesClientListByResourceGroupResponse ¶
type ServicesClientListByResourceGroupResponse struct { // The response of a Service list operation. ServiceListResult }
ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager.
type ServicesClientListBySubscriptionOptions ¶
type ServicesClientListBySubscriptionOptions struct { }
ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.
type ServicesClientListBySubscriptionResponse ¶
type ServicesClientListBySubscriptionResponse struct { // The response of a Service list operation. ServiceListResult }
ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager.
type ServicesClientUpdateOptions ¶
type ServicesClientUpdateOptions struct { }
ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.
type ServicesClientUpdateResponse ¶
type ServicesClientUpdateResponse struct { // The service entity. Service }
ServicesClientUpdateResponse contains the response from method ServicesClient.Update.
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 TermsOfService ¶ added in v1.0.0
type TermsOfService struct { // REQUIRED; URL pointing to the terms of service. URL *string }
TermsOfService - Terms of service for the API.
func (TermsOfService) MarshalJSON ¶ added in v1.0.0
func (t TermsOfService) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TermsOfService.
func (*TermsOfService) UnmarshalJSON ¶ added in v1.0.0
func (t *TermsOfService) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TermsOfService.
type UserAssignedIdentity ¶
type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. ClientID *string // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string }
UserAssignedIdentity - User assigned identity properties
func (UserAssignedIdentity) MarshalJSON ¶
func (u UserAssignedIdentity) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity.
func (*UserAssignedIdentity) UnmarshalJSON ¶
func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity.
type Workspace ¶ added in v1.0.0
type Workspace struct { // The resource-specific properties for this resource. Properties *WorkspaceProperties // 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 }
Workspace entity.
func (Workspace) MarshalJSON ¶ added in v1.0.0
MarshalJSON implements the json.Marshaller interface for type Workspace.
func (*Workspace) UnmarshalJSON ¶ added in v1.0.0
UnmarshalJSON implements the json.Unmarshaller interface for type Workspace.
type WorkspaceListResult ¶ added in v1.0.0
type WorkspaceListResult struct { // READ-ONLY; The Workspace items on this page Value []*Workspace // READ-ONLY; The link to the next page of items NextLink *string }
WorkspaceListResult - The response of a Workspace list operation.
func (WorkspaceListResult) MarshalJSON ¶ added in v1.0.0
func (w WorkspaceListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkspaceListResult.
func (*WorkspaceListResult) UnmarshalJSON ¶ added in v1.0.0
func (w *WorkspaceListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceListResult.
type WorkspaceProperties ¶ added in v1.0.0
type WorkspaceProperties struct { // REQUIRED; Workspace title. Title *string // Workspace description. Description *string }
WorkspaceProperties - Workspace properties.
func (WorkspaceProperties) MarshalJSON ¶ added in v1.0.0
func (w WorkspaceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties.
func (*WorkspaceProperties) UnmarshalJSON ¶ added in v1.0.0
func (w *WorkspaceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type WorkspaceProperties.
type WorkspacesClient ¶ added in v1.0.0
type WorkspacesClient struct {
// contains filtered or unexported fields
}
WorkspacesClient contains the methods for the Workspaces group. Don't use this type directly, use NewWorkspacesClient() instead.
func NewWorkspacesClient ¶ added in v1.0.0
func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error)
NewWorkspacesClient creates a new instance of WorkspacesClient 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 (*WorkspacesClient) CreateOrUpdate ¶ added in v1.0.0
func (client *WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, resource Workspace, options *WorkspacesClientCreateOrUpdateOptions) (WorkspacesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Creates new or updates existing workspace. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- resource - Resource create parameters.
- options - WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_CreateOrUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", armapicenter.Workspace{}, 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.Workspace = armapicenter.Workspace{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.WorkspaceProperties{ // Title: to.Ptr("default"), // }, // } }
Output:
func (*WorkspacesClient) Delete ¶ added in v1.0.0
func (client *WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientDeleteOptions) (WorkspacesClientDeleteResponse, error)
Delete - Deletes specified workspace. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- options - WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewWorkspacesClient().Delete(ctx, "contoso-resources", "contoso", "default", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*WorkspacesClient) Get ¶ added in v1.0.0
func (client *WorkspacesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientGetOptions) (WorkspacesClientGetResponse, error)
Get - Returns details of the workspace. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewWorkspacesClient().Get(ctx, "contoso-resources", "contoso", "default", 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.Workspace = armapicenter.Workspace{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.WorkspaceProperties{ // Title: to.Ptr("default"), // }, // } }
Output:
func (*WorkspacesClient) Head ¶ added in v1.0.0
func (client *WorkspacesClient) Head(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, options *WorkspacesClientHeadOptions) (WorkspacesClientHeadResponse, error)
Head - Checks if specified workspace exists.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- workspaceName - The name of the workspace.
- options - WorkspacesClientHeadOptions contains the optional parameters for the WorkspacesClient.Head method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Head.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewWorkspacesClient().Head(ctx, "contoso-resources", "contoso", "default", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*WorkspacesClient) NewListPager ¶ added in v1.0.0
func (client *WorkspacesClient) NewListPager(resourceGroupName string, serviceName string, options *WorkspacesClientListOptions) *runtime.Pager[WorkspacesClientListResponse]
NewListPager - Returns a collection of workspaces.
Generated from API version 2024-03-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- serviceName - The name of Azure API Center service.
- options - WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_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/apicenter/armapicenter" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armapicenter.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewWorkspacesClient().NewListPager("contoso-resources", "contoso", &armapicenter.WorkspacesClientListOptions{Filter: 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.WorkspaceListResult = armapicenter.WorkspaceListResult{ // Value: []*armapicenter.Workspace{ // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), // SystemData: &armapicenter.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), // }, // Properties: &armapicenter.WorkspaceProperties{ // Title: to.Ptr("default"), // }, // }}, // } } }
Output:
type WorkspacesClientCreateOrUpdateOptions ¶ added in v1.0.0
type WorkspacesClientCreateOrUpdateOptions struct { }
WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method.
type WorkspacesClientCreateOrUpdateResponse ¶ added in v1.0.0
type WorkspacesClientCreateOrUpdateResponse struct { // Workspace entity. Workspace // ETag contains the information returned from the ETag header response. ETag *string }
WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.CreateOrUpdate.
type WorkspacesClientDeleteOptions ¶ added in v1.0.0
type WorkspacesClientDeleteOptions struct { }
WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method.
type WorkspacesClientDeleteResponse ¶ added in v1.0.0
type WorkspacesClientDeleteResponse struct { }
WorkspacesClientDeleteResponse contains the response from method WorkspacesClient.Delete.
type WorkspacesClientGetOptions ¶ added in v1.0.0
type WorkspacesClientGetOptions struct { }
WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method.
type WorkspacesClientGetResponse ¶ added in v1.0.0
type WorkspacesClientGetResponse struct { // Workspace entity. Workspace // ETag contains the information returned from the ETag header response. ETag *string }
WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get.
type WorkspacesClientHeadOptions ¶ added in v1.0.0
type WorkspacesClientHeadOptions struct { }
WorkspacesClientHeadOptions contains the optional parameters for the WorkspacesClient.Head method.
type WorkspacesClientHeadResponse ¶ added in v1.0.0
type WorkspacesClientHeadResponse struct { // Success indicates if the operation succeeded or failed. Success bool }
WorkspacesClientHeadResponse contains the response from method WorkspacesClient.Head.
type WorkspacesClientListOptions ¶ added in v1.0.0
type WorkspacesClientListOptions struct { // OData filter parameter. Filter *string }
WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method.
type WorkspacesClientListResponse ¶ added in v1.0.0
type WorkspacesClientListResponse struct { // The response of a Workspace list operation. WorkspaceListResult }
WorkspacesClientListResponse contains the response from method WorkspacesClient.NewListPager.