|
| 1 | +# Code snippets and samples |
| 2 | + |
| 3 | + |
| 4 | +## GuestSubscriptions |
| 5 | + |
| 6 | +- [Create](#guestsubscriptions_create) |
| 7 | +- [Delete](#guestsubscriptions_delete) |
| 8 | +- [Get](#guestsubscriptions_get) |
| 9 | +- [ListBySubscriptionLocationResource](#guestsubscriptions_listbysubscriptionlocationresource) |
| 10 | + |
| 11 | +## Operations |
| 12 | + |
| 13 | +- [List](#operations_list) |
| 14 | + |
| 15 | +## SharedLimits |
| 16 | + |
| 17 | +- [Create](#sharedlimits_create) |
| 18 | +- [Delete](#sharedlimits_delete) |
| 19 | +- [Get](#sharedlimits_get) |
| 20 | +- [ListBySubscriptionLocationResource](#sharedlimits_listbysubscriptionlocationresource) |
| 21 | +### GuestSubscriptions_Create |
| 22 | + |
| 23 | +```java |
| 24 | +import com.azure.resourcemanager.computelimit.models.GuestSubscriptionProperties; |
| 25 | + |
| 26 | +/** |
| 27 | + * Samples for GuestSubscriptions Create. |
| 28 | + */ |
| 29 | +public final class GuestSubscriptionsCreateSamples { |
| 30 | + /* |
| 31 | + * x-ms-original-file: 2025-08-15/GuestSubscriptions_Create.json |
| 32 | + */ |
| 33 | + /** |
| 34 | + * Sample code: Create a guest subscription. |
| 35 | + * |
| 36 | + * @param manager Entry point to ComputeLimitManager. |
| 37 | + */ |
| 38 | + public static void createAGuestSubscription(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 39 | + manager.guestSubscriptions() |
| 40 | + .define("11111111-1111-1111-1111-111111111111") |
| 41 | + .withExistingLocation("eastus") |
| 42 | + .withProperties(new GuestSubscriptionProperties()) |
| 43 | + .create(); |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +### GuestSubscriptions_Delete |
| 49 | + |
| 50 | +```java |
| 51 | +/** |
| 52 | + * Samples for GuestSubscriptions Delete. |
| 53 | + */ |
| 54 | +public final class GuestSubscriptionsDeleteSamples { |
| 55 | + /* |
| 56 | + * x-ms-original-file: 2025-08-15/GuestSubscriptions_Delete.json |
| 57 | + */ |
| 58 | + /** |
| 59 | + * Sample code: Delete a guest subscription. |
| 60 | + * |
| 61 | + * @param manager Entry point to ComputeLimitManager. |
| 62 | + */ |
| 63 | + public static void deleteAGuestSubscription(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 64 | + manager.guestSubscriptions() |
| 65 | + .deleteByResourceGroupWithResponse("eastus", "11111111-1111-1111-1111-111111111111", |
| 66 | + com.azure.core.util.Context.NONE); |
| 67 | + } |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | +### GuestSubscriptions_Get |
| 72 | + |
| 73 | +```java |
| 74 | +/** |
| 75 | + * Samples for GuestSubscriptions Get. |
| 76 | + */ |
| 77 | +public final class GuestSubscriptionsGetSamples { |
| 78 | + /* |
| 79 | + * x-ms-original-file: 2025-08-15/GuestSubscriptions_Get.json |
| 80 | + */ |
| 81 | + /** |
| 82 | + * Sample code: Get a guest subscription. |
| 83 | + * |
| 84 | + * @param manager Entry point to ComputeLimitManager. |
| 85 | + */ |
| 86 | + public static void getAGuestSubscription(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 87 | + manager.guestSubscriptions() |
| 88 | + .getWithResponse("eastus", "11111111-1111-1111-1111-111111111111", com.azure.core.util.Context.NONE); |
| 89 | + } |
| 90 | +} |
| 91 | +``` |
| 92 | + |
| 93 | +### GuestSubscriptions_ListBySubscriptionLocationResource |
| 94 | + |
| 95 | +```java |
| 96 | +/** |
| 97 | + * Samples for GuestSubscriptions ListBySubscriptionLocationResource. |
| 98 | + */ |
| 99 | +public final class GuestSubscriptionsListBySubscriptionLocationResourceSamples { |
| 100 | + /* |
| 101 | + * x-ms-original-file: 2025-08-15/GuestSubscriptions_List.json |
| 102 | + */ |
| 103 | + /** |
| 104 | + * Sample code: List guest subscriptions for a scope. |
| 105 | + * |
| 106 | + * @param manager Entry point to ComputeLimitManager. |
| 107 | + */ |
| 108 | + public static void |
| 109 | + listGuestSubscriptionsForAScope(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 110 | + manager.guestSubscriptions().listBySubscriptionLocationResource("eastus", com.azure.core.util.Context.NONE); |
| 111 | + } |
| 112 | +} |
| 113 | +``` |
| 114 | + |
| 115 | +### Operations_List |
| 116 | + |
| 117 | +```java |
| 118 | +/** |
| 119 | + * Samples for Operations List. |
| 120 | + */ |
| 121 | +public final class OperationsListSamples { |
| 122 | + /* |
| 123 | + * x-ms-original-file: 2025-08-15/Operations_List.json |
| 124 | + */ |
| 125 | + /** |
| 126 | + * Sample code: List operations. |
| 127 | + * |
| 128 | + * @param manager Entry point to ComputeLimitManager. |
| 129 | + */ |
| 130 | + public static void listOperations(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 131 | + manager.operations().list(com.azure.core.util.Context.NONE); |
| 132 | + } |
| 133 | +} |
| 134 | +``` |
| 135 | + |
| 136 | +### SharedLimits_Create |
| 137 | + |
| 138 | +```java |
| 139 | +import com.azure.resourcemanager.computelimit.models.SharedLimitProperties; |
| 140 | + |
| 141 | +/** |
| 142 | + * Samples for SharedLimits Create. |
| 143 | + */ |
| 144 | +public final class SharedLimitsCreateSamples { |
| 145 | + /* |
| 146 | + * x-ms-original-file: 2025-08-15/SharedLimits_Create.json |
| 147 | + */ |
| 148 | + /** |
| 149 | + * Sample code: Create a shared limit. |
| 150 | + * |
| 151 | + * @param manager Entry point to ComputeLimitManager. |
| 152 | + */ |
| 153 | + public static void createASharedLimit(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 154 | + manager.sharedLimits() |
| 155 | + .define("StandardDSv3Family") |
| 156 | + .withExistingLocation("eastus") |
| 157 | + .withProperties(new SharedLimitProperties()) |
| 158 | + .create(); |
| 159 | + } |
| 160 | +} |
| 161 | +``` |
| 162 | + |
| 163 | +### SharedLimits_Delete |
| 164 | + |
| 165 | +```java |
| 166 | +/** |
| 167 | + * Samples for SharedLimits Delete. |
| 168 | + */ |
| 169 | +public final class SharedLimitsDeleteSamples { |
| 170 | + /* |
| 171 | + * x-ms-original-file: 2025-08-15/SharedLimits_Delete.json |
| 172 | + */ |
| 173 | + /** |
| 174 | + * Sample code: Delete a shared limit. |
| 175 | + * |
| 176 | + * @param manager Entry point to ComputeLimitManager. |
| 177 | + */ |
| 178 | + public static void deleteASharedLimit(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 179 | + manager.sharedLimits() |
| 180 | + .deleteByResourceGroupWithResponse("eastus", "StandardDSv3Family", com.azure.core.util.Context.NONE); |
| 181 | + } |
| 182 | +} |
| 183 | +``` |
| 184 | + |
| 185 | +### SharedLimits_Get |
| 186 | + |
| 187 | +```java |
| 188 | +/** |
| 189 | + * Samples for SharedLimits Get. |
| 190 | + */ |
| 191 | +public final class SharedLimitsGetSamples { |
| 192 | + /* |
| 193 | + * x-ms-original-file: 2025-08-15/SharedLimits_Get.json |
| 194 | + */ |
| 195 | + /** |
| 196 | + * Sample code: Get a shared limit. |
| 197 | + * |
| 198 | + * @param manager Entry point to ComputeLimitManager. |
| 199 | + */ |
| 200 | + public static void getASharedLimit(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 201 | + manager.sharedLimits().getWithResponse("eastus", "StandardDSv3Family", com.azure.core.util.Context.NONE); |
| 202 | + } |
| 203 | +} |
| 204 | +``` |
| 205 | + |
| 206 | +### SharedLimits_ListBySubscriptionLocationResource |
| 207 | + |
| 208 | +```java |
| 209 | +/** |
| 210 | + * Samples for SharedLimits ListBySubscriptionLocationResource. |
| 211 | + */ |
| 212 | +public final class SharedLimitsListBySubscriptionLocationResourceSamples { |
| 213 | + /* |
| 214 | + * x-ms-original-file: 2025-08-15/SharedLimits_List.json |
| 215 | + */ |
| 216 | + /** |
| 217 | + * Sample code: List all shared limits for a scope. |
| 218 | + * |
| 219 | + * @param manager Entry point to ComputeLimitManager. |
| 220 | + */ |
| 221 | + public static void |
| 222 | + listAllSharedLimitsForAScope(com.azure.resourcemanager.computelimit.ComputeLimitManager manager) { |
| 223 | + manager.sharedLimits().listBySubscriptionLocationResource("eastus", com.azure.core.util.Context.NONE); |
| 224 | + } |
| 225 | +} |
| 226 | +``` |
| 227 | + |
0 commit comments