Retrieves information about a Shared Image Gallery.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}?api-version=2023-07-03
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}?api-version=2023-07-03&$select=Permissions&$expand=SharingProfile/Groups
URI Parameters
Name |
In |
Required |
Type |
Description |
galleryName
|
path |
True
|
string
|
The name of the Shared Image Gallery.
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group.
|
subscriptionId
|
path |
True
|
string
|
Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
|
api-version
|
query |
True
|
string
|
Client Api Version.
|
$expand
|
query |
|
GalleryExpandParams
|
The expand query option to apply on the operation.
|
$select
|
query |
|
SelectPermissions
|
The select expression to apply on the operation.
|
Responses
Name |
Type |
Description |
200 OK
|
Gallery
|
OK
|
Other Status Codes
|
CloudError
|
Error response describing why the operation failed.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2023-07-03&$select=Permissions&$expand=SharingProfile/Groups
/**
* Samples for Galleries GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/
* CommunityGallery_Get.json
*/
/**
* Sample code: Get a community gallery.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getACommunityGallery(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getGalleries().getByResourceGroupWithResponse(
"myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/CommunityGallery_Get.json
func ExampleGalleriesClient_Get_getACommunityGallery() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil,
Expand: 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.Gallery = armcompute.Gallery{
// Name: to.Ptr("myGalleryName"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/communityGalleries/myGalleryName"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.GalleryProperties{
// Description: to.Ptr("This is the gallery description."),
// Identifier: &armcompute.GalleryIdentifier{
// UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"),
// },
// ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded),
// SharingProfile: &armcompute.SharingProfile{
// CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{
// CommunityGalleryEnabled: to.Ptr(true),
// Eula: to.Ptr("eula"),
// PublicNames: []*string{
// to.Ptr("GalleryPublicName")},
// PublisherContact: to.Ptr("pir@microsoft.com"),
// PublisherURI: to.Ptr("uri"),
// },
// Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity),
// },
// SharingStatus: &armcompute.SharingStatus{
// AggregatedState: to.Ptr(armcompute.SharingStateSucceeded),
// Summary: []*armcompute.RegionalSharingStatus{
// {
// Region: to.Ptr("westus"),
// State: to.Ptr(armcompute.SharingStateSucceeded),
// Details: to.Ptr(""),
// }},
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Retrieves information about a Shared Image Gallery.
*
* @summary Retrieves information about a Shared Image Gallery.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/CommunityGallery_Get.json
*/
async function getACommunityGallery() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const galleryName = "myGalleryName";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.galleries.get(resourceGroupName, galleryName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/CommunityGallery_Get.json
// this example is just showing the usage of "Galleries_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this GalleryResource created on azure
// for more information of creating GalleryResource, please refer to the document of GalleryResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string galleryName = "myGalleryName";
ResourceIdentifier galleryResourceId = GalleryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, galleryName);
GalleryResource gallery = client.GetGalleryResource(galleryResourceId);
// invoke the operation
GalleryResource result = await gallery.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
GalleryData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/communityGalleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Succeeded",
"sharingProfile": {
"permissions": "Community",
"communityGalleryInfo": {
"publisherUri": "uri",
"publisherContact": "pir@microsoft.com",
"eula": "eula",
"publicNames": [
"GalleryPublicName"
],
"communityGalleryEnabled": true
}
},
"sharingStatus": {
"aggregatedState": "Succeeded",
"summary": [
{
"region": "westus",
"state": "Succeeded",
"details": ""
}
]
}
},
"location": "West US",
"name": "myGalleryName"
}
Get a gallery with expand sharingProfile groups.
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2023-07-03&$select=Permissions&$expand=SharingProfile/Groups
import com.azure.resourcemanager.compute.models.GalleryExpandParams;
/**
* Samples for Galleries GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/
* Gallery_Get_WithExpandSharingProfileGroups.json
*/
/**
* Sample code: Get a gallery with expand sharingProfile groups.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getAGalleryWithExpandSharingProfileGroups(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getGalleries().getByResourceGroupWithResponse(
"myResourceGroup", "myGalleryName", null, GalleryExpandParams.SHARING_PROFILE_GROUPS,
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
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/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json
func ExampleGalleriesClient_Get_getAGalleryWithExpandSharingProfileGroups() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil,
Expand: to.Ptr(armcompute.GalleryExpandParamsSharingProfileGroups),
})
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.Gallery = armcompute.Gallery{
// Name: to.Ptr("myGalleryName"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.GalleryProperties{
// SharingProfile: &armcompute.SharingProfile{
// Groups: []*armcompute.SharingProfileGroup{
// {
// Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions),
// IDs: []*string{
// to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"),
// to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")},
// },
// {
// Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants),
// IDs: []*string{
// to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")},
// }},
// Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Retrieves information about a Shared Image Gallery.
*
* @summary Retrieves information about a Shared Image Gallery.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json
*/
async function getAGalleryWithExpandSharingProfileGroups() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const galleryName = "myGalleryName";
const expand = "SharingProfile/Groups";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.galleries.get(resourceGroupName, galleryName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json
// this example is just showing the usage of "Galleries_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this GalleryResource created on azure
// for more information of creating GalleryResource, please refer to the document of GalleryResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string galleryName = "myGalleryName";
ResourceIdentifier galleryResourceId = GalleryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, galleryName);
GalleryResource gallery = client.GetGalleryResource(galleryResourceId);
// invoke the operation
GalleryExpand? expand = GalleryExpand.SharingProfileGroups;
GalleryResource result = await gallery.GetAsync(expand: expand);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
GalleryData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"sharingProfile": {
"permissions": "Groups",
"groups": [
{
"type": "Subscriptions",
"ids": [
"34a4ab42-0d72-47d9-bd1a-aed207386dac",
"380fd389-260b-41aa-bad9-0a83108c370b"
]
},
{
"type": "AADTenants",
"ids": [
"c24c76aa-8897-4027-9b03-8f7928b54ff6"
]
}
]
}
},
"location": "West US",
"name": "myGalleryName"
}
Get a gallery with select permissions.
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2023-07-03&$select=Permissions&$expand=SharingProfile/Groups
import com.azure.resourcemanager.compute.models.SelectPermissions;
/**
* Samples for Galleries GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/
* Gallery_Get_WithSelectPermissions.json
*/
/**
* Sample code: Get a gallery with select permissions.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getAGalleryWithSelectPermissions(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getGalleries().getByResourceGroupWithResponse(
"myResourceGroup", "myGalleryName", SelectPermissions.PERMISSIONS, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
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/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json
func ExampleGalleriesClient_Get_getAGalleryWithSelectPermissions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: to.Ptr(armcompute.SelectPermissionsPermissions),
Expand: 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.Gallery = armcompute.Gallery{
// Name: to.Ptr("myGalleryName"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.GalleryProperties{
// SharingProfile: &armcompute.SharingProfile{
// Groups: []*armcompute.SharingProfileGroup{
// {
// Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions),
// IDs: []*string{
// to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"),
// to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")},
// },
// {
// Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants),
// IDs: []*string{
// to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")},
// }},
// Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups),
// },
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Retrieves information about a Shared Image Gallery.
*
* @summary Retrieves information about a Shared Image Gallery.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json
*/
async function getAGalleryWithSelectPermissions() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const galleryName = "myGalleryName";
const select = "Permissions";
const options = { select };
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.galleries.get(resourceGroupName, galleryName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json
// this example is just showing the usage of "Galleries_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this GalleryResource created on azure
// for more information of creating GalleryResource, please refer to the document of GalleryResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string galleryName = "myGalleryName";
ResourceIdentifier galleryResourceId = GalleryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, galleryName);
GalleryResource gallery = client.GetGalleryResource(galleryResourceId);
// invoke the operation
SelectPermission? select = SelectPermission.Permissions;
GalleryResource result = await gallery.GetAsync(select: select);
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
GalleryData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"sharingProfile": {
"permissions": "Groups",
"groups": [
{
"type": "Subscriptions",
"ids": [
"34a4ab42-0d72-47d9-bd1a-aed207386dac",
"380fd389-260b-41aa-bad9-0a83108c370b"
]
},
{
"type": "AADTenants",
"ids": [
"c24c76aa-8897-4027-9b03-8f7928b54ff6"
]
}
]
}
},
"location": "West US",
"name": "myGalleryName"
}
Get a gallery.
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName?api-version=2023-07-03&$select=Permissions&$expand=SharingProfile/Groups
/**
* Samples for Galleries GetByResourceGroup.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/
* Gallery_Get.json
*/
/**
* Sample code: Get a gallery.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getAGallery(com.azure.resourcemanager.AzureResourceManager azure) {
azure.virtualMachines().manager().serviceClient().getGalleries().getByResourceGroupWithResponse(
"myResourceGroup", "myGalleryName", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcompute_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get.json
func ExampleGalleriesClient_Get_getAGallery() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcompute.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil,
Expand: 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.Gallery = armcompute.Gallery{
// Name: to.Ptr("myGalleryName"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"),
// Location: to.Ptr("West US"),
// Properties: &armcompute.GalleryProperties{
// Description: to.Ptr("This is the gallery description."),
// Identifier: &armcompute.GalleryIdentifier{
// UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"),
// },
// ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ComputeManagementClient } = require("@azure/arm-compute");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Retrieves information about a Shared Image Gallery.
*
* @summary Retrieves information about a Shared Image Gallery.
* x-ms-original-file: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get.json
*/
async function getAGallery() {
const subscriptionId = process.env["COMPUTE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["COMPUTE_RESOURCE_GROUP"] || "myResourceGroup";
const galleryName = "myGalleryName";
const credential = new DefaultAzureCredential();
const client = new ComputeManagementClient(credential, subscriptionId);
const result = await client.galleries.get(resourceGroupName, galleryName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Compute;
using Azure.ResourceManager.Compute.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2023-07-03/examples/galleryExamples/Gallery_Get.json
// this example is just showing the usage of "Galleries_Get" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this GalleryResource created on azure
// for more information of creating GalleryResource, please refer to the document of GalleryResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "myResourceGroup";
string galleryName = "myGalleryName";
ResourceIdentifier galleryResourceId = GalleryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, galleryName);
GalleryResource gallery = client.GetGalleryResource(galleryResourceId);
// invoke the operation
GalleryResource result = await gallery.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
GalleryData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName",
"properties": {
"description": "This is the gallery description.",
"identifier": {
"uniqueName": "{subscription-id}-MYGALLERYNAME"
},
"provisioningState": "Succeeded"
},
"location": "West US",
"name": "myGalleryName"
}
Definitions
ApiError
Api error.
Name |
Type |
Description |
code
|
string
|
The error code.
|
details
|
ApiErrorBase[]
|
The Api error details
|
innererror
|
InnerError
|
The Api inner error
|
message
|
string
|
The error message.
|
target
|
string
|
The target of the particular error.
|
ApiErrorBase
Api error base.
Name |
Type |
Description |
code
|
string
|
The error code.
|
message
|
string
|
The error message.
|
target
|
string
|
The target of the particular error.
|
CloudError
An error response from the Compute service.
Name |
Type |
Description |
error
|
ApiError
|
Api error.
|
Information of community gallery if current gallery is shared to community
Name |
Type |
Description |
communityGalleryEnabled
|
boolean
|
Contains info about whether community gallery sharing is enabled.
|
eula
|
string
|
End-user license agreement for community gallery image.
|
publicNamePrefix
|
string
|
The prefix of the gallery name that will be displayed publicly. Visible to all users.
|
publicNames
|
string[]
|
Community gallery public name list.
|
publisherContact
|
string
|
Community gallery publisher support email. The email address of the publisher. Visible to all users.
|
publisherUri
|
string
|
The link to the publisher website. Visible to all users.
|
Gallery
Specifies information about the Shared Image Gallery that you want to create or update.
Name |
Type |
Description |
id
|
string
|
Resource Id
|
location
|
string
|
Resource location
|
name
|
string
|
Resource name
|
properties.description
|
string
|
The description of this Shared Image Gallery resource. This property is updatable.
|
properties.identifier
|
GalleryIdentifier
|
Describes the gallery unique name.
|
properties.provisioningState
|
GalleryProvisioningState
|
The current state of the gallery or gallery artifact.
The provisioning state, which only appears in the response.
|
properties.sharingProfile
|
SharingProfile
|
Profile for gallery sharing to subscription or tenant
|
properties.sharingStatus
|
SharingStatus
|
Sharing status of current gallery.
|
properties.softDeletePolicy
|
SoftDeletePolicy
|
Contains information about the soft deletion policy of the gallery.
|
tags
|
object
|
Resource tags
|
type
|
string
|
Resource type
|
GalleryExpandParams
The expand query option to apply on the operation.
Name |
Type |
Description |
SharingProfile/Groups
|
string
|
|
GalleryIdentifier
Describes the gallery unique name.
Name |
Type |
Description |
uniqueName
|
string
|
The unique name of the Shared Image Gallery. This name is generated automatically by Azure.
|
GalleryProvisioningState
The current state of the gallery or gallery artifact.
Name |
Type |
Description |
Creating
|
string
|
|
Deleting
|
string
|
|
Failed
|
string
|
|
Migrating
|
string
|
|
Succeeded
|
string
|
|
Updating
|
string
|
|
GallerySharingPermissionTypes
This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community.
Name |
Type |
Description |
Community
|
string
|
|
Groups
|
string
|
|
Private
|
string
|
|
InnerError
Inner error details.
Name |
Type |
Description |
errordetail
|
string
|
The internal error message or exception dump.
|
exceptiontype
|
string
|
The exception type.
|
RegionalSharingStatus
Gallery regional sharing status
Name |
Type |
Description |
details
|
string
|
Details of gallery regional sharing failure.
|
region
|
string
|
Region name
|
state
|
SharingState
|
The sharing state of the gallery.
Gallery sharing state in current region
|
SelectPermissions
The select expression to apply on the operation.
Name |
Type |
Description |
Permissions
|
string
|
|
SharingProfile
Profile for gallery sharing to subscription or tenant
Name |
Type |
Description |
communityGalleryInfo
|
CommunityGalleryInfo
|
Information of community gallery if current gallery is shared to community.
|
groups
|
SharingProfileGroup[]
|
A list of sharing profile groups.
|
permissions
|
GallerySharingPermissionTypes
|
This property allows you to specify the permission of sharing gallery. Possible values are: Private, Groups, Community.
|
SharingProfileGroup
Group of the gallery sharing profile
Name |
Type |
Description |
ids
|
string[]
|
A list of subscription/tenant ids the gallery is aimed to be shared to.
|
type
|
SharingProfileGroupTypes
|
This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants.
|
SharingProfileGroupTypes
This property allows you to specify the type of sharing group. Possible values are: Subscriptions, AADTenants.
Name |
Type |
Description |
AADTenants
|
string
|
|
Subscriptions
|
string
|
|
SharingState
The sharing state of the gallery.
Name |
Type |
Description |
Failed
|
string
|
|
InProgress
|
string
|
|
Succeeded
|
string
|
|
Unknown
|
string
|
|
SharingStatus
Sharing status of current gallery.
Name |
Type |
Description |
aggregatedState
|
SharingState
|
The sharing state of the gallery.
Aggregated sharing state of current gallery.
|
summary
|
RegionalSharingStatus[]
|
Summary of all regional sharing status.
|
SoftDeletePolicy
Contains information about the soft deletion policy of the gallery.
Name |
Type |
Description |
isSoftDeleteEnabled
|
boolean
|
Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time.
|