List agents built but not deployed
client.Build.ListUndeployed(ctx) (*[]BuildListUndeployedResponse, error)
GET/v5/builds/undeployed
List agents that exist only as cloud builds and have no healthy deployment yet.
Unlike listing builds, this aggregates by agent: it returns one entry per distinct agent name whose
builds have never reached a healthy deploy, each carrying that agent’s most recent build and its total
build count. The result is a plain list (not paginated) and is limited to builds the caller is
permitted to read. Use this to surface agents that were built but still need to be deployed; use
GET /v5/builds when you need the individual build records instead.
List agents built but not deployed
package main
import (
"context"
"fmt"
"github.com/scaleapi/sgp-dev-go"
"github.com/scaleapi/sgp-dev-go/option"
)
func main() {
client := sgpdev.NewClient(
option.WithAPIKey("My API Key"),
option.WithAccountID("My Account ID"),
)
response, err := client.Build.ListUndeployed(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
[
{
"agent_name": "agent_name",
"latest_build": {
"id": "id",
"account_id": "account_id",
"agent_name": "agent_name",
"build_status": "queued",
"cloud_provider_build_id": "cloud_provider_build_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"image_name": "image_name",
"image_tag": "image_tag",
"source_commit": "source_commit",
"source_dirty": true,
"source_ref": "source_ref",
"source_repo": "source_repo",
"source_subpath": "source_subpath",
"working_tree_hash": "working_tree_hash",
"agent_id": "agent_id",
"build_end_time": "2019-12-27T18:11:19.117Z",
"build_start_time": "2019-12-27T18:11:19.117Z",
"image_url": "image_url",
"object": "agentex_cloud_build"
},
"total_builds": 0
}
]Returns Examples
[
{
"agent_name": "agent_name",
"latest_build": {
"id": "id",
"account_id": "account_id",
"agent_name": "agent_name",
"build_status": "queued",
"cloud_provider_build_id": "cloud_provider_build_id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"image_name": "image_name",
"image_tag": "image_tag",
"source_commit": "source_commit",
"source_dirty": true,
"source_ref": "source_ref",
"source_repo": "source_repo",
"source_subpath": "source_subpath",
"working_tree_hash": "working_tree_hash",
"agent_id": "agent_id",
"build_end_time": "2019-12-27T18:11:19.117Z",
"build_start_time": "2019-12-27T18:11:19.117Z",
"image_url": "image_url",
"object": "agentex_cloud_build"
},
"total_builds": 0
}
]