Skip to content

Sdk release planner prod test2 #21870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2642,5 +2642,6 @@ wayfinding
dryruns
Dryrun
dryrun
updateable
Discoverability
Precheck
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
emitters:
"@azure-tools/cadl-python":
"sdk-folder": sdk/sdkreleaseplannertest/azure-security-sdkreleaseplannertest
"package-version": "1.0.0b1"
"package-mode": "dataplane"
"basic-setup-py": true
"package-name": "azure-security-sdkreleaseplannertest"
"@azure-tools/cadl-csharp":
"sdk-folder": sdk/sdkreleaseplannertest/Azure.Security.SDKReleasePlannerTest/src
"@azure-tools/cadl-typescript":
"sdk-folder": sdk/sdkreleaseplannertest/sdkreleaseplannertest-rest
generateMetadata: true
generateTest: true
azureSdkForJs: true
packageDetails:
name: "@azure-rest/sdkreleaseplannertest-rest"
description: "Cadl Test Service"
version: "1.0.0-beta.1"
"@azure-tools/cadl-java":
"sdk-folder": sdk/sdkreleaseplannertest/azure-sdkreleaseplannertest
namespace: com.azure.sdkreleaseplannertest
"@azure-tools/cadl-autorest":
output-file: sdkreleaseplannertest.json
examples-directory: ./examples
azure-resource-provider-folder: specification/sdkreleaseplannertest/data-plane
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"operationId": "ConfidentialLedger_Get",
"title": "Complete a long running operation.",
"parameters": {
"operationId": "00000000-0000-0000-0000-000000000123",
"api-version": "2022-08-13"
},
"responses": {
"200": {}
}
}
257 changes: 257 additions & 0 deletions specification/sdkreleaseplannertest/SDKReleasePlannerTest/main.cadl
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
import "@cadl-lang/rest";
import "@cadl-lang/versioning";
import "@cadl-lang/openapi";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-autorest";

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
using Azure.Core;
using OpenAPI;

//
// ** Service description **
//

@service({
title: "SDK Release Planner Service",
version: "2022-08-13",
})
@useAuth(OAuth2Auth<[MyFlow]>)
@versionedDependency(Azure.Core.Versions.v1_0_Preview_1)
@server(
"{ledgerUri}",
"Confidential Ledger Service",
{
ledgerUri: uri,
}
)
namespace Azure.Security.SDKReleasePlannerTest;

@doc("Define the auth flow")
model MyFlow {
@doc("type of auth flow")
type: OAuth2FlowType.implicit;
@doc("authorizationUrl of auth flow")
authorizationUrl: "https://login.microsoftonline.com/common/v2.0/oauth2/authorize";
@doc("tokenUrl of auth flow")
tokenUrl: "https://login.microsoftonline.com/common/v2.0/oauth2/token";
@doc("scopes of auth flow")
scopes: ["https://confidential-ledger.azure.com/.default"];
}

//
// ** Parameter descriptions **
//

@doc("A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.")
model TransactionId is string;

@doc("The collectionId parameter definition.")
model CollectionIdParameter {
@query
@doc("The collection id.")
collectionId?: string;
}

//
// ** Model descriptions **
//

@resource("collections")
@doc("Identifier for collections.")
model CollectionModel {
@key
@doc("The collection id.")
collectionId: string;
}

@doc("Details about a ledger entry.")
@resource("transactions")
model LedgerEntry {
@doc("Contents of the ledger entry.")
contents: string;

@visibility("read")
@doc("The collection id.")
collectionId: string;

@key
@visibility("read")
@doc("A unique identifier for the state of the ledger. If returned as part of a LedgerEntry, it indicates the state from which the entry was read.")
transactionId: TransactionId;
}

// TODO: No way to set "x-ms-enum.name" right now
@doc("Represents an assignable role.")
enum LedgerUserRole {
Administrator,
Contributor,
Reader,
}

@resource("users")
@doc("Details about a Confidential ledger user.")
model LedgerUser {
@key
@doc("The user id, either an AAD object ID or certificate fingerprint.")
@extension("x-ms-skip-url-encoding", true)
userId: string;

@doc("The user's assigned role.")
assignedRole: LedgerUserRole;
}

@doc("The contents of a receipt.")
model ReceiptContents {
// Elided for now
}

// TODO: No way to set "x-ms-enum.name" right now
@doc("State of a ledger query.")
enum LedgerQueryState {
Loading,
Ready,
}

@doc("A receipt certifying the transaction at the specified id.")
model TransactionReceipt {
@doc("The receipt contents.")
receipt: ReceiptContents;

@doc("The state of the ledger query.")
state: LedgerQueryState;

@doc("The transaction ID.")
transactionId: TransactionId;
}

// TODO: No way to set "x-ms-enum.name" right now
@doc("Represents the state of the transaction.")
enum TransactionState {
Committed,
Pending,
}

@doc("Response returned to a query for the transaction status.")
model TransactionStatus {
@doc("The transaction state.")
state: TransactionState;

@doc("The transaction ID.")
transactionId: TransactionId;
}

@doc("Paginated ledger entries returned in response to a query.")
@pagedResult
model PagedLedgerEntries {
@doc("Array of ledger entries.")
@items
entries: LedgerEntry[];

@doc("State of the ledger query.")
state: LedgerQueryState;

@doc("Path from which to retrieve the next page of results.")
@nextLink
nextLink?: ResourceLocation<LedgerEntry>;
}

//
// ** Operations **
//

@route("/app")
namespace ConfidentialLedger {
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@summary("Retrieves a list of collection ids present in the Confidential Ledger")
@doc("Collection ids are user-created collections of ledger entries")
op listCollections is Azure.Core.Foundations.NonPagedResourceList<CollectionModel>;

// TODO: add return model
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@route("/enclaveQuotes")
@summary("Gets quotes for all nodes of the Confidential Ledger.")
@doc("A quote is an SGX enclave measurement that can be used to verify the validity of a node and its enclave.")
@get
op getEnclaveQuotes is Azure.Core.Foundations.Operation<{}, OkResponse>;

// TODO: add return model
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@route("/governance/constitution")
@summary("Gets the constitution used for governance.")
@doc("The constitution is a script that assesses and applies proposals from consortium members.")
@get
op getConstitution is Azure.Core.Foundations.Operation<{}, OkResponse>;

// TODO: add return model
#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service, we have a non-conforming operation."
@route("/governance/members")
@summary("Gets the consortium members.")
@doc("Consortium members can manage the Confidential Ledger.")
@get
op getConsortiumMembers is Azure.Core.Foundations.Operation<{}, OkResponse>;

#suppress "@azure-tools/cadl-azure-core/use-standard-operations" "This is an existing service with a non-standard list operation."
@summary("Gets ledger entries from a collection corresponding to a range.")
@doc("A collection id may optionally be specified. Only entries in the specified (or default) collection will be returned.")
op listLedgerEntries is Azure.Core.Foundations.ResourceList<LedgerEntry, {}, PagedLedgerEntries>;

@route("transactions")
@summary("Writes a ledger entry.")
@doc("A collection id may optionally be specified.")
@post
op createLedgerEntry is Azure.Core.ResourceCreateWithServiceProvidedName<
LedgerEntry,
{
parameters: CollectionIdParameter;
}
>;

@doc("Get a LedgerEntry")
@summary("Gets the ledger entry at the specified transaction id. A collection id may optionally be specified to indicate the collection from which to fetch the value.")
op getLedgerEntry is Azure.Core.ResourceRead<
LedgerEntry,
{
parameters: CollectionIdParameter;
}
>;

@get
@action("receipt")
@doc("Runs a custom action on LedgerEntry")
@summary("Gets a receipt certifying ledger contents at a particular transaction id.")
@segmentSeparator("/")
op getReceipt is Azure.Core.ResourceAction<LedgerEntry, {}, TransactionReceipt>;

@get
@action("status")
@doc("Runs a custom action on LedgerEntry")
@summary("Gets a receipt certifying ledger contents at a particular transaction id.")
@segmentSeparator("/")
op getTransactionStatus is Azure.Core.ResourceAction<LedgerEntry, {}, TransactionStatus>;

// TODO: There isn't a way to customize the action name at the moment
@get
@doc("Runs a custom action on LedgerEntry")
@summary("Gets the current value available in the ledger.")
@segmentSeparator("/")
op getCurrentLedgerEntry is Azure.Core.ResourceCollectionAction<
LedgerEntry,
CollectionIdParameter,
LedgerEntry
>;

@doc("Delete a LedgerUser")
@summary("Deletes a user from the Confidential Ledger.")
op deleteUser is Azure.Core.ResourceDelete<LedgerUser>;

@doc("Get a LedgerUser")
@summary("Gets a user.")
op getUser is Azure.Core.ResourceRead<LedgerUser>;

@doc("Creates or updates a LedgerUser")
@summary("Adds a user or updates a user's fields.")
op createOrUpdateUser is Azure.Core.ResourceCreateOrUpdate<LedgerUser>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "cadl-try",
"dependencies": {
"@azure-tools/cadl-autorest": "0.22.0",
"@azure-tools/cadl-azure-core": "0.9.0",
"@azure-tools/cadl-csharp": "0.1.8",
"@azure-tools/cadl-java": "0.1.0",
"@azure-tools/cadl-python": "0.4.10",
"@azure-tools/cadl-typescript": "1.0.0-beta.5",
"@cadl-lang/compiler": "0.37.0",
"@cadl-lang/openapi": "0.14.0",
"@cadl-lang/openapi3": "0.17.0",
"@cadl-lang/rest": "0.19.0",
"@cadl-lang/versioning": "0.10.0"
},
"private": true,
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": ""
}
Loading