Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita71408b

Browse files
committed
Update analytics-api-examples.md
1 parentd09f265 commita71408b

File tree

1 file changed

+12
-305
lines changed

1 file changed

+12
-305
lines changed

‎_docs/api-examples/analytics-api-examples.md‎

Lines changed: 12 additions & 305 deletions
Original file line numberDiff line numberDiff line change
@@ -30,164 +30,34 @@ Currently, you do not need to select specific scopes for the API key.
3030

3131

3232

33-
##Getlist ofpipelines /pipelinesDropdown
33+
##Getallpipelines/pipelines by name
3434

35-
Getsthelist of pipelines - max number? what arethedefault settings?
36-
bypipeline name orID.
35+
Retrieve allthepipelines in your account, or filter by a pipeline name or part ofthename to retrieve a specific set of pipelines.
36+
Filteringbya nameretrieves those pipelines whose names matchorcontain the text in the filter string.
3737

3838

3939
###Headers
40-
The API authorization token must be included in the header of theAPI request. See[Authorization](#authorization).
40+
The API authorization token must be included in the header of theGET request. See[Authorization](#authorization).
4141

42-
```
43-
content-type: application/json
44-
Authorization: <TOKEN>
45-
```
46-
47-
###Request body
48-
49-
For a description of the fields, see[Request parameters](#request-parameters).
50-
51-
52-
53-
###Request example
54-
55-
The request is an HTTP GET request.
56-
57-
```
58-
GET https://g.codefresh.io/api/analytics/reports/pipelinesDropdown
59-
```
60-
###Response example
61-
62-
####Success
63-
Here's an example of the response for a successful request.
64-
65-
For each pipeline, the following data is returned.
66-
*`id`: The ID of the pipeline, generated when the pipeline was created.
67-
*`pipelineName`: The full name of the pipeline, including the project name, in the format`"<project-name>/<pipeline-name>"`.
68-
*`shortName`: The name of the pipeline, without the project name.
69-
*`isDeleted`: Indicates if the pipeline has been deleted from the account (`true`), or not (`false`).
70-
71-
```json
72-
{
73-
"data": [
74-
{
75-
"id":"61a893f69ff69e2cf086f12d",
76-
"pipelineName":"NimaCFProject/BasicPipeline",
77-
"shortName":"basicpipeline",
78-
"isDeleted":false
79-
},
80-
{
81-
"id":"632afb121899584bf3ec14f8",
82-
"pipelineName":"default/NimaCronLink",
83-
"shortName":"nimacronlink",
84-
"isDeleted":false
85-
},
86-
{
87-
"id":"6372180f39b06e632745555d",
88-
"pipelineName":"test",
89-
"shortName":"test",
90-
"isDeleted":false
91-
},
92-
{
93-
"id":"639ede86ec4d257410904ba7",
94-
"pipelineName":"NimaCFProject/StepTest",
95-
"shortName":"steptest",
96-
"isDeleted":false
97-
},
98-
{
99-
"id":"63b58656e8dad136b2a74927",
100-
"pipelineName":"my-first-project/My Pipeline",
101-
"shortName":"my pipeline",
102-
"isDeleted":false
103-
},
104-
{
105-
"id":"641fe3c0ba826b3e53d3bbbd",
106-
"pipelineName":"TestTags",
107-
"shortName":"testtags",
108-
"isDeleted":false
109-
},
110-
{
111-
"id":"641fe485ba826b8fe8d3bbbe",
112-
"pipelineName":"MyPipelines",
113-
"shortName":"mypipelines",
114-
"isDeleted":false
115-
},
116-
{
117-
"id":"6423edc4dbc27269e2693bb6",
118-
"pipelineName":"NimaCFProject/Restart",
119-
"shortName":"restart",
120-
"isDeleted":false
121-
},
122-
{
123-
"id":"642578967afcb3664998231a",
124-
"pipelineName":"AnnotatePipeline",
125-
"shortName":"annotatepipeline",
126-
"isDeleted":false
127-
},
128-
{
129-
"id":"64cb4160795de76fcd8b5b29",
130-
"pipelineName":"MyPipelines template",
131-
"shortName":"mypipelines template",
132-
"isDeleted":false
133-
},
134-
{
135-
"id":"64cb42f2993fc4da530b8756",
136-
"pipelineName":"mu",
137-
"shortName":"mu",
138-
"isDeleted":false
139-
},
14042

141-
{
142-
"id":"66f246ff58c8309825491a5a",
143-
"pipelineName":"Marvel/smoke-tests",
144-
"shortName":"smoke-tests",
145-
"isDeleted":false
146-
}
147-
]
148-
},
14943

150-
"timeDimensions": {}
151-
```
44+
###Endpoint
15245

153-
####Failure
154-
Here's an example of the
46+
`GET https://g.codefresh.io/api/analytics/reports/pipelinesDropdown&filters={"name":["pipeline_name"]}`
15547

156-
```
157-
{"statusCode":400,"message":"no changes found between source and destination applications","error":"Bad Request"}
158-
```
15948

160-
##Get list of pipeline by name
16149

162-
Get the list of pipelines that correspond to the name passed as the query parameter.
163-
You can either pass the complete name of the pipeline or a partial name. In which case, returns all pipelines including those characters.
164-
by pipeline name or ID.
50+
###Query parameters
16551

52+
`
16653

167-
###Headers
168-
The API authorization token must be included in the header of the API request. See[Authorization](#authorization).
169-
170-
```
171-
content-type: application/json
172-
Authorization: <TOKEN>
173-
```
174-
175-
###Request body
176-
177-
For a description of the fields, see[Request parameters](#request-parameters).
178-
179-
180-
181-
###Request example
54+
{: .table .table-bordered .table-hover}
55+
| Setting | Description | Data Type | Required/Optional
56+
|`name`| The name of the pipeline or a part of the name by which to filter the pipelines. For example, ??? retrieves only pipelines that match the whole name.`e-to-e` retrieves all pipelines that include`e-to-e` in their names.| string| Optional|
18257

183-
The request is an HTTP GET request.
18458

185-
```
186-
GET https://g.codefresh.io/api/analytics/reports/pipelinesDropdown/?filters={"name":["<pipeline-name>"]}
187-
```
188-
###Response example
18959

190-
####Success
60+
####Reponse
19161
Here's an example of the response for a successful request.
19262

19363
For each pipeline, the following data is returned.
@@ -288,171 +158,8 @@ Here's an example of the
288158

289159

290160

291-
##POST`/promotions/pullRequest`
292-
293-
Promotes the application from the source environment to the destination or target environment through a`pull request` as the promotion action.
294-
295-
###`pullRequest` request body
296-
297-
```
298-
{
299-
"srcAppId": {
300-
"runtime": "<runtime name>",
301-
"namespace": "<namespace>",
302-
"name": "<source-application-name>"
303-
},
304-
"destAppId": {
305-
"runtime": "<runtime-name>",
306-
"namespace": "<namespace>",
307-
"name": "<destination-application-name>"
308-
},
309-
"head": "<branch-of-destination-application>",
310-
"title": "<pr-title>",
311-
"description": "<pr-description",
312-
"commitMessage": "<commit-message-when-empty-uses-title>",
313-
"commitDescription": "<commit-description>",
314-
}"
315-
```
316-
317-
###`pullRequest` request example
318-
The request is formatted in curl.
319-
320-
```
321-
curl -X POST https://codefresh-hosted-gitops-runtime.com/api/promotions/pullRequest \
322-
--header "content-type: application/json" \
323-
--header "Authorization: 214ffb**************" \
324-
--data "{
325-
\"srcAppId\": {
326-
\"runtime\": \"codefresh\",
327-
\"namespace\": \"membership-staging\",
328-
\"name\": \"membership-staging\"
329-
},
330-
\"destAppId\": {
331-
\"runtime\": \"codefresh\",
332-
\"namespace\": \"membership-prod\",
333-
\"name\": \"membership-prod\"
334-
},
335-
\"head\": \"main\",
336-
\"title\": \"Merge new-accounts\",
337-
\"description\": \"Added new accounts and git sources\",
338-
\"commitMessage\": \"Merge new-accounts\",
339-
\"commitDescription\": \"Approved new accounts and git sources\",
340-
}"
341-
342-
```
343-
###`pullRequest` response example
344-
345-
####Success
346-
TBD
347-
348-
349-
####Failure
350-
TBD
351-
352161

353162

354-
##Request query parameters
355-
356-
{: .table .table-bordered .table-hover}
357-
| Parameter| Description|
358-
| ----------| --------|
359-
|`dateRange`| The time frame for which to send report data. This can be in the from-to format for a custom time frame, or a predefined fixed range.<br>For from-to date ranges, the format is`yyyy-mm-dd`. For example,`?dateRange=2024-04-30&dateRange=2023-08-01`. The from date must be earlier than the to date. <br>For fixed date ranges, use one of the following:<br>-`today`: Today's date.<br>-`Last 7 days`: <br>-`Last 30 days`:`dateRange=last%203%20month` (NIMA: need to find what are the fixed date ranges supported and how to add them?)|
360-
|`filter`||
361-
|`granularity`||
362-
363-
364-
<tableclass="table table-bordered table-hover"style="width:100%;">
365-
<colgroup>
366-
<col style="width: 10%;">
367-
<col style="width: 70%;">
368-
<col style="width: 10%;">
369-
<col style="width: 10%;">
370-
</colgroup>
371-
<thead>
372-
<tr>
373-
<th style="width: 10%;">Parameter</th>
374-
<th style="width: 70%;">Description</th>
375-
<th style="width: 10%;">Data Type</th>
376-
<th style="width: 10%;">Required/Optional</th>
377-
</tr>
378-
</thead>
379-
<tbody>
380-
<tr>
381-
<td rowspan="4"><code class="highlighter-rouge">dateRange</code></td>
382-
<td colspan="3">The application in the source environment to promote through the <code class="highlighter-rouge">runtime</code>, <code class="highlighter-rouge">namespace</code>, and <code class="highlighter-rouge">name</code> key-value pairs.</td>
383-
</tr>
384-
<tr>
385-
<td><code class="highlighter-rouge">srcAppId.runtime</code>: The name of the GitOps Runtime associated with the source application.</td>
386-
<td>String</td>
387-
<td>Required</td>
388-
</tr>
389-
<tr>
390-
<td><code class="highlighter-rouge">srcAppId.namespace</code>: The namespace where the source application is deployed.</td>
391-
<td>String</td>
392-
<td>Required</td>
393-
</tr>
394-
<tr>
395-
<td><code class="highlighter-rouge">srcAppId.name</code>: The name of the source application to be promoted.</td>
396-
<td>String</td>
397-
<td>Required</td>
398-
</tr>
399-
<tr>
400-
<td rowspan="4"><code class="highlighter-rouge">destAppId</code></td>
401-
<td colspan="3">The application in the destination environment to be promoted through the <code class="highlighter-rouge">runtime</code>, <code class="highlighter-rouge">namespace</code>, and <code class="highlighter-rouge">name</code> key-value pairs.</td>
402-
</tr>
403-
<tr>
404-
<td><code class="highlighter-rouge">destAppId.runtime</code>: The name of the GitOps Runtime associated with the application in the destination environment.</td>
405-
<td>String</td>
406-
<td>Required</td>
407-
</tr>
408-
<tr>
409-
<td><code class="highlighter-rouge">destAppId.namespace</code>: The namespace in the destination environment where the application being promoted is deployed.</td>
410-
<td>String</td>
411-
<td>Required</td>
412-
</tr>
413-
<tr>
414-
<td><code class="highlighter-rouge">destAppId.name</code>: The name of the application in the destination environment to be promoted.</td>
415-
<td>String</td>
416-
<td>Required</td>
417-
</tr>
418-
<tr>
419-
<td><code class="highlighter-rouge">message</code></td>
420-
<td>Applies to <code class="highlighter-rouge">commit</code> promotion actions.<br>The commit message to associate for the commit promotion action.(limits)</td>
421-
<td>String</td>
422-
<td>Required</td>
423-
</tr>
424-
<tr>
425-
<td><code class="highlighter-rouge">head</code></td>
426-
<td>Applies to <code class="highlighter-rouge">pull request</code> promotion actions.<br>The branch of the application in the destination environment on which to open the PR.</td>
427-
<td>String</td>
428-
<td>Required</td>
429-
</tr>
430-
<tr>
431-
<td><code class="highlighter-rouge">title</code></td>
432-
<td>Applies to <code class="highlighter-rouge">pull request</code> promotion actions.<br>The title of the pull request.</td>
433-
<td>String</td>
434-
<td>Required</td>
435-
</tr>
436-
<tr>
437-
<td><code class="highlighter-rouge">description</code></td>
438-
<td>Applies to <code class="highlighter-rouge">pull request</code> promotion actions.<br>Additional information describing the pull request.</td>
439-
<td>String</td>
440-
<td>Optional</td>
441-
</tr>
442-
<tr>
443-
<td><code class="highlighter-rouge">commitMessage</code></td>
444-
<td>Applies to <code class="highlighter-rouge">pull request</code> promotion actions.<br>The commit message when the pull request is approved.<br>If omitted, uses <code class="highlighter-rouge">title</code> instead. </td>
445-
<td>String</td>
446-
<td>Optional</td>
447-
</tr>
448-
<tr>
449-
<td><code class="highlighter-rouge">commitDescription</code></td>
450-
<td>Applies to <code class="highlighter-rouge">pull request</code> promotion actions.<br>Additional information on the commit message when the pull request is approved. </td>
451-
<td>String</td>
452-
<td>Optional</td>
453-
</tr>
454-
</tbody>
455-
</table>
456163

457164

458165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp