Skip to content
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7943db2
Add .gitignore
vxfield Jan 20, 2021
0d0c2fb
add autogenerated code
Jan 21, 2021
fdce73c
add pom file; regenerate code with fluent:false
Jan 21, 2021
6b88dec
change naming; add preliminary tests
Jan 22, 2021
3c29b78
Add auth layer; working list test
Jan 25, 2021
04b9554
Add auth layer; working list test (#18796)
anjbur Jan 26, 2021
0a333c9
add dependency scope
Jan 26, 2021
3d7b32a
Merge branch 'feature/azure-quantum-sdk' of github.com:Azure/azure-sd…
Jan 26, 2021
13572b9
cleanup
Jan 26, 2021
2ddf645
add ci.yml; update pom.xml
Jan 26, 2021
5428b34
move and update ci.yml
Jan 26, 2021
f164859
move pom.xml to root
Jan 26, 2021
63a015f
update pom.xml and ci.yml
Jan 26, 2021
6ed50c0
regenerate code with authentication
Jan 26, 2021
ee87036
add credentials code
Jan 26, 2021
1fcc15d
add module-info.java
Jan 27, 2021
7dedc8e
add second pom.xml
Jan 27, 2021
1504474
add parent to pom.xml
Jan 27, 2021
23fc441
add quantum module to root pom.xml
Jan 27, 2021
f9d7530
update root pom.xml
Jan 27, 2021
02b77fa
update project pom
Jan 27, 2021
616c13c
remove comment at start
Jan 27, 2021
649f771
update versions, add maven-enforcer-plugin
Jan 27, 2021
3a3696a
fix versioning
Jan 27, 2021
47887b3
add README, CHANGELOG
Jan 27, 2021
777ce4e
add tests.yml
Jan 27, 2021
d3204fb
fix readme
Jan 27, 2021
2aa059a
fix changelong
Jan 27, 2021
3909fc4
update changelog
Jan 27, 2021
e156c52
Update CHANGELOG.md
vxfield Jan 27, 2021
138009b
update version, skip test coverage
Jan 27, 2021
6e3c632
Merge branch 'feature/azure-quantum-sdk' of github.com:Azure/azure-sd…
Jan 27, 2021
19fb0ff
add runtime/compile scopes to pom.xml
Jan 27, 2021
c793d3e
prune pom.xml
Jan 27, 2021
9d8cdd8
add back dependency
Jan 27, 2021
08216c4
suppress alerts on generated code
Jan 28, 2021
c0d5df7
only suppress generated code
Jan 28, 2021
76f0506
add playback tests
Jan 28, 2021
8967268
fix header on tests
Jan 28, 2021
04da2b7
PR comment fixes
Jan 28, 2021
b455895
PR comment fixes
Jan 28, 2021
2d13b53
fix pom.xml
Jan 28, 2021
74d72a5
PR comments
Jan 29, 2021
9970901
resolve PR comment
Jan 29, 2021
1638e0b
fix version file
Jan 29, 2021
e646d16
fix tests.yml
Jan 29, 2021
ccaef0e
fix groupId in ci.yml
Jan 29, 2021
95649a8
change from no test coverage to minimal coverage required
Jan 29, 2021
8fad6c0
resolve PR comments
Jan 29, 2021
333827f
remove unused imports
Jan 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@ the main ServiceBusClientBuilder. -->
<suppress checks="."
files=".*[/\\]search[/\\]documents[/\\]models[/\\]((?!(IndexBatch|ValueFacetResult|RangeFacetResult|SearchableField|SimpleField|IndexBatchException|ScoringParameter)).*)"/>

<suppress checks="."
files=".*[/\\]azure-quantum-jobs[/\\]src[/\\]main[/\\]java[/\\]"/>

<!-- Suppress external dependency check for jacksonwrapper overriding deserialize method -->
<suppress checks="com.azure.tools.checkstyle.checks.ExternalDependencyExposedCheck"
files="com.azure.core.implementation.serializer.jsonwrapper.jacksonwrapper.JacksonDeserializer.java"/>
Expand Down
1 change: 1 addition & 0 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ com.azure:azure-storage-internal-avro;12.0.2;12.1.0-beta.1
com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-storage-queue;12.8.0;12.9.0-beta.1
com.azure:perf-test-core;1.0.0-beta.1;1.0.0-beta.1
com.azure.quantum.jobs:azure-quantum-jobs;1.0.0-beta.1;1.0.0-beta.1
com.azure.spring:azure-spring-cloud-appconfiguration-config-web;1.2.8-beta.1;1.2.8-beta.1
com.azure.spring:azure-spring-cloud-appconfiguration-config;1.2.8-beta.1;1.2.8-beta.1
com.azure.spring:azure-spring-cloud-feature-management-web;1.2.8-beta.1;1.2.8-beta.1
Expand Down
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
<!-- Metrics Advisor -->
<module>sdk/metricsadvisor/azure-ai-metricsadvisor</module>

<!-- Quantum Jobs -->
<module>sdk/quantum/azure-quantum-jobs</module>

<!-- Schema Registry -->
<module>sdk/schemaregistry/azure-data-schemaregistry</module>
<module>sdk/schemaregistry/azure-data-schemaregistry-avro</module>
Expand Down Expand Up @@ -237,6 +240,10 @@
<title>Azure Key Vault</title>
<packages>com.azure.security.keyvault*</packages>
</group>
<group>
<title>Azure Quantum Jobs</title>
<packages>com.azure.quantum.jobs*</packages>
</group>
<group>
<title>Azure Search Documents</title>
<packages>com.azure.search.documents*</packages>
Expand Down Expand Up @@ -585,6 +592,7 @@
<module>sdk/tables</module>
<module>sdk/template</module>
<module>sdk/textanalytics</module>
<module>sdk/quantum</module>
Comment thread
anjbur marked this conversation as resolved.
</modules>
</profile>
</profiles>
Expand Down
6 changes: 6 additions & 0 deletions sdk/quantum/azure-quantum-jobs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Release History

## 1.0.0-beta.1 (Unreleased)

### New features
- Initial preview of Azure.Quantum.Jobs
Comment thread
anjbur marked this conversation as resolved.
Outdated
98 changes: 98 additions & 0 deletions sdk/quantum/azure-quantum-jobs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Azure Quantum Jobs client library for Java

Use the guidelines in each section of this template to ensure consistency and readability of your README. The README resides in your package's GitHub repository at the root of its directory within the repo. It's also used as the package distribution page (NuGet, PyPi, npm, etc.) and as a Quickstart on docs.microsoft.com.
Comment thread
anjbur marked this conversation as resolved.
Outdated

**Title**: The H1 of your README should be in the format: `# [Product Name] client library for [Language]`

* All headings, including the H1, should use **sentence-style capitalization**. Refer to the [Microsoft Style Guide][style-guide-msft].
* Example: `# Azure Batch client library for Python`
Comment thread
anjbur marked this conversation as resolved.
Outdated

**Introduction**: The introduction appears directly under the title (H1) of your README.

* **DO NOT** use an "Introduction" or "Overview" heading (H2) for this section.
* First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://docs.microsoft.com/azure/cosmos-db/)).
* Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package.

> TIP: Your README should be as **brief** as possible but **no more brief** than necessary to get a developer new to Azure, the service, or the package up and running quickly. Keep it brief, but include everything a developer needs to make their first API call successfully.

## Getting started

This section should include everything a developer needs to do to install and create their first client connection *very quickly*.

### Install the package

First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `pip install package-name`, but should enable a developer to successfully install the package from NuGet, pip, npm, Maven, or even cloning a GitHub repository.

Include a **Prerequisites** line after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:

**Prerequisites**: You must have an [Azure subscription](https://azure.microsoft.com/free/), [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API), and [Python 3.6+](https://www.python.org/downloads/) to use this package.

### Authenticate the client

If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.

For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.

## Key concepts

The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.

## Examples

Include code snippets and short descriptions for each task you listed in the [Introduction](#introduction) (the bulleted list). Briefly explain each operation, but include enough clarity to explain complex or otherwise tricky operations.

If possible, use the same example snippets that your in-code documentation uses. For example, use the snippets in your `examples.py` that Sphinx ingests via its [literalinclude](https://www.sphinx-doc.org/en/1.5/markup/code.html?highlight=code%20examples#includes) directive. The `examples.py` file containing the snippets should reside alongside your package's code, and should be tested in an automated fashion.

Each example in the *Examples* section starts with an H3 that describes the example. At the top of this section, just under the *Examples* H2, add a bulleted list linking to each example H3. Each example should deep-link to the types and/or members used in the example.

* [Create the thing](#create-the-thing)
* [Get the thing](#get-the-thing)
* [List the things](#list-the-things)

### Create the thing

Use the `create_thing` method to create a Thing reference; this method does not make a network call. To persist the Thing in the service, call `Thing.save`.

```Python
thing = client.create_thing(id, name)
thing.save()
```
Comment thread
anjbur marked this conversation as resolved.
Outdated

### Get the thing

The `get_thing` method retrieves a Thing from the service. The `id` parameter is the unique ID of the Thing, not its "name" property.

```Python
thing = client.get_thing(id)
```

### List the things

Use `list_things` to get one or more Thing objects from the service. If there are no Things available, a `404` exception is thrown (see [Troubleshooting](#troubleshooting) for details on handling exceptions).

```Python
things = client.list_things()
```

## Troubleshooting

Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.

Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.

If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.

## Next steps

* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
* If appropriate, point users to other packages that might be useful.
* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.

## Contributing

This is a template, but your SDK readme should include details on how to contribute code to the repo/package.

<!-- LINKS -->
[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Ftemplate%2Fazure-sdk-template%2FREADME.png)
71 changes: 71 additions & 0 deletions sdk/quantum/azure-quantum-jobs/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>

<groupId>com.azure</groupId>
<artifactId>azure-quantum-jobs</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-quantum-jobs;current} -->

<name>Microsoft Azure client library for Azure Quantum service</name>
<description>This package contains the Microsoft Azure Quantum SDK.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<distributionManagement>
<site>
<id>azure-java-build-docs</id>
<url>${site.url}/site/${project.artifactId}</url>
</site>
</distributionManagement>

<scm>
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url>
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
<tag>HEAD</tag>
</scm>

<properties>
<!-- quantum jobs temporarily skipping code coverage until tests are added -->
<jacoco.skip.coverage.check>true</jacoco.skip.coverage.check>
Comment thread
anjbur marked this conversation as resolved.
Outdated
</properties>

<dependencies>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Comment thread
anjbur marked this conversation as resolved.
<version>1.12.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>



<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.6.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.5.2</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.2.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.quantum.jobs;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.Response;
import com.azure.quantum.jobs.implementation.JobsImpl;
import com.azure.quantum.jobs.models.JobDetails;
import com.azure.quantum.jobs.models.RestErrorException;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous QuantumClient type. */
@ServiceClient(builder = QuantumClientBuilder.class, isAsync = true)
public final class JobsAsyncClient {
private final JobsImpl serviceClient;

/**
* Initializes an instance of Jobs client.
*
* @param serviceClient the service client implementation.
*/
JobsAsyncClient(JobsImpl serviceClient) {
this.serviceClient = serviceClient;
}

/**
* List jobs.
*
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of job details.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public Mono<PagedResponse<JobDetails>> listSinglePage() {
return this.serviceClient.listSinglePageAsync();
}

/**
* List jobs.
*
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of job details.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<JobDetails> list() {
return this.serviceClient.listAsync();
}

/**
* Get job by id.
*
* @param jobId Id of the job.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return job by id.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<JobDetails>> getWithResponse(String jobId) {
return this.serviceClient.getWithResponseAsync(jobId);
}

/**
* Get job by id.
*
* @param jobId Id of the job.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return job by id.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<JobDetails> get(String jobId) {
return this.serviceClient.getAsync(jobId);
}

/**
* Create a job.
*
* @param jobId Id of the job.
* @param job The complete metadata of the job to submit.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return job details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<JobDetails>> createWithResponse(String jobId, JobDetails job) {
return this.serviceClient.createWithResponseAsync(jobId, job);
}

/**
* Create a job.
*
* @param jobId Id of the job.
* @param job The complete metadata of the job to submit.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return job details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<JobDetails> create(String jobId, JobDetails job) {
return this.serviceClient.createAsync(jobId, job);
}

/**
* Cancel a job.
*
* @param jobId Id of the job.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> cancelWithResponse(String jobId) {
return this.serviceClient.cancelWithResponseAsync(jobId);
}

/**
* Cancel a job.
*
* @param jobId Id of the job.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws RestErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Void> cancel(String jobId) {
return this.serviceClient.cancelAsync(jobId);
}

/**
* Get the next page of items.
*
* @param nextLink The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of job details.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public Mono<PagedResponse<JobDetails>> listNextSinglePage(String nextLink) {
return this.serviceClient.listNextSinglePageAsync(nextLink);
}
}
Loading