Skip to content

Commit 4ed8435

Browse files
update docs - specify which resources require admin token
1 parent 205d0ec commit 4ed8435

11 files changed

+33
-32
lines changed

codefresh/cfclient/user.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ func (client *Client) GetAllUsers() (*[]User, error) {
228228
var allUsers []User
229229

230230
for !bIsDone {
231-
var userPaginatedResp struct{Docs []User `json:"docs"`}
231+
var userPaginatedResp struct {
232+
Docs []User `json:"docs"`
233+
}
232234

233235
opts := RequestOptions{
234236
Path: fmt.Sprintf("/admin/user?limit=%d&page=%d", limitPerQuery, nPageIndex),
@@ -248,7 +250,7 @@ func (client *Client) GetAllUsers() (*[]User, error) {
248250
}
249251

250252
if len(userPaginatedResp.Docs) > 0 {
251-
allUsers = append(allUsers,userPaginatedResp.Docs...)
253+
allUsers = append(allUsers, userPaginatedResp.Docs...)
252254
nPageIndex++
253255
} else {
254256
bIsDone = true

codefresh/data_account_gitops_settings.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ func dataSourceAccountGitopsSettings() *schema.Resource {
1313
Read: dataSourceAccountGitopsSettingsRead,
1414
Schema: map[string]*schema.Schema{
1515
"id": {
16-
Type: schema.TypeString,
16+
Type: schema.TypeString,
1717
Description: "Account Id",
18-
Computed: true,
18+
Computed: true,
1919
},
2020
"name": {
21-
Type: schema.TypeString,
22-
Computed: true,
21+
Type: schema.TypeString,
22+
Computed: true,
2323
Description: "Account name for active account",
2424
},
2525
"git_provider": {
26-
Type: schema.TypeString,
27-
Computed: true,
26+
Type: schema.TypeString,
27+
Computed: true,
2828
Description: "Git provider name",
2929
},
3030
"git_provider_api_url": {
31-
Type: schema.TypeString,
32-
Computed: true,
31+
Type: schema.TypeString,
32+
Computed: true,
3333
Description: "Git provider API url",
3434
},
3535
"shared_config_repository": {
36-
Type: schema.TypeString,
37-
Computed: true,
36+
Type: schema.TypeString,
37+
Computed: true,
3838
Description: "Shared config repository url",
3939
},
4040
"admins": {

codefresh/resource_account_gitops_settings.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func resourceAccountGitopsSettings() *schema.Resource {
2424
Delete: resourceAccountGitopsSettingsDelete,
2525
Schema: map[string]*schema.Schema{
2626
"id": {
27-
Type: schema.TypeString,
27+
Type: schema.TypeString,
2828
Description: "Account Id",
29-
Computed: true,
29+
Computed: true,
3030
},
3131
"name": {
3232
Type: schema.TypeString,

docs/data-sources/idps.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
page_title: "codefresh_idps Data Source - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This data source retrieves all Identity Providers (IdPs) in the system.
5+
This data source retrieves all Identity Providers (IdPs) in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
66
---
77

88
# codefresh_idps (Data Source)
@@ -55,7 +55,7 @@ resource "codefresh_user" "user1" {
5555
idp_id = data.codefresh_idps.idp_azure.id
5656
sso = true
5757
}
58-
58+
5959
login {
6060
idp_id = data.codefresh_idps.local.id
6161
//sso = false
@@ -99,4 +99,4 @@ resource "codefresh_idp_accounts" "acc_idp" {
9999
- `cookie_key` (String)
100100
- `id` (String) The ID of this resource.
101101
- `scopes` (Set of String)
102-
- `tenant` (String)
102+
- `tenant` (String)

docs/data-sources/user.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |-
77

88
# codefresh_user (Data Source)
99

10-
This data source retrieves a user by email.
10+
This data source retrieves a user by email. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
1111

1212
## Example usage
1313

@@ -88,4 +88,4 @@ Read-Only:
8888

8989
Read-Only:
9090

91-
- `user_name` (String)
91+
- `user_name` (String)

docs/data-sources/users.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: |-
77

88
# codefresh_users (Data Source)
99

10-
This data source retrieves all users in the system.
10+
This data source retrieves all users in the system. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
1111

1212
## Example usage
1313

@@ -81,4 +81,4 @@ Read-Only:
8181

8282
Read-Only:
8383

84-
- `user_name` (String)
84+
- `user_name` (String)

docs/resources/account.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
page_title: "codefresh_account Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams.
5+
By creating different accounts for different teams within the same company a customer can achieve complete segregation of assets between the teams. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
66
---
77

88
# codefresh_account (Resource)
@@ -86,4 +86,4 @@ Optional:
8686
## Import
8787
```sh
8888
terraform import codefresh_account.test xxxxxxxxxxxxxxxxxxx
89-
```
89+
```

docs/resources/account_admins.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
page_title: "codefresh_account_admins Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
Use this resource to set a list of admins for any account.
5+
Use this resource to set a list of admins for any account. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
66
---
77

88
# codefresh_account_admins (Resource)
@@ -72,4 +72,4 @@ resource "codefresh_account_admins" "test" {
7272

7373
```sh
7474
terraform import codefresh_account_admins.test xxxxxxxxxxxxxxxxxxx
75-
```
75+
```

docs/resources/account_gitops_settings.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ resource "codefresh_account_gitops_settings" "gitops-settings" {
4141
- `id` (String) Account Id
4242
- `name` (String) Account name for active account
4343

44-
[!WARNING]
44+
~>
4545
Once internal config repository is cloned successfully by one or more runtimes it can no longer be changed and all attempted updates will fail.
4646
If you need to change the repository please contact Codefresh support.
4747

docs/resources/api_key.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
page_title: "codefresh_api_key Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
Manages an API Key tied to an Account and a User.
5+
Manages an API Key tied to an Account and a User. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
66
---
77

88
# codefresh_api_key (Resource)
99

1010
Manages an API Key tied to an Account and a User.
1111

12-
terraform-provider-codefresh itself uses an API key, passed as provider's attribute, but it's possible to use that API Key to generate a new one.
12+
terraform-provider-codefresh itself uses an API key, passed as provider's attribute, but it's possible to use that API Key to generate a new one.
1313
This resource requires Codefresh system admin permissions, hence is relevant for on-prem deployments of Codefresh only.
1414

1515

@@ -106,4 +106,4 @@ resource "codefresh_team" "team_1" {
106106
### Read-Only
107107

108108
- `id` (String) The ID of this resource.
109-
- `token` (String, Sensitive) The resulting API key.
109+
- `token` (String, Sensitive) The resulting API key.

docs/resources/user.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
page_title: "codefresh_user Resource - terraform-provider-codefresh"
33
subcategory: ""
44
description: |-
5-
This resource is used to manage a Codefresh user.
5+
This resource is used to manage a Codefresh user. Requires Codefresh admin token and hence is relevant only for on premise installations of Codefresh.
66
---
77

88
# codefresh_user (Resource)
@@ -43,7 +43,7 @@ resource "codefresh_user" "new" {
4343
idp_id = data.codefresh_idps.idp_azure.id
4444
sso = true
4545
}
46-
46+
4747
login {
4848
idp_id = data.codefresh_idps.local.id
4949
//sso = false
@@ -119,4 +119,3 @@ Read-Only:
119119
```sh
120120
terraform import codefresh_user.new xxxxxxxxxxxxxxxxxxx
121121
```
122-

0 commit comments

Comments
 (0)