Skip to content

Commit 9d15880

Browse files
authored
Merge branch 'live' into patch-1
2 parents b16a7a7 + dc4100c commit 9d15880

File tree

12 files changed

+941
-65
lines changed

12 files changed

+941
-65
lines changed

powerapps-docs/developer/common-data-service/TOC.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,20 @@
329329
href: use-source-control-solution-files.md
330330
- name: Package Deployer tool
331331
href: package-deployer/create-packages-package-deployer.md
332+
- name: Verify quality of solutions and packages
333+
items:
334+
- name: Use the PowerApps checker web API
335+
href: checker/webapi/overview.md
336+
- name: Invoke the analysis
337+
href: checker/webapi/analyze.md
338+
- name: Check for analysis status
339+
href: checker/webapi/check-status.md
340+
- name: Retrieve the list of rules
341+
href: checker/webapi/retrieve-rules.md
342+
- name: Retrieve the list of rulesets
343+
href: checker/webapi/retrieve-rulesets.md
344+
- name: Upload a file for analysis
345+
href: checker/webapi/upload-file.md
332346
- name: Publish your app on AppSource
333347
href: publish-app-appsource.md
334348
items:
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
title: "Invoke analysis | Microsoft Docs"
3+
description: "Learn how to form a POST request using the PowerApps checker web API to initiate the analysis request job."
4+
ms.custom: ""
5+
ms.date: 06/04/2019
6+
ms.service: powerapps
7+
ms.suite: ""
8+
ms.tgt_pltfrm: ""
9+
ms.topic: "article"
10+
applies_to:
11+
- "Dynamics 365 (online)"
12+
ms.assetid: a2c771f4-7eb6-4445-af2d-f775619ac3e8
13+
caps.latest.revision: 21
14+
author: "mhuguet" # GitHub ID
15+
ms.author: "mhuguet"
16+
ms.reviewer: "pehecke"
17+
manager: "maustinjones"
18+
search.audienceType:
19+
- developer
20+
search.app:
21+
- PowerApps
22+
- D365CE
23+
---
24+
25+
# Invoke analysis
26+
27+
[!INCLUDE [cc-beta-prerelease-disclaimer](../../../../includes/cc-beta-prerelease-disclaimer.md)]
28+
29+
Initiating an analysis job is done by submitting a `POST` request to the `analyze` route. Analysis can be a long running process that usually lasts longer than a minute. The API first does some basic validation, initiates the request on the backend by submitting a job, and then responds with a status code of 202 and a `Location` header or with the appropriate error details. The `Location` header value is a URL that can be used to check on the status of the request and to obtain the URL(s) of the result(s). There are various options through the `POST` action to taylor the job based on your criteria, such as the list of rules or rulesets, files to exclude from the analysis, and more. You can initiate the analysis using the following `[Geographical URL]/api/analyze?api-version=1.0`.
30+
31+
32+
> [!NOTE]
33+
> It is recommended to wait between 15 to 60 seconds between status checks. Analysis usually takes between 1 to 5 minutes to run.<br /> This API does require an OAuth token.
34+
35+
<a name="bkmk_headers"></a>
36+
37+
## Headers
38+
39+
|Name|Type|Expected value|Required?|
40+
|---|---|---|---|
41+
|Authorization|string|The OAuth 1 bearer token with Azure Active Directory (AAD) Application ID claim.|yes|
42+
|x-ms-tenant-id|GUID|The ID of the tenant for the application.|yes|
43+
|x-ms-correlation-id|GUID|The Identifier for the analysis run. You should provide the same ID for the entire execution (upload, analyze, status).|yes|
44+
|Accept|object|`application/json, application/x-ms-sarif-v2`|yes|
45+
|Accept-Language|string|The language code or codes (e.g,. en-US). The default is en-US. If multiple languages are provided, the first will be the primary. However, all translations (if the language is supported) will be included.|no
46+
47+
<a name="bkmk_body"></a>
48+
49+
## Body
50+
51+
### Commonly used options:
52+
53+
|Property|Type|Expected value|Required?|
54+
|---|---|---|---|
55+
|sasUriList|array of strings|A list of URIs that provides the service access to download a single solution, a zip file containing multiple solution files, or a package.|Yes|
56+
|ruleSets|array of custom|0 or more|No|
57+
|ruleSets.id|guid|The ID of the ruleset, which can be found by querying the ruleset API.|No, but this is usually what you would want to use. You must use either this or ruleCodes.|
58+
|ruleCodes.code|string|The ID of the desired rule, which can be found by querying the ruleset and rule APIs.|No, you must use either this or ruleSets.|
59+
|fileExclusions|array of strings|A list of file names or file name patterns to exclude. Support exists for using "*" as a wildcard in the beginning and/or end of a file name ( e.g.,\*jquery.dll and \*jquery\*).|No|
60+
61+
<a name="bkmk_responses"></a>
62+
63+
## Expected responses
64+
65+
|HTTP status code|Scenario|Result|
66+
|---|---|---|
67+
|202|Request for analysis was accepted and the status check URI was returned in the `Location` header|No result body
68+
|400|A non-zip file was sent, incorrect parameters, or a file was included with a virus|No result body|
69+
|409|A request with a duplicate `x-ms-correlation-id` header value was sent|No result body|
70+
71+
### Expected response headers
72+
73+
|Name|Type|Expected value|Required?|
74+
|---|---|---|---|
75+
|Location|Uri|URL to use in querying for the current status and to obtain the results|yes|
76+
77+
<a name="bkmk_analyzeExample"></a>
78+
79+
## Example: initiate an analysis
80+
81+
This is an example of initiating an analysis job with the _AppSource Certification_ ruleset, a single file, and excluding files that contain the text _jquery_ and _json_ in the name.
82+
83+
**Request**
84+
85+
```http
86+
POST [Geographical URI]/api/analyze?api-version=1.0
87+
Accept: application/json
88+
Content-Type: application/json; charset=utf-8
89+
x-ms-correlation-id: 9E378E56-6F35-41E9-BF8B-C0CC88E2B832
90+
x-ms-tenant-id: F2E60E49-CB87-4C24-8D4F-908813B22506
91+
92+
{
93+
"ruleSets": [{
94+
"id": "0ad12346-e108-40b8-a956-9a8f95ea18c9"
95+
}],
96+
"sasUriList": ["https://testenvfakelocation.blob.core.windows.net/mySolution.zip"],
97+
"fileExclusions": ["*jquery*", "*json*"]
98+
}
99+
```
100+
101+
**Response**
102+
103+
```http
104+
HTTP/1.1 202 Accepted
105+
Content-Type: application/json; charset=utf-8
106+
Location: [Geographical URI]/api/status/9E378E56-6F35-41E9-BF8B-C0CC88E2B832&api-version=1.0
107+
```
108+
109+
### See also
110+
111+
[Use the PowerApps checker web API](overview.md)<br />
112+
[Retrieve the list of rulesets](retrieve-rulesets.md)<br />
113+
[Retrieve the list of rules](retrieve-rules.md)<br />
114+
[Upload a file](upload-file.md)<br />
115+
[Check for analysis status](check-status.md)<br />
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: "Check for analysis status | Microsoft Docs"
3+
description: "Learn how to form a GET request using the PowerApps checker web API to check the status of an analysis request job."
4+
ms.custom: ""
5+
ms.date: 06/04/2019
6+
ms.service: powerapps
7+
ms.suite: ""
8+
ms.tgt_pltfrm: ""
9+
ms.topic: "article"
10+
applies_to:
11+
- "Dynamics 365 (online)"
12+
ms.assetid: 6e2abe2d-2205-4d15-9e0f-5975ccc0484e
13+
caps.latest.revision: 21
14+
author: "mhuguet" # GitHub ID
15+
ms.author: "mhuguet"
16+
ms.reviewer: "pehecke"
17+
manager: "maustinjones"
18+
search.audienceType:
19+
- developer
20+
search.app:
21+
- PowerApps
22+
- D365CE
23+
---
24+
25+
# Check for analysis status
26+
27+
[!INCLUDE [cc-beta-prerelease-disclaimer](../../../../includes/cc-beta-prerelease-disclaimer.md)]
28+
29+
A URL is returned as part of the `Location` header in response to a request to the `analyze` API. It is to be used to query via HTTP `GET` for the analysis job's status. When the analysis job is finished the response body will include the URL or list of URLs in which the results output can be downloaded. Keep calling this URI until an HTTP status code of 200 is returned. While the job is still running, an HTTP status code of 202 will be returned with the `Location` header containing this same URI that was returned from `analyze`. Once a 200 response is returned, the `resultFileUris` property will include the single or list of downloadable locations of the output, which is contained in a zip file. A [Static Analysis Results Interchange Format (SARIF)](https://sarifweb.azurewebsites.net) V2 formatted file is included within this zip download that is a `JSON` formatted file containing the results of the analysis. The response body will contain an `IssueSummary` object that contains a summary of the count of issues found.
30+
31+
> [!NOTE]
32+
> It is recommended to wait between 15 to 60 seconds between status checks. Analysis usually takes between 1 to 5 minutes to run.<br />
33+
> This API does require an OAuth token that must be a token for the same client application that initiated the analysis job.
34+
35+
<a name="bkmk_headers"></a>
36+
37+
## Headers
38+
39+
|Name|Type|Expected value|Required?|
40+
|---|---|---|---|
41+
|Authorization|string|The OAuth 1 bearer token with AAD Application ID claim.|yes|
42+
|x-ms-tenant-id|GUID|The ID of the tenant for the application.|yes|
43+
|x-ms-correlation-id|GUID|The identifier for the analysis run. You should provide the same Id for the entire execution (upload, analyze, status)|yes|
44+
45+
<a name="bkmk_responses"></a>
46+
47+
## Expected responses
48+
49+
|HTTP status code|Scenario|Result|
50+
|---|---|---|
51+
|200|One or more results were found|See the example below. One result will be returned.|
52+
|202|Still processing|See the example below. One result will be returned.|
53+
|403|Forbidden|The requestor is not the same as the originator of the request for analysis.|
54+
|404|Not found|Unable to find the analysis request with the reference provided in the URL.|
55+
56+
### Expected response headers
57+
58+
|Name|Type|Expected value|Required?|
59+
|---|---|---|---|
60+
|Location|uri|URI to use in querying for the current status and to obtain the results|yes|
61+
62+
### Expected response body
63+
64+
The following table outlines the structure of the response for each request (HTTP 200 or 202 response only).
65+
66+
|Property|Type|Expected value|Required?|
67+
|---|---|---|---|
68+
|privacyPolicy|string|The URI of the privacy policy.|Yes|
69+
|progress|int|A value ranging from 0-100 percentage complete, where 10 means that processing is approximately 10% complete.|Yes|
70+
|runCorrelationId|GUID|The request identifier that is included in each request. This can be used to correlate to the request, if needed.|Yes|
71+
|status|string|`InProgress` is returned when the job is still being processed. `Failed` is returned when there was a catastrophic issue processing the job on the server. There should be more details in the error property. `Finished` is returned when the job has completed successfully without issues. `FinishedWithErrors` is returned when the job has completed successfully, however, one or more rules failed to complete without error. This is purely a signal for you to know that the report may not be complete. Microsoft is aware of these issues in the backend and will work to get things diagnosed and addressed.|Yes|
72+
|resultFileUris|array of strings|A list of URIs that allow for direct download of the output. There should be one per file that was included in the original analyze API call.|No. This is only included when processing has completed.|
73+
|issueSummary|IssueSummary|Properties listed below|No. This is only included when processing has completed.|
74+
|issueSummary.criticalIssueCount|int|Count of issues identified having a critical severity in the result|Yes|
75+
|issueSummary.highIssueCount|int|Count of issues identified having a high severity in the result|Yes|
76+
|issueSummary.mediumIssueCount|int|Count of issues identified having a medium severity in the result|Yes|
77+
|issueSummary.lowIssueCount|int|Count of issues identified having a low severity in the result|Yes|
78+
|issueSummary.informationalIssueCount|int|Count of issues identified having an informational severity in the result|Yes|
79+
80+
<a name="bkmk_checkStatusDone"></a>
81+
82+
## Example: status check when done
83+
84+
This example issues a status check call with the result being a completion.
85+
86+
**Request**
87+
88+
```http
89+
GET [Geographical URI]/api/status/9E378E56-6F35-41E9-BF8B-C0CC88E2B832&api-version=1.0
90+
Accept: application/json
91+
Content-Type: application/json; charset=utf-8
92+
x-ms-correlation-id: 9E378E56-6F35-41E9-BF8B-C0CC88E2B832
93+
x-ms-tenant-id: F2E60E49-CB87-4C24-8D4F-908813B22506
94+
```
95+
96+
**Response**
97+
98+
```http
99+
HTTP/1.1 200 OK
100+
Content-Type: application/json; charset=utf-8
101+
102+
{
103+
"privacyPolicy":"https://go.microsoft.com/fwlink/?LinkID=310140",
104+
"progress":100,
105+
"resultFileUris":["https://fakeblob.blob.core.windows.net/report-files/mySolution.zip?sv=2017-11-09&sr=b&sig=xyz&se=2019-06-11T20%3A27%3A59Z&sp=rd"],"runCorrelationId":"9E378E56-6F35-41E9-BF8B-C0CC88E2B832","status":"Finished","issueSummary":
106+
{
107+
"informationalIssueCount":0,
108+
"lowIssueCount":0,
109+
"mediumIssueCount":302,
110+
"highIssueCount":30,
111+
"criticalIssueCount":0
112+
}
113+
}
114+
```
115+
116+
117+
### See also
118+
119+
[Use the PowerApps checker web API](overview.md)<br />
120+
[Retrieve the list of rulesets](retrieve-rulesets.md)<br />
121+
[Retrieve the list of rules](retrieve-rules.md)<br />
122+
[Upload a file](upload-file.md)<br />
123+
[Invoke analysis](analyze.md)<br />

0 commit comments

Comments
 (0)