Code snippets and samples
PrivateEndpointConnections
import com .azure .resourcemanager .elasticsan .models .PublicNetworkAccess ;
import com .azure .resourcemanager .elasticsan .models .Sku ;
import com .azure .resourcemanager .elasticsan .models .SkuName ;
import com .azure .resourcemanager .elasticsan .models .SkuTier ;
import java .util .Arrays ;
import java .util .HashMap ;
import java .util .Map ;
import java .util .stream .Collectors ;
/**
* Samples for ElasticSans Create.
*/
public final class ElasticSansCreateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Create_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansCreateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().define ("elasticsanname" ).withRegion ("France Central" ).withExistingResourceGroup ("resourcegroupname" ).withSku (new Sku ().withName (SkuName .PREMIUM_LRS ).withTier (SkuTier .PREMIUM )).withBaseSizeTiB (5L ).withExtendedCapacitySizeTiB (25L ).withTags (mapOf ("key9316" , "fakeTokenPlaceholder" )).withAvailabilityZones (Arrays .asList ("1" )).withPublicNetworkAccess (PublicNetworkAccess .ENABLED ).create ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Create_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Create_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansCreateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().define ("elasticsanname" ).withRegion ("France Central" ).withExistingResourceGroup ("resourcegroupname" ).withSku (new Sku ().withName (SkuName .PREMIUM_LRS )).withBaseSizeTiB (15L ).withExtendedCapacitySizeTiB (27L ).create ();
}
// Use "Map.of" if available
@ SuppressWarnings ("unchecked" )
private static <T > Map <String , T > mapOf (Object ... inputs ) {
Map <String , T > map = new HashMap <>();
for (int i = 0 ; i < inputs .length ; i += 2 ) {
String key = (String ) inputs [i ];
T value = (T ) inputs [i + 1 ];
map .put (key , value );
}
return map ;
}
}
/**
* Samples for ElasticSans Delete.
*/
public final class ElasticSansDeleteSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Delete_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansDeleteMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().delete ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Delete_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansDeleteMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().delete ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
}
ElasticSans_GetByResourceGroup
/**
* Samples for ElasticSans GetByResourceGroup.
*/
public final class ElasticSansGetByResourceGroupSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Get_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansGetMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().getByResourceGroupWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Get_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Get_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansGetMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().getByResourceGroupWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
}
/**
* Samples for ElasticSans List.
*/
public final class ElasticSansListSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_ListBySubscription_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansListBySubscriptionMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().list (com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_ListBySubscription_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansListBySubscriptionMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().list (com .azure .core .util .Context .NONE );
}
}
ElasticSans_ListByResourceGroup
/**
* Samples for ElasticSans ListByResourceGroup.
*/
public final class ElasticSansListByResourceGroupSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_ListByResourceGroup_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansListByResourceGroupMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().listByResourceGroup ("resourcegroupname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_ListByResourceGroup_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansListByResourceGroupMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .elasticSans ().listByResourceGroup ("resourcegroupname" , com .azure .core .util .Context .NONE );
}
}
import com .azure .resourcemanager .elasticsan .models .ElasticSan ;
import com .azure .resourcemanager .elasticsan .models .PublicNetworkAccess ;
import java .util .HashMap ;
import java .util .Map ;
import java .util .stream .Collectors ;
/**
* Samples for ElasticSans Update.
*/
public final class ElasticSansUpdateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MinimumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Update_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansUpdateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
ElasticSan resource = manager .elasticSans ().getByResourceGroupWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().apply ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/ElasticSans_Update_MaximumSet_Gen.json
*/
/**
* Sample code: ElasticSans_Update_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void elasticSansUpdateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
ElasticSan resource = manager .elasticSans ().getByResourceGroupWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().withTags (mapOf ("key1931" , "fakeTokenPlaceholder" )).withBaseSizeTiB (13L ).withExtendedCapacitySizeTiB (29L ).withPublicNetworkAccess (PublicNetworkAccess .ENABLED ).apply ();
}
// Use "Map.of" if available
@ SuppressWarnings ("unchecked" )
private static <T > Map <String , T > mapOf (Object ... inputs ) {
Map <String , T > map = new HashMap <>();
for (int i = 0 ; i < inputs .length ; i += 2 ) {
String key = (String ) inputs [i ];
T value = (T ) inputs [i + 1 ];
map .put (key , value );
}
return map ;
}
}
/**
* Samples for Operations List.
*/
public final class OperationsListSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MinimumSet_Gen.json
*/
/**
* Sample code: Operations_List_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void operationsListMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .operations ().list (com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Operations_List_MaximumSet_Gen.json
*/
/**
* Sample code: Operations_List_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void operationsListMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .operations ().list (com .azure .core .util .Context .NONE );
}
}
PrivateEndpointConnections_Create
import com .azure .resourcemanager .elasticsan .models .PrivateEndpoint ;
import com .azure .resourcemanager .elasticsan .models .PrivateEndpointServiceConnectionStatus ;
import com .azure .resourcemanager .elasticsan .models .PrivateLinkServiceConnectionState ;
import java .util .Arrays ;
import java .util .stream .Collectors ;
/**
* Samples for PrivateEndpointConnections Create.
*/
public final class PrivateEndpointConnectionsCreateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Create_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsCreateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().define ("privateendpointconnectionname" ).withExistingElasticSan ("resourcegroupname" , "elasticsanname" ).withPrivateLinkServiceConnectionState (new PrivateLinkServiceConnectionState ().withStatus (PrivateEndpointServiceConnectionStatus .PENDING ).withDescription ("dxl" ).withActionsRequired ("jhjdpwvyzipggtn" )).withPrivateEndpoint (new PrivateEndpoint ()).withGroupIds (Arrays .asList ("jdwrzpemdjrpiwzvy" )).create ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Create_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsCreateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().define ("privateendpointconnectionname" ).withExistingElasticSan ("resourcegroupname" , "elasticsanname" ).withPrivateLinkServiceConnectionState (new PrivateLinkServiceConnectionState ()).create ();
}
}
PrivateEndpointConnections_Delete
/**
* Samples for PrivateEndpointConnections Delete.
*/
public final class PrivateEndpointConnectionsDeleteSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Delete_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsDeleteMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().delete ("resourcegroupname" , "elasticsanname" , "privateendpointconnectionname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Delete_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsDeleteMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().delete ("resourcegroupname" , "elasticsanname" , "privateendpointconnectionname" , com .azure .core .util .Context .NONE );
}
}
PrivateEndpointConnections_Get
/**
* Samples for PrivateEndpointConnections Get.
*/
public final class PrivateEndpointConnectionsGetSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Get_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsGetMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().getWithResponse ("resourcegroupname" , "elasticsanname" , "privateendpointconnectionname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_Get_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsGetMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().getWithResponse ("resourcegroupname" , "elasticsanname" , "privateendpointconnectionname" , com .azure .core .util .Context .NONE );
}
}
PrivateEndpointConnections_List
/**
* Samples for PrivateEndpointConnections List.
*/
public final class PrivateEndpointConnectionsListSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_List_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsListMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().list ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json
*/
/**
* Sample code: PrivateEndpointConnections_List_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateEndpointConnectionsListMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateEndpointConnections ().list ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
}
PrivateLinkResources_ListByElasticSan
/**
* Samples for PrivateLinkResources ListByElasticSan.
*/
public final class PrivateLinkResourcesListByElasticSanSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json
*/
/**
* Sample code: PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateLinkResourcesListByElasticSanMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateLinkResources ().listByElasticSanWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json
*/
/**
* Sample code: PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void privateLinkResourcesListByElasticSanMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .privateLinkResources ().listByElasticSanWithResponse ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
}
/**
* Samples for Skus List.
*/
public final class SkusListSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MinimumSet_Gen.json
*/
/**
* Sample code: Skus_List_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void skusListMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .skus ().list (null , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Skus_List_MaximumSet_Gen.json
*/
/**
* Sample code: Skus_List_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void skusListMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .skus ().list ("obwwdrkq" , com .azure .core .util .Context .NONE );
}
}
import com .azure .resourcemanager .elasticsan .models .Action ;
import com .azure .resourcemanager .elasticsan .models .EncryptionIdentity ;
import com .azure .resourcemanager .elasticsan .models .EncryptionProperties ;
import com .azure .resourcemanager .elasticsan .models .EncryptionType ;
import com .azure .resourcemanager .elasticsan .models .Identity ;
import com .azure .resourcemanager .elasticsan .models .IdentityType ;
import com .azure .resourcemanager .elasticsan .models .KeyVaultProperties ;
import com .azure .resourcemanager .elasticsan .models .NetworkRuleSet ;
import com .azure .resourcemanager .elasticsan .models .StorageTargetType ;
import com .azure .resourcemanager .elasticsan .models .UserAssignedIdentity ;
import com .azure .resourcemanager .elasticsan .models .VirtualNetworkRule ;
import java .util .Arrays ;
import java .util .HashMap ;
import java .util .Map ;
import java .util .stream .Collectors ;
/**
* Samples for VolumeGroups Create.
*/
public final class VolumeGroupsCreateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Create_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsCreateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().define ("volumegroupname" ).withExistingElasticSan ("resourcegroupname" , "elasticsanname" ).create ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Create_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Create_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsCreateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().define ("volumegroupname" ).withExistingElasticSan ("resourcegroupname" , "elasticsanname" ).withIdentity (new Identity ().withType (IdentityType .NONE ).withUserAssignedIdentities (mapOf ("key7482" , new UserAssignedIdentity ()))).withProtocolType (StorageTargetType .ISCSI ).withEncryption (EncryptionType .ENCRYPTION_AT_REST_WITH_CUSTOMER_MANAGED_KEY ).withEncryptionProperties (new EncryptionProperties ().withKeyVaultProperties (new KeyVaultProperties ().withKeyName ("fakeTokenPlaceholder" ).withKeyVersion ("fakeTokenPlaceholder" ).withKeyVaultUri ("fakeTokenPlaceholder" )).withEncryptionIdentity (new EncryptionIdentity ().withEncryptionUserAssignedIdentity ("im" ))).withNetworkAcls (new NetworkRuleSet ().withVirtualNetworkRules (Arrays .asList (new VirtualNetworkRule ().withVirtualNetworkResourceId ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}" ).withAction (Action .ALLOW )))).create ();
}
// Use "Map.of" if available
@ SuppressWarnings ("unchecked" )
private static <T > Map <String , T > mapOf (Object ... inputs ) {
Map <String , T > map = new HashMap <>();
for (int i = 0 ; i < inputs .length ; i += 2 ) {
String key = (String ) inputs [i ];
T value = (T ) inputs [i + 1 ];
map .put (key , value );
}
return map ;
}
}
/**
* Samples for VolumeGroups Delete.
*/
public final class VolumeGroupsDeleteSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Delete_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsDeleteMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Delete_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsDeleteMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
}
/**
* Samples for VolumeGroups Get.
*/
public final class VolumeGroupsGetSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Get_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsGetMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Get_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Get_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsGetMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
}
VolumeGroups_ListByElasticSan
/**
* Samples for VolumeGroups ListByElasticSan.
*/
public final class VolumeGroupsListByElasticSanSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_ListByElasticSan_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsListByElasticSanMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().listByElasticSan ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_ListByElasticSan_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsListByElasticSanMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeGroups ().listByElasticSan ("resourcegroupname" , "elasticsanname" , com .azure .core .util .Context .NONE );
}
}
import com .azure .resourcemanager .elasticsan .models .Action ;
import com .azure .resourcemanager .elasticsan .models .EncryptionIdentity ;
import com .azure .resourcemanager .elasticsan .models .EncryptionProperties ;
import com .azure .resourcemanager .elasticsan .models .EncryptionType ;
import com .azure .resourcemanager .elasticsan .models .Identity ;
import com .azure .resourcemanager .elasticsan .models .IdentityType ;
import com .azure .resourcemanager .elasticsan .models .KeyVaultProperties ;
import com .azure .resourcemanager .elasticsan .models .NetworkRuleSet ;
import com .azure .resourcemanager .elasticsan .models .StorageTargetType ;
import com .azure .resourcemanager .elasticsan .models .UserAssignedIdentity ;
import com .azure .resourcemanager .elasticsan .models .VirtualNetworkRule ;
import com .azure .resourcemanager .elasticsan .models .VolumeGroup ;
import java .util .Arrays ;
import java .util .HashMap ;
import java .util .Map ;
import java .util .stream .Collectors ;
/**
* Samples for VolumeGroups Update.
*/
public final class VolumeGroupsUpdateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Update_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsUpdateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
VolumeGroup resource = manager .volumeGroups ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().withIdentity (new Identity ().withType (IdentityType .NONE ).withUserAssignedIdentities (mapOf ("key7482" , new UserAssignedIdentity ()))).withProtocolType (StorageTargetType .ISCSI ).withEncryption (EncryptionType .ENCRYPTION_AT_REST_WITH_PLATFORM_KEY ).withEncryptionProperties (new EncryptionProperties ().withKeyVaultProperties (new KeyVaultProperties ().withKeyName ("fakeTokenPlaceholder" ).withKeyVersion ("fakeTokenPlaceholder" ).withKeyVaultUri ("fakeTokenPlaceholder" )).withEncryptionIdentity (new EncryptionIdentity ().withEncryptionUserAssignedIdentity ("im" ))).withNetworkAcls (new NetworkRuleSet ().withVirtualNetworkRules (Arrays .asList (new VirtualNetworkRule ().withVirtualNetworkResourceId ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}" ).withAction (Action .ALLOW )))).apply ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeGroups_Update_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeGroups_Update_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeGroupsUpdateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
VolumeGroup resource = manager .volumeGroups ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().apply ();
}
// Use "Map.of" if available
@ SuppressWarnings ("unchecked" )
private static <T > Map <String , T > mapOf (Object ... inputs ) {
Map <String , T > map = new HashMap <>();
for (int i = 0 ; i < inputs .length ; i += 2 ) {
String key = (String ) inputs [i ];
T value = (T ) inputs [i + 1 ];
map .put (key , value );
}
return map ;
}
}
import com .azure .resourcemanager .elasticsan .models .SnapshotCreationData ;
/**
* Samples for VolumeSnapshots Create.
*/
public final class VolumeSnapshotsCreateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Create_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsCreateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().define ("snapshotname" ).withExistingVolumegroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" ).withCreationData (new SnapshotCreationData ().withSourceId ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" )).create ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Create_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Create_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsCreateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().define ("snapshotname" ).withExistingVolumegroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" ).withCreationData (new SnapshotCreationData ().withSourceId ("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName}" )).create ();
}
}
/**
* Samples for VolumeSnapshots Delete.
*/
public final class VolumeSnapshotsDeleteSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Delete_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsDeleteMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "snapshotname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Delete_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsDeleteMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "snapshotname" , com .azure .core .util .Context .NONE );
}
}
/**
* Samples for VolumeSnapshots Get.
*/
public final class VolumeSnapshotsGetSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Get_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsGetMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "snapshotname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_Get_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_Get_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsGetMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "snapshotname" , com .azure .core .util .Context .NONE );
}
}
VolumeSnapshots_ListByVolumeGroup
/**
* Samples for VolumeSnapshots ListByVolumeGroup.
*/
public final class VolumeSnapshotsListByVolumeGroupSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_ListByVolumeGroup_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsListByVolumeGroupMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().listByVolumeGroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" , null , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.json
*/
/**
* Sample code: VolumeSnapshots_ListByVolumeGroup_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumeSnapshotsListByVolumeGroupMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumeSnapshots ().listByVolumeGroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumeName eq <volume name>" , com .azure .core .util .Context .NONE );
}
}
import com .azure .resourcemanager .elasticsan .models .ManagedByInfo ;
import com .azure .resourcemanager .elasticsan .models .SourceCreationData ;
import com .azure .resourcemanager .elasticsan .models .VolumeCreateOption ;
import java .util .stream .Collectors ;
/**
* Samples for Volumes Create.
*/
public final class VolumesCreateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MaximumSet_Gen.json
*/
/**
* Sample code: Volumes_Create_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesCreateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().define ("volumename" ).withExistingVolumegroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" ).withSizeGiB (9L ).withCreationData (new SourceCreationData ().withCreateSource (VolumeCreateOption .NONE ).withSourceId ("ARM Id of Resource" )).withManagedBy (new ManagedByInfo ().withResourceId ("mtkeip" )).create ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Create_MinimumSet_Gen.json
*/
/**
* Sample code: Volumes_Create_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesCreateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().define ("volumename" ).withExistingVolumegroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" ).withSizeGiB (9L ).create ();
}
}
import com .azure .resourcemanager .elasticsan .models .XMsDeleteSnapshots ;
import com .azure .resourcemanager .elasticsan .models .XMsForceDelete ;
import java .util .stream .Collectors ;
/**
* Samples for Volumes Delete.
*/
public final class VolumesDeleteSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MinimumSet_Gen.json
*/
/**
* Sample code: Volumes_Delete_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesDeleteMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , null , null , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Delete_MaximumSet_Gen.json
*/
/**
* Sample code: Volumes_Delete_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesDeleteMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().delete ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , XMsDeleteSnapshots .TRUE , XMsForceDelete .TRUE , com .azure .core .util .Context .NONE );
}
}
/**
* Samples for Volumes Get.
*/
public final class VolumesGetSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MaximumSet_Gen.json
*/
/**
* Sample code: Volumes_Get_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesGetMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Get_MinimumSet_Gen.json
*/
/**
* Sample code: Volumes_Get_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesGetMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , com .azure .core .util .Context .NONE );
}
}
Volumes_ListByVolumeGroup
/**
* Samples for Volumes ListByVolumeGroup.
*/
public final class VolumesListByVolumeGroupSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json
*/
/**
* Sample code: Volumes_ListByVolumeGroup_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesListByVolumeGroupMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().listByVolumeGroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json
*/
/**
* Sample code: Volumes_ListByVolumeGroup_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesListByVolumeGroupMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
manager .volumes ().listByVolumeGroup ("resourcegroupname" , "elasticsanname" , "volumegroupname" , com .azure .core .util .Context .NONE );
}
}
import com .azure .resourcemanager .elasticsan .models .Volume ;
/**
* Samples for Volumes Update.
*/
public final class VolumesUpdateSamples {
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MinimumSet_Gen.json
*/
/**
* Sample code: Volumes_Update_MinimumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesUpdateMinimumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
Volume resource = manager .volumes ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().apply ();
}
/*
* x-ms-original-file: specification/elasticsan/resource-manager/Microsoft.ElasticSan/stable/2023-01-01/examples/Volumes_Update_MaximumSet_Gen.json
*/
/**
* Sample code: Volumes_Update_MaximumSet_Gen.
*
* @param manager Entry point to ElasticSanManager.
*/
public static void volumesUpdateMaximumSetGen (com .azure .resourcemanager .elasticsan .ElasticSanManager manager ) {
Volume resource = manager .volumes ().getWithResponse ("resourcegroupname" , "elasticsanname" , "volumegroupname" , "volumename" , com .azure .core .util .Context .NONE ).getValue ();
resource .update ().withSizeGiB (11L ).apply ();
}
}