Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Enhancements

* Adds `CreatedBy` relation to `AgentToken` by @jpadrianoGo [#1149](https://github.com/hashicorp/go-tfe/pull/1149)
* Adds `Logs` method to `QueryRuns`, which is EXPERIMENTAL, SUBJECT TO CHANGE, and may not be available to all users by @brandonc [#1186](https://github.com/hashicorp/go-tfe/pull/1186)
* Adds `CreatedAt` field to `AgentPool` by @jpadrianoGo [#1150](https://github.com/hashicorp/go-tfe/pull/1150)
* Adds `CreatedBy` relation to `AgentToken` by @jpadrianoGo [#1149](https://github.com/hashicorp/go-tfe/pull/1149)

# v1.90.0

Expand Down
10 changes: 6 additions & 4 deletions agent_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"net/url"
"time"
)

// Compile-time proof of interface implementation.
Expand Down Expand Up @@ -52,10 +53,11 @@ type AgentPoolList struct {

// AgentPool represents a HCP Terraform agent pool.
type AgentPool struct {
ID string `jsonapi:"primary,agent-pools"`
Name string `jsonapi:"attr,name"`
AgentCount int `jsonapi:"attr,agent-count"`
OrganizationScoped bool `jsonapi:"attr,organization-scoped"`
ID string `jsonapi:"primary,agent-pools"`
Name string `jsonapi:"attr,name"`
AgentCount int `jsonapi:"attr,agent-count"`
OrganizationScoped bool `jsonapi:"attr,organization-scoped"`
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`

// Relations
Organization *Organization `jsonapi:"relation,organization"`
Expand Down
17 changes: 17 additions & 0 deletions agent_pool_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,23 @@ func TestAgentPoolsRead(t *testing.T) {
})
}

func TestAgentPoolsReadCreatedAt(t *testing.T) {
client := testClient(t)
ctx := context.Background()

orgTest, orgTestCleanup := createOrganization(t, client)
defer orgTestCleanup()

upgradeOrganizationSubscription(t, client, orgTest)

pool, poolCleanup := createAgentPool(t, client, orgTest)
defer poolCleanup()

k, err := client.AgentPools.Read(ctx, pool.ID)
assert.NotEmpty(t, k.CreatedAt)
require.NoError(t, err)
}

func TestAgentPoolsUpdate(t *testing.T) {
client := testClient(t)
ctx := context.Background()
Expand Down
Loading