Skip to content

Commit

Permalink
Add support for datasource gocd_agent_config
Browse files Browse the repository at this point in the history
Update documents for all datasource
  • Loading branch information
nikhilsbhat committed Mar 9, 2023
1 parent b75d332 commit c2aa61b
Show file tree
Hide file tree
Showing 43 changed files with 577 additions and 140 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
[![shields](https://img.shields.io/github/v/tag/nikhilsbhat/terraform-provider-gocd.svg)](https://github.com/nikhilsbhat/terraform-provider-gocd/tags)
[![shields](https://img.shields.io/github/downloads/nikhilsbhat/terraform-provider-gocd/total.svg)](https://github.com/nikhilsbhat/terraform-provider-gocd/releases)

Terraform provider for `GoCD` that helps in performing tasks on [GoCD](https://www.gocd.org/) server.
[terraform](https://www.terraform.io/) provider for [`GoCD`](https://www.gocd.org/) that helps in performing tasks on GoCD server.

48 changes: 48 additions & 0 deletions docs/data-sources/agent_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gocd_agent_config Data Source - terraform-provider-gocd"
subcategory: ""
description: |-
---

# gocd_agent_config (Data Source)
Fetch the details of the GoCD Agent by interacting with GET agent [api](https://api.gocd.org/current/#get-one-agent).

## Example Usage
```terraform
data "gocd_agent_config" "sample_agent" {
uuid = "4c92e7e3-8abd-4b02-a7eb-c46b2c7ac674"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `uuid` (String) The identifier of this agent.

### Optional

- `agent_config_state` (String) Whether an agent is enabled or not. Can be one of `Pending`, `Enabled`, `Disabled`.
- `agent_state` (String) The state an agent is in. Can be one of Idle, `Building`, `LostContact`, `Missing`, `Building`, `Unknown`.
- `agent_version` (String) The version of the agent.
- `build_details` (Map of String) The build details provides information like pipeline, stage and job if the build_state of the agent is `Building`
- `build_state` (String) If the agent is running a build, the state of the build on the agent. Can be one of Idle, `Building`, `Cancelled`, `Unknown`.
- `elastic_agent_id` (String) The elastic agent identifier of this agent. This attribute is only available if the agent is an elastic agent.
- `elastic_plugin_id` (String) The identifier of the elastic agent plugin that manages this agent instance. This attribute is only available if the agent is an elastic agent.
- `environments` (List of String) The set of environments that this agent belongs to.
- `free_space` (Number) The amount of free space in bytes.
- `hostname` (String) The hostname of the agent.
- `ip_address` (String) The IP address of the agent.
- `operating_system` (String) The operating system as reported by the agent.
- `resources` (List of String) The set of resources that this agent is tagged with (if agent is not an elastic agent).
- `sandbox` (String) The path where the agent will perform its builds.

### Read-Only

- `id` (String) The ID of this resource.


11 changes: 8 additions & 3 deletions docs/data-sources/auth_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_auth_config (Data Source)



Fetch the details of the specified authorization configuration by interacting with GET authorization configuration [api](https://api.gocd.org/current/#get-an-authorization-configuration).

## Example Usage
```terraform
data "gocd_auth_config" "password_file_config" {
profile_id = gocd_auth_config.password_file_config.id
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/cluster_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_cluster_profile (Data Source)



Fetch the details of the specified cluster profile by interacting with GET cluster profile [api](https://api.gocd.org/current/#get-a-cluster-profile).

## Example Usage
```terraform
data "gocd_cluster_profile" "ec2_cluster_profile" {
profile_id = gocd_cluster_profile.ec2_cluster_profile.id
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/config_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_config_repository (Data Source)



Fetch the details of the specified config repository by interacting with GET config repository [api](https://api.gocd.org/current/#get-a-config-repo).

## Example Usage
```terraform
data "gocd_config_repository" "sample_config_repo" {
profile_id = gocd_config_repository.sample_config_repo.id
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/elastic_agent_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_elastic_agent_profile (Data Source)



Fetch the details of the specified elastic profile by interacting with GET elastic profile [api](https://api.gocd.org/current/#get-an-elastic-agent-profile).

## Example Usage
```terraform
data "gocd_elastic_agent_profile" "sample_ec2" {
profile_id = gocd_elastic_agent_profile.sample_ec2.id
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_environment (Data Source)



Fetch the details of the specified environment by interacting with GET environment [api](https://api.gocd.org/current/#get-environment-config).

## Example Usage
```terraform
data "gocd_environment" "sample_environment" {
name = gocd_environment.sample_environment.id
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
14 changes: 11 additions & 3 deletions docs/data-sources/plugin_setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,27 @@ description: |-
---

# gocd_plugin_setting (Data Source)
Fetch the details of the specified plugin setting by interacting with GET plugin setting [api](https://api.gocd.org/current/#get-plugin-settings).



## Example Usage
```terraform
data "gocd_plugin_setting" "yaml_plugin_settings" {
plugin_id = "yaml.config.plugin"
}
```


<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `plugin_id` (String) The unique identifier of the plugin.

### Optional

- `configuration` (Block List) List of configuration required to configure the plugin settings. (see [below for nested schema](#nestedblock--configuration))
- `etag` (String) Etag used to track the plugin settings.
- `plugin_id` (String) The unique identifier of the plugin.

### Read-Only

Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/secret_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: |-
---

# gocd_secret_config (Data Source)



Fetch the details of the specified secret configuration by interacting with GET secret configuration [api](https://api.gocd.org/current/#get-a-secret-config).

## Example Usage
```terraform
data "gocd_secret_config" "sample_kube_secret_config" {
profile_id = "sample-kube-secret-config"
}
```


<!-- schema generated by tfplugindocs -->
Expand Down
3 changes: 3 additions & 0 deletions examples/agents_config.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "gocd_agent_config" "sample_agent" {
uuid = "4c92e7e3-8abd-4b02-a7eb-c46b2c7ac674"
}
6 changes: 5 additions & 1 deletion examples/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ output "sample_kube_secret_config" {

output "kubernetes_plugin" {
value = data.gocd_plugin_info.kubernetes_plugin
}
}

output "sample_agent_config" {
value = data.gocd_agent_config.sample_agent.hostname
}
12 changes: 6 additions & 6 deletions examples/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ terraform {
}

provider "gocd" {
base_url = "http://localhost:8153/go"
username = "admin"
password = "admin"
// auth_token = "d8fccbc997d04e917b1490af8e7bf46290ab8c99"
loglevel = "debug"
// skip_check = true
base_url = "http://localhost:8153/go"
username = "admin"
password = "admin"
// auth_token = "d8fccbc997d04e917b1490af8e7bf46290ab8c99"
loglevel = "debug"
// skip_check = true
}
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/mitchellh/mapstructure v1.5.0
github.com/nikhilsbhat/gocd-sdk-go v0.0.10-0.20230221063610-c7aae78b564b
github.com/nikhilsbhat/gocd-sdk-go v0.1.1-0.20230309041138-a419ad58c924
github.com/spf13/cast v1.5.0
)

require (
Expand Down Expand Up @@ -57,15 +58,14 @@ require (
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/zclconf/go-cty v1.12.1 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/grpc v1.50.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nikhilsbhat/gocd-sdk-go v0.0.10-0.20230221063610-c7aae78b564b h1:TjndaPTTJof+0PbIabNy2YekPp01eqROfGGPJhD9UjM=
github.com/nikhilsbhat/gocd-sdk-go v0.0.10-0.20230221063610-c7aae78b564b/go.mod h1:3XwSMe/nFH/I0Kt2+ToKKWFyD6yvJb4HaoP0dBHytY4=
github.com/nikhilsbhat/gocd-sdk-go v0.1.1-0.20230309041138-a419ad58c924 h1:WEiTpHnBVViVXjS4BEmj6lNF5ah1A1ts7lCmFUAqOFo=
github.com/nikhilsbhat/gocd-sdk-go v0.1.1-0.20230309041138-a419ad58c924/go.mod h1:3XwSMe/nFH/I0Kt2+ToKKWFyD6yvJb4HaoP0dBHytY4=
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k+Mg7cowZ8yv4Trqw9UsJby758=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
Expand Down Expand Up @@ -291,8 +291,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -323,16 +323,16 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
Expand Down
Loading

0 comments on commit c2aa61b

Please sign in to comment.