@@ -32,61 +32,44 @@ settings to add a new public key.
32
32
Before we create our own user, all requests are perfomed using the default admin API key.
33
33
This example assumes that the ` ansible` template is already uploaded to the server.
34
34
35
- # ## 1. Create a new Concord project
36
-
37
- We are going to create a new project using the `ansible` project template. The `ansible` template
38
- will automatically add the necessary boilerplate - a workflow process definition to run our playbook
39
- and necessary runtime dependencies.
40
-
41
- ```
42
- curl -v \
43
- -H "Content-Type: application/json" \
44
- -H "Authorization: auBy4eDWrKWsyhiDp3AQiw" \
45
- -d '{ "name": "myProject", "cfg": { "template": "ansible" } }' \
46
- http://localhost:8001/api/v1/project
47
- ```
48
-
49
- ```json
50
- {
51
- "ok": true
52
- }
53
- ```
54
-
55
- ### 2. Create a new repository key
35
+ # ## 1. Create a new repository key
56
36
57
37
Please refer to the [Generate a new key pair](http://concord.walmart.com/docs/api/secret.html#generate-a-new-key-pair) document.
58
38
Use `mySecret` as a name of the key pair, it will be used on the next step.
59
39
60
- ### 3. Add a repository
40
+ # ## 2. Create a new Concord project
41
+
42
+ We are going to create a new project using the `ansible` project template. The `ansible` template
43
+ will automatically add the necessary boilerplate - a workflow process definition to run our playbook
44
+ and necessary runtime dependencies.
61
45
62
46
```
63
47
curl -v \
64
48
-H "Content-Type: application/json" \
65
49
-H "Authorization: auBy4eDWrKWsyhiDp3AQiw" \
66
- -d '{ "name": "myRepo ", "url": "[email protected] :my/repo.git", "secret": "mySecret" }' \
67
- http://localhost:8001/api/v1/project/myProject/repository
50
+ -d '{ "name": "
myProject ", "
cfg": { "template": "ansible" }, "repositories": { "myRepo": {" url": "
[email protected] : my /repo.git", "secret": "mySecret"
} } }'
\
51
+ http://localhost:8001/api/v1/org/Default/project
68
52
```
69
53
70
54
The `secret` parameters is the name of the key created on the step 2.
71
55
72
56
```json
73
57
{
74
- "ok" : true
58
+ "ok": true
75
59
}
76
60
```
77
61
62
+
78
63
### 4. Add a new user (optional)
79
64
80
65
```
81
66
curl -v \
82
67
-H "Content-Type: application/json" \
83
68
-H "Authorization: auBy4eDWrKWsyhiDp3AQiw" \
84
- -d '{ "username": "myUser", "permissions": [ "process:*:myProject" ] }' \
69
+ -d '{ "username": "myUser" }' \
85
70
http://localhost:8001/api/v1/user
86
71
```
87
72
88
- Check [ the permissions description] ( http://concord.walmart.com/docs/api/security.md#permissions ) in the documentation.
89
-
90
73
``` json
91
74
{
92
75
"ok" : true ,
@@ -96,13 +79,13 @@ Check [the permissions description](http://concord.walmart.com/docs/api/security
96
79
97
80
### 5. Create an API key (optional)
98
81
99
- Use the ` id ` value of the user created in the previous step.
82
+ Use the ` username ` value of the user created in the previous step.
100
83
101
84
```
102
85
curl -v \
103
86
-H "Content-Type: application/json" \
104
87
-H "Authorization: auBy4eDWrKWsyhiDp3AQiw" \
105
- -d '{ "userId ": "9458c42e-db11-11e6-8356-07c51e4e3ef5 " }' \
88
+ -d '{ "username ": "myUser " }' \
106
89
http://localhost:8001/api/v1/apikey
107
90
```
108
91
@@ -143,9 +126,12 @@ Make a call:
143
126
```
144
127
curl -v \
145
128
-H "Authorization: auBy4eDWrKWsyhiDp3AQiw" \
129
+ -F org=Default \
130
+ -F project=myProject \
131
+ -F repo=myRepo \
146
132
147
133
148
- http://localhost:8001/api/v1/process/myProject:myRepo
134
+ http://localhost:8001/api/v1/process
149
135
```
150
136
151
137
``` json
0 commit comments