@@ -4,7 +4,8 @@ Aside from interacting via pull request comments, Atlantis could respond to a li
4
4
5
5
## Main Endpoints
6
6
7
- The API endpoints in this section are disabled by default, since these API endpoints could change the infrastructure directly.
7
+ The API endpoints in this section are disabled by default, since these API endpoints could change the infrastructure
8
+ directly.
8
9
To enable the API endpoints, ` api-secret ` should be configured.
9
10
10
11
:::tip Prerequisites
@@ -21,13 +22,14 @@ Execute [atlantis plan](using-atlantis.md#atlantis-plan) on the specified reposi
21
22
22
23
#### Parameters
23
24
24
- | Name | Type | Required | Description |
25
- | ------------| ---------| ----------| ------------------------------------------|
26
- | Repository | string | Yes | Name of the Terraform repository |
27
- | Ref | string | Yes | Git reference, like a branch name |
28
- | Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
29
- | Paths | Path | Yes | Paths to the projects to run the plan |
30
- | PR | int | No | Pull Request number |
25
+ | Name | Type | Required | Description |
26
+ | ------------| --------| ----------| --------------------------------------------------------------------------------------|
27
+ | Repository | string | Yes | Name of the Terraform repository |
28
+ | Ref | string | Yes | Git reference, like a branch name |
29
+ | Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
30
+ | Paths | Path | Yes | Paths to the projects to run the plan |
31
+ | Sha | string | No | SHA of the specific commit to checkout. This is not required but heavily encouraged. |
32
+ | PR | int | No | Pull Request number |
31
33
32
34
#### Path
33
35
@@ -49,6 +51,7 @@ curl --request POST 'https://<ATLANTIS_HOST_NAME>/api/plan' \
49
51
--data-raw ' {
50
52
"Repository": "repo-name",
51
53
"Ref": "main",
54
+ "Sha": "940222c757012e0922c5fc1e03d5574c5ce79994",
52
55
"Type": "Github",
53
56
"Paths": [{
54
57
"Directory": ".",
@@ -62,29 +65,29 @@ curl --request POST 'https://<ATLANTIS_HOST_NAME>/api/plan' \
62
65
63
66
``` json
64
67
{
65
- "Error" : null ,
66
- "Failure" : " " ,
67
- "ProjectResults" : [
68
- {
69
- "Command" : 1 ,
70
- "RepoRelDir" : " ." ,
71
- "Workspace" : " default" ,
72
- "Error" : null ,
73
- "Failure" : " " ,
74
- "PlanSuccess" : {
75
- "TerraformOutput" : " <redacted>" ,
76
- "LockURL" : " <redacted>" ,
77
- "RePlanCmd" : " atlantis plan -d ." ,
78
- "ApplyCmd" : " atlantis apply -d ." ,
79
- "HasDiverged" : false
80
- },
81
- "PolicyCheckSuccess" : null ,
82
- "ApplySuccess" : " " ,
83
- "VersionSuccess" : " " ,
84
- "ProjectName" : " "
85
- }
86
- ],
87
- "PlansDeleted" : false
68
+ "Error" : null ,
69
+ "Failure" : " " ,
70
+ "ProjectResults" : [
71
+ {
72
+ "Command" : 1 ,
73
+ "RepoRelDir" : " ." ,
74
+ "Workspace" : " default" ,
75
+ "Error" : null ,
76
+ "Failure" : " " ,
77
+ "PlanSuccess" : {
78
+ "TerraformOutput" : " <redacted>" ,
79
+ "LockURL" : " <redacted>" ,
80
+ "RePlanCmd" : " atlantis plan -d ." ,
81
+ "ApplyCmd" : " atlantis apply -d ." ,
82
+ "HasDiverged" : false
83
+ },
84
+ "PolicyCheckSuccess" : null ,
85
+ "ApplySuccess" : " " ,
86
+ "VersionSuccess" : " " ,
87
+ "ProjectName" : " "
88
+ }
89
+ ],
90
+ "PlansDeleted" : false
88
91
}
89
92
```
90
93
@@ -96,13 +99,14 @@ Execute [atlantis apply](using-atlantis.md#atlantis-apply) on the specified repo
96
99
97
100
#### Parameters
98
101
99
- | Name | Type | Required | Description |
100
- | ------------| --------| ----------| ------------------------------------------|
101
- | Repository | string | Yes | Name of the Terraform repository |
102
- | Ref | string | Yes | Git reference, like a branch name |
103
- | Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
104
- | Paths | Path | Yes | Paths to the projects to run the apply |
105
- | PR | int | No | Pull Request number |
102
+ | Name | Type | Required | Description |
103
+ | ------------| --------| ----------| --------------------------------------------------------------------------------------|
104
+ | Repository | string | Yes | Name of the Terraform repository |
105
+ | Ref | string | Yes | Git reference, like a branch name |
106
+ | Type | string | Yes | Type of the VCS provider (Github/Gitlab) |
107
+ | Paths | Path | Yes | Paths to the projects to run the apply |
108
+ | Sha | string | No | SHA of the specific commit to checkout. This is not required but heavily encouraged. |
109
+ | PR | int | No | Pull Request number |
106
110
107
111
#### Path
108
112
@@ -124,6 +128,7 @@ curl --request POST 'https://<ATLANTIS_HOST_NAME>/api/apply' \
124
128
--data-raw ' {
125
129
"Repository": "repo-name",
126
130
"Ref": "main",
131
+ "Sha": "940222c757012e0922c5fc1e03d5574c5ce79994",
127
132
"Type": "Github",
128
133
"Paths": [{
129
134
"Directory": ".",
@@ -137,29 +142,30 @@ curl --request POST 'https://<ATLANTIS_HOST_NAME>/api/apply' \
137
142
138
143
``` json
139
144
{
140
- "Error" : null ,
141
- "Failure" : " " ,
142
- "ProjectResults" : [
143
- {
144
- "Command" : 0 ,
145
- "RepoRelDir" : " ." ,
146
- "Workspace" : " default" ,
147
- "Error" : null ,
148
- "Failure" : " " ,
149
- "PlanSuccess" : null ,
150
- "PolicyCheckSuccess" : null ,
151
- "ApplySuccess" : " <redacted>" ,
152
- "VersionSuccess" : " " ,
153
- "ProjectName" : " "
154
- }
155
- ],
156
- "PlansDeleted" : false
145
+ "Error" : null ,
146
+ "Failure" : " " ,
147
+ "ProjectResults" : [
148
+ {
149
+ "Command" : 0 ,
150
+ "RepoRelDir" : " ." ,
151
+ "Workspace" : " default" ,
152
+ "Error" : null ,
153
+ "Failure" : " " ,
154
+ "PlanSuccess" : null ,
155
+ "PolicyCheckSuccess" : null ,
156
+ "ApplySuccess" : " <redacted>" ,
157
+ "VersionSuccess" : " " ,
158
+ "ProjectName" : " "
159
+ }
160
+ ],
161
+ "PlansDeleted" : false
157
162
}
158
163
```
159
164
160
165
## Other Endpoints
161
166
162
- The endpoints listed in this section are non-destructive and therefore don't require authentication nor special secret token.
167
+ The endpoints listed in this section are non-destructive and therefore don't require authentication nor special secret
168
+ token.
163
169
164
170
### GET /status
165
171
@@ -177,9 +183,9 @@ curl --request GET 'https://<ATLANTIS_HOST_NAME>/status'
177
183
178
184
``` json
179
185
{
180
- "shutting_down" : false ,
181
- "in_progress_operations" : 0 ,
182
- "version" : " 0.22.3"
186
+ "shutting_down" : false ,
187
+ "in_progress_operations" : 0 ,
188
+ "version" : " 0.22.3"
183
189
}
184
190
```
185
191
@@ -199,6 +205,6 @@ curl --request GET 'https://<ATLANTIS_HOST_NAME>/healthz'
199
205
200
206
``` json
201
207
{
202
- "status" : " ok"
208
+ "status" : " ok"
203
209
}
204
210
```
0 commit comments