Ekinlikler
Power BI DataViz Dünya Şampiyonası
14 Şub 16 - 31 Mar 16
4 giriş şansıyla bir konferans paketi kazanabilir ve Las Vegas'taki LIVE Grand Finale'e gidebilirsiniz
Daha fazla bilgi edininBu tarayıcı artık desteklenmiyor.
En son özelliklerden, güvenlik güncelleştirmelerinden ve teknik destekten faydalanmak için Microsoft Edge’e yükseltin.
This package contains Microsoft Azure DevCenter client library.
Various documentation is available to help you get started
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-developer-devcenter</artifactId>
<version>1.0.6</version>
</dependency>
Azure Identity package provides the default implementation for authenticating the client.
String endpoint = Configuration.getGlobalConfiguration().get("DEVCENTER_ENDPOINT");
// Build our clients
DevCenterClient devCenterClient =
new DevCenterClientBuilder()
.endpoint(endpoint)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
DevBoxesClient devBoxClient = devCenterClient.getDevBoxesClient();
// Find available Projects and Pools
PagedIterable<DevCenterProject> projectListResponse = devCenterClient.listProjects();
for (DevCenterProject project: projectListResponse) {
System.out.println(project.getName());
}
// Use the first project in the list
DevCenterProject project = projectListResponse.iterator().next();
String projectName = project.getName();
PagedIterable<DevBoxPool> poolListResponse = devBoxClient.listPools(projectName);
for (DevBoxPool pool: poolListResponse) {
System.out.println(pool.getName());
}
// Use the first pool in the list
DevBoxPool pool = poolListResponse.iterator().next();
String poolName = pool.getName();
System.out.println("Starting to create dev box in project " + projectName + " and pool " + poolName);
// Provision a Dev Box
SyncPoller<DevCenterOperationDetails, DevBox> devBoxCreateResponse =
devBoxClient.beginCreateDevBox(projectName, "me", new DevBox("MyDevBox", poolName));
devBoxCreateResponse.waitForCompletion();
DevBox devBox = devBoxCreateResponse.getFinalResult();
String devBoxName = devBox.getName();
System.out.println("DevBox " + devBoxName + "finished provisioning with status " + devBox.getProvisioningState());
RemoteConnection remoteConnection =
devBoxClient.getRemoteConnection(projectName, "me", devBoxName);
System.out.println("Dev Box web url is " + remoteConnection.getWebUrl());
System.out.println("Start deleting dev box");
// Tear down the Dev Box when we're finished:
SyncPoller<DevCenterOperationDetails, Void> devBoxDeleteResponse =
devBoxClient.beginDeleteDevBox(projectName, "me", devBoxName);
devBoxDeleteResponse.waitForCompletion();
System.out.println("Done deleting dev box");
String endpoint = Configuration.getGlobalConfiguration().get("DEVCENTER_ENDPOINT");
// Build our clients
DevCenterClient devCenterClient =
new DevCenterClientBuilder()
.endpoint(endpoint)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
DeploymentEnvironmentsClient environmentsClient = devCenterClient.getDeploymentEnvironmentsClient();
// Find available Projects
PagedIterable<DevCenterProject> projectListResponse = devCenterClient.listProjects();
for (DevCenterProject project: projectListResponse) {
System.out.println(project.getName());
}
// Use the first project in the list
DevCenterProject project = projectListResponse.iterator().next();
String projectName = project.getName();
// Fetch available environment definitions and environment types
PagedIterable<DevCenterCatalog> catalogs = environmentsClient.listCatalogs(projectName);
for (DevCenterCatalog catalog: catalogs) {
System.out.println(catalog.getName());
}
// Use the first catalog in the list
String catalogName = catalogs.iterator().next().getName();
PagedIterable<EnvironmentDefinition> environmentDefinitions = environmentsClient.listEnvironmentDefinitionsByCatalog(projectName, catalogName);
for (EnvironmentDefinition environmentDefinition: environmentDefinitions) {
System.out.println(environmentDefinition.getName());
}
// Use the first environment definition in the list
String envDefinitionName = environmentDefinitions.iterator().next().getName();
PagedIterable<DevCenterEnvironmentType> environmentTypes = environmentsClient.listEnvironmentTypes(projectName);
for (DevCenterEnvironmentType envType: environmentTypes) {
System.out.println(envType.getName());
}
// Use the first environment type in the list
String envTypeName = environmentTypes.iterator().next().getName();
System.out.println("Starting to create environment in project " + projectName + ", with catalog " + catalogName
+ ", environment definition " + envDefinitionName + ", environment type " + envTypeName);
// Create an environment
SyncPoller<DevCenterOperationDetails, DevCenterEnvironment> environmentCreateResponse
= environmentsClient.beginCreateOrUpdateEnvironment(projectName, "me",
new DevCenterEnvironment("myEnvironmentName", envTypeName, catalogName, envDefinitionName));
environmentCreateResponse.waitForCompletion();
DevCenterEnvironment environment = environmentCreateResponse.getFinalResult();
String environmentName = environment.getName();
System.out.println("Environment " + environmentName + "finished provisioning with status " + environment.getProvisioningState());
System.out.println("Start deleting environment " + environmentName);
// Delete the environment when we're finished:
SyncPoller<DevCenterOperationDetails, Void> environmentDeleteResponse =
environmentsClient.beginDeleteEnvironment(projectName, "me", environmentName);
environmentDeleteResponse.waitForCompletion();
System.out.println("Done deleting environment" + environmentName);
For details on contributing to this repository, see the contributing guide.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Azure SDK for Java geri bildirimi
Azure SDK for Java, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin:
Ekinlikler
Power BI DataViz Dünya Şampiyonası
14 Şub 16 - 31 Mar 16
4 giriş şansıyla bir konferans paketi kazanabilir ve Las Vegas'taki LIVE Grand Finale'e gidebilirsiniz
Daha fazla bilgi edinin