-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: data plane view support (#209)
* feat: rbac demo * feat: support api server * feat: update * feat: ready * feat: update * feat: update * test: update test case * feat: add feautres * docs: strings * test: update * feat: update command * feat: change to b type * feat: adjust treeitem view structure * feat: update * feat: update * feat: separate defines * feat: update * feat: update * test: add test cases * test: add test cases * fix: update the code according to comments * fix: update code according to comments * feat: update code * feat: update * feat: update * fix: update * test: fix comments and test cases * test: update * fix: update the uistring
- Loading branch information
1 parent
b120891
commit 9ff2c47
Showing
45 changed files
with
1,488 additions
and
188 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
import { RequestPrepareOptions, ServiceClient } from "@azure/ms-rest-js"; | ||
import { ISubscriptionContext } from "@microsoft/vscode-azext-utils"; | ||
import { ApiCenterApiVersionDefinitionExport, DataPlaneApiCenterApi, DataPlaneApiCenterApiVersion, DataPlaneApiCenterApiVersionDefinition } from "../ApiCenter/contracts"; | ||
import { APICenterDataPlaneRestAPIs } from "./ApiCenterRestAPIs"; | ||
export interface DataPlaneAccount { | ||
readonly domain: string; | ||
readonly tenantId: string; | ||
readonly clientId: string; | ||
} | ||
export class ApiCenterDataPlaneService { | ||
private susbcriptionContext: ISubscriptionContext; | ||
constructor(susbcriptionContext: ISubscriptionContext) { | ||
this.susbcriptionContext = susbcriptionContext; | ||
}; | ||
public async getApiCenterApis(): Promise<{ value: DataPlaneApiCenterApi[]; nextLink: string }> { | ||
const client = new ServiceClient(this.susbcriptionContext.credentials); | ||
let url = APICenterDataPlaneRestAPIs.ListApis(this.susbcriptionContext.subscriptionPath); | ||
const options: RequestPrepareOptions = { | ||
method: "GET", | ||
url: url, | ||
}; | ||
const response = await client.sendRequest(options); | ||
return response.parsedBody; | ||
}; | ||
public async getAPiCenterApiVersions(apiName: string): Promise<{ value: DataPlaneApiCenterApiVersion[]; nextLink: string }> { | ||
const client = new ServiceClient(this.susbcriptionContext.credentials); | ||
let url = APICenterDataPlaneRestAPIs.ListApiVersions(this.susbcriptionContext.subscriptionPath, apiName); | ||
const options: RequestPrepareOptions = { | ||
method: "GET", | ||
url: url, | ||
}; | ||
const response = await client.sendRequest(options); | ||
return response.parsedBody; | ||
}; | ||
public async getApiCenterApiDefinitions(apiName: string, apiVersion: string): Promise<{ value: DataPlaneApiCenterApiVersionDefinition[]; nextLink: string }> { | ||
const client = new ServiceClient(this.susbcriptionContext.credentials); | ||
let url = APICenterDataPlaneRestAPIs.ListApiDefinitions(this.susbcriptionContext.subscriptionPath, apiName, apiVersion); | ||
const options: RequestPrepareOptions = { | ||
method: "GET", | ||
url: url, | ||
}; | ||
const response = await client.sendRequest(options); | ||
return response.parsedBody; | ||
}; | ||
public async exportSpecification(apiName: string, | ||
apiVersionName: string, | ||
apiCenterApiVersionDefinitionName: string): Promise<ApiCenterApiVersionDefinitionExport> { | ||
const client = new ServiceClient(this.susbcriptionContext.credentials); | ||
const options: RequestPrepareOptions = { | ||
method: "POST", | ||
url: APICenterDataPlaneRestAPIs.ExportApiDefinitions(this.susbcriptionContext.subscriptionPath, apiName, apiVersionName, apiCenterApiVersionDefinitionName), | ||
}; | ||
const response = await client.sendRequest(options); | ||
return response.parsedBody; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.