|
7 | 7 | import com.azure.core.http.HttpPipeline; |
8 | 8 | import com.azure.core.management.profile.AzureProfile; |
9 | 9 | import com.azure.resourcemanager.authorization.AuthorizationManager; |
| 10 | +import com.azure.resourcemanager.compute.fluent.CloudServiceManagementClient; |
10 | 11 | import com.azure.resourcemanager.compute.fluent.ComputeManagementClient; |
11 | 12 | import com.azure.resourcemanager.compute.implementation.AvailabilitySetsImpl; |
| 13 | +import com.azure.resourcemanager.compute.implementation.CloudServiceManagementClientBuilder; |
12 | 14 | import com.azure.resourcemanager.compute.implementation.ComputeManagementClientBuilder; |
13 | 15 | import com.azure.resourcemanager.compute.implementation.ComputeSkusImpl; |
14 | 16 | import com.azure.resourcemanager.compute.implementation.ComputeUsagesImpl; |
@@ -53,6 +55,7 @@ public final class ComputeManager extends Manager<ComputeManagementClient> { |
53 | 55 | private final StorageManager storageManager; |
54 | 56 | private final NetworkManager networkManager; |
55 | 57 | private final AuthorizationManager authorizationManager; |
| 58 | + private final CloudServiceManagementClient cloudServiceClient; |
56 | 59 |
|
57 | 60 | // The collections |
58 | 61 | private AvailabilitySets availabilitySets; |
@@ -97,6 +100,15 @@ public AuthorizationManager authorizationManager() { |
97 | 100 | return authorizationManager; |
98 | 101 | } |
99 | 102 |
|
| 103 | + /** |
| 104 | + * Gets the cloud service client. |
| 105 | + * |
| 106 | + * @return the cloud service client |
| 107 | + */ |
| 108 | + public CloudServiceManagementClient cloudServiceClient() { |
| 109 | + return cloudServiceClient; |
| 110 | + } |
| 111 | + |
100 | 112 | /** |
101 | 113 | * Get a Configurable instance that can be used to create ComputeManager with optional configuration. |
102 | 114 | * |
@@ -161,6 +173,10 @@ private ComputeManager(HttpPipeline httpPipeline, AzureProfile profile) { |
161 | 173 | storageManager = StorageManager.authenticate(httpPipeline, profile); |
162 | 174 | networkManager = NetworkManager.authenticate(httpPipeline, profile); |
163 | 175 | authorizationManager = AuthorizationManager.authenticate(httpPipeline, profile); |
| 176 | + cloudServiceClient = new CloudServiceManagementClientBuilder().pipeline(httpPipeline) |
| 177 | + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) |
| 178 | + .subscriptionId(profile.getSubscriptionId()) |
| 179 | + .buildClient(); |
164 | 180 | } |
165 | 181 |
|
166 | 182 | /** |
|
0 commit comments