Skip to content

Commit aeb1c49

Browse files
authored
Azure Quantum client for Azure SDK for Java (Azure#18734)
Initial Azure Quantum client for Azure SDK for Java Authored-by: Angela Burton <anjbur@users.noreply.github.com>
1 parent 49446fe commit aeb1c49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3717
-0
lines changed

eng/code-quality-reports/src/main/resources/checkstyle/checkstyle-suppressions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ the main ServiceBusClientBuilder. -->
369369
<suppress checks="."
370370
files=".*[/\\]search[/\\]documents[/\\]models[/\\]((?!(IndexBatch|ValueFacetResult|RangeFacetResult|SearchableField|SimpleField|IndexBatchException|ScoringParameter)).*)"/>
371371

372+
<suppress checks="."
373+
files=".*[/\\]azure-quantum-jobs[/\\]src[/\\]main[/\\]java[/\\]"/>
374+
372375
<!-- Suppress external dependency check for jacksonwrapper overriding deserialize method -->
373376
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck"
374377
files="com.azure.core.implementation.serializer.jsonwrapper.jacksonwrapper.JacksonDeserializer.java"/>

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ com.azure:azure-messaging-servicebus;7.0.1;7.1.0-beta.1
8383
com.azure:azure-messaging-servicebus-track1-perf;1.0.0-beta.1;1.0.0-beta.1
8484
com.azure:azure-messaging-servicebus-track2-perf;1.0.0-beta.1;1.0.0-beta.1
8585
com.azure:azure-opentelemetry-exporter-azuremonitor;1.0.0-beta.2;1.0.0-beta.3
86+
com.azure:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.1
8687
com.azure:azure-search-documents;11.1.3;11.2.0-beta.4
8788
com.azure:azure-search-perf;1.0.0-beta.1;1.0.0-beta.1
8889
com.azure:azure-security-keyvault-administration;4.0.0-beta.3;4.0.0-beta.4

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
<!-- Metrics Advisor -->
6969
<module>sdk/metricsadvisor/azure-ai-metricsadvisor</module>
7070

71+
<!-- Quantum Jobs -->
72+
<module>sdk/quantum/azure-quantum-jobs</module>
73+
7174
<!-- Schema Registry -->
7275
<module>sdk/schemaregistry/azure-data-schemaregistry</module>
7376
<module>sdk/schemaregistry/azure-data-schemaregistry-avro</module>
@@ -237,6 +240,10 @@
237240
<title>Azure Key Vault</title>
238241
<packages>com.azure.security.keyvault*</packages>
239242
</group>
243+
<group>
244+
<title>Azure Quantum Jobs</title>
245+
<packages>com.azure.quantum.jobs*</packages>
246+
</group>
240247
<group>
241248
<title>Azure Search Documents</title>
242249
<packages>com.azure.search.documents*</packages>
@@ -585,6 +592,7 @@
585592
<module>sdk/tables</module>
586593
<module>sdk/template</module>
587594
<module>sdk/textanalytics</module>
595+
<module>sdk/quantum</module>
588596
</modules>
589597
</profile>
590598
</profiles>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
### New features
6+
Initial release of Azure.Quantum.Jobs. See [Getting Started](https://github.com/Azure/azure-sdk-for-java/blob/feature/azure-quantum-sdk/sdk/quantum/azure-quantum-jobs/README.md#getting-started) for more details.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Azure Quantum Jobs client library for Java
2+
3+
4+
## Getting started
5+
6+
## Key concepts
7+
8+
## Examples
9+
10+
## Troubleshooting
11+
12+
## Next steps
13+
14+
## Contributing
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.azure</groupId>
8+
<artifactId>azure-client-sdk-parent</artifactId>
9+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
10+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
11+
</parent>
12+
13+
<groupId>com.azure</groupId>
14+
<artifactId>azure-quantum-jobs</artifactId>
15+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-quantum-jobs;current} -->
16+
17+
<name>Microsoft Azure client library for Azure Quantum service</name>
18+
<description>This package contains the Microsoft Azure Quantum SDK.</description>
19+
<url>https://github.com/Azure/azure-sdk-for-java</url>
20+
21+
<distributionManagement>
22+
<site>
23+
<id>azure-java-build-docs</id>
24+
<url>${site.url}/site/${project.artifactId}</url>
25+
</site>
26+
</distributionManagement>
27+
28+
<scm>
29+
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
30+
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
31+
<tag>HEAD</tag>
32+
</scm>
33+
34+
<properties>
35+
<!-- require minimal code coverage until tests are added -->
36+
<jacoco.min.linecoverage>0.10</jacoco.min.linecoverage>
37+
</properties>
38+
39+
<dependencies>
40+
41+
<dependency>
42+
<groupId>com.azure</groupId>
43+
<artifactId>azure-core</artifactId>
44+
<version>1.12.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
45+
</dependency>
46+
47+
48+
49+
<!-- Test Dependencies -->
50+
<dependency>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter-params</artifactId>
53+
<version>5.6.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
54+
<scope>test</scope>
55+
</dependency>
56+
<dependency>
57+
<groupId>com.azure</groupId>
58+
<artifactId>azure-core-test</artifactId>
59+
<version>1.5.2</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
60+
<scope>test</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>com.azure</groupId>
64+
<artifactId>azure-identity</artifactId>
65+
<version>1.2.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
66+
<scope>test</scope>
67+
</dependency>
68+
69+
</dependencies>
70+
71+
</project>
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
//
5+
// Code generated by Microsoft (R) AutoRest Code Generator.
6+
7+
package com.azure.quantum.jobs;
8+
9+
import com.azure.core.annotation.ReturnType;
10+
import com.azure.core.annotation.ServiceClient;
11+
import com.azure.core.annotation.ServiceMethod;
12+
import com.azure.core.exception.HttpResponseException;
13+
import com.azure.core.http.rest.PagedFlux;
14+
import com.azure.core.http.rest.PagedResponse;
15+
import com.azure.core.http.rest.Response;
16+
import com.azure.quantum.jobs.implementation.JobsImpl;
17+
import com.azure.quantum.jobs.models.JobDetails;
18+
import com.azure.quantum.jobs.models.RestErrorException;
19+
import reactor.core.publisher.Mono;
20+
21+
/** Initializes a new instance of the asynchronous QuantumClient type. */
22+
@ServiceClient(builder = QuantumClientBuilder.class, isAsync = true)
23+
public final class JobsAsyncClient {
24+
private final JobsImpl serviceClient;
25+
26+
/**
27+
* Initializes an instance of Jobs client.
28+
*
29+
* @param serviceClient the service client implementation.
30+
*/
31+
JobsAsyncClient(JobsImpl serviceClient) {
32+
this.serviceClient = serviceClient;
33+
}
34+
35+
/**
36+
* List jobs.
37+
*
38+
* @throws HttpResponseException thrown if the request is rejected by server.
39+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
40+
* @return list of job details.
41+
*/
42+
@ServiceMethod(returns = ReturnType.COLLECTION)
43+
public Mono<PagedResponse<JobDetails>> listSinglePage() {
44+
return this.serviceClient.listSinglePageAsync();
45+
}
46+
47+
/**
48+
* List jobs.
49+
*
50+
* @throws HttpResponseException thrown if the request is rejected by server.
51+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
52+
* @return list of job details.
53+
*/
54+
@ServiceMethod(returns = ReturnType.COLLECTION)
55+
public PagedFlux<JobDetails> list() {
56+
return this.serviceClient.listAsync();
57+
}
58+
59+
/**
60+
* Get job by id.
61+
*
62+
* @param jobId Id of the job.
63+
* @throws IllegalArgumentException thrown if parameters fail the validation.
64+
* @throws RestErrorException thrown if the request is rejected by server.
65+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
66+
* @return job by id.
67+
*/
68+
@ServiceMethod(returns = ReturnType.SINGLE)
69+
public Mono<Response<JobDetails>> getWithResponse(String jobId) {
70+
return this.serviceClient.getWithResponseAsync(jobId);
71+
}
72+
73+
/**
74+
* Get job by id.
75+
*
76+
* @param jobId Id of the job.
77+
* @throws IllegalArgumentException thrown if parameters fail the validation.
78+
* @throws RestErrorException thrown if the request is rejected by server.
79+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
80+
* @return job by id.
81+
*/
82+
@ServiceMethod(returns = ReturnType.SINGLE)
83+
public Mono<JobDetails> get(String jobId) {
84+
return this.serviceClient.getAsync(jobId);
85+
}
86+
87+
/**
88+
* Create a job.
89+
*
90+
* @param jobId Id of the job.
91+
* @param job The complete metadata of the job to submit.
92+
* @throws IllegalArgumentException thrown if parameters fail the validation.
93+
* @throws RestErrorException thrown if the request is rejected by server.
94+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
95+
* @return job details.
96+
*/
97+
@ServiceMethod(returns = ReturnType.SINGLE)
98+
public Mono<Response<JobDetails>> createWithResponse(String jobId, JobDetails job) {
99+
return this.serviceClient.createWithResponseAsync(jobId, job);
100+
}
101+
102+
/**
103+
* Create a job.
104+
*
105+
* @param jobId Id of the job.
106+
* @param job The complete metadata of the job to submit.
107+
* @throws IllegalArgumentException thrown if parameters fail the validation.
108+
* @throws RestErrorException thrown if the request is rejected by server.
109+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
110+
* @return job details.
111+
*/
112+
@ServiceMethod(returns = ReturnType.SINGLE)
113+
public Mono<JobDetails> create(String jobId, JobDetails job) {
114+
return this.serviceClient.createAsync(jobId, job);
115+
}
116+
117+
/**
118+
* Cancel a job.
119+
*
120+
* @param jobId Id of the job.
121+
* @throws IllegalArgumentException thrown if parameters fail the validation.
122+
* @throws RestErrorException thrown if the request is rejected by server.
123+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
124+
* @return the completion.
125+
*/
126+
@ServiceMethod(returns = ReturnType.SINGLE)
127+
public Mono<Response<Void>> cancelWithResponse(String jobId) {
128+
return this.serviceClient.cancelWithResponseAsync(jobId);
129+
}
130+
131+
/**
132+
* Cancel a job.
133+
*
134+
* @param jobId Id of the job.
135+
* @throws IllegalArgumentException thrown if parameters fail the validation.
136+
* @throws RestErrorException thrown if the request is rejected by server.
137+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
138+
* @return the completion.
139+
*/
140+
@ServiceMethod(returns = ReturnType.SINGLE)
141+
public Mono<Void> cancel(String jobId) {
142+
return this.serviceClient.cancelAsync(jobId);
143+
}
144+
145+
/**
146+
* Get the next page of items.
147+
*
148+
* @param nextLink The nextLink parameter.
149+
* @throws IllegalArgumentException thrown if parameters fail the validation.
150+
* @throws HttpResponseException thrown if the request is rejected by server.
151+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
152+
* @return list of job details.
153+
*/
154+
@ServiceMethod(returns = ReturnType.COLLECTION)
155+
public Mono<PagedResponse<JobDetails>> listNextSinglePage(String nextLink) {
156+
return this.serviceClient.listNextSinglePageAsync(nextLink);
157+
}
158+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
//
5+
// Code generated by Microsoft (R) AutoRest Code Generator.
6+
7+
package com.azure.quantum.jobs;
8+
9+
import com.azure.core.annotation.ReturnType;
10+
import com.azure.core.annotation.ServiceClient;
11+
import com.azure.core.annotation.ServiceMethod;
12+
import com.azure.core.exception.HttpResponseException;
13+
import com.azure.core.http.rest.PagedIterable;
14+
import com.azure.quantum.jobs.implementation.JobsImpl;
15+
import com.azure.quantum.jobs.models.JobDetails;
16+
import com.azure.quantum.jobs.models.RestErrorException;
17+
18+
/** Initializes a new instance of the synchronous QuantumClient type. */
19+
@ServiceClient(builder = QuantumClientBuilder.class)
20+
public final class JobsClient {
21+
private final JobsImpl serviceClient;
22+
23+
/**
24+
* Initializes an instance of Jobs client.
25+
*
26+
* @param serviceClient the service client implementation.
27+
*/
28+
JobsClient(JobsImpl serviceClient) {
29+
this.serviceClient = serviceClient;
30+
}
31+
32+
/**
33+
* List jobs.
34+
*
35+
* @throws HttpResponseException thrown if the request is rejected by server.
36+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
37+
* @return list of job details.
38+
*/
39+
@ServiceMethod(returns = ReturnType.COLLECTION)
40+
public PagedIterable<JobDetails> list() {
41+
return this.serviceClient.list();
42+
}
43+
44+
/**
45+
* Get job by id.
46+
*
47+
* @param jobId Id of the job.
48+
* @throws IllegalArgumentException thrown if parameters fail the validation.
49+
* @throws RestErrorException thrown if the request is rejected by server.
50+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
51+
* @return job by id.
52+
*/
53+
@ServiceMethod(returns = ReturnType.SINGLE)
54+
public JobDetails get(String jobId) {
55+
return this.serviceClient.get(jobId);
56+
}
57+
58+
/**
59+
* Create a job.
60+
*
61+
* @param jobId Id of the job.
62+
* @param job The complete metadata of the job to submit.
63+
* @throws IllegalArgumentException thrown if parameters fail the validation.
64+
* @throws RestErrorException thrown if the request is rejected by server.
65+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
66+
* @return job details.
67+
*/
68+
@ServiceMethod(returns = ReturnType.SINGLE)
69+
public JobDetails create(String jobId, JobDetails job) {
70+
return this.serviceClient.create(jobId, job);
71+
}
72+
73+
/**
74+
* Cancel a job.
75+
*
76+
* @param jobId Id of the job.
77+
* @throws IllegalArgumentException thrown if parameters fail the validation.
78+
* @throws RestErrorException thrown if the request is rejected by server.
79+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
80+
*/
81+
@ServiceMethod(returns = ReturnType.SINGLE)
82+
public void cancel(String jobId) {
83+
this.serviceClient.cancel(jobId);
84+
}
85+
}

0 commit comments

Comments
 (0)