Skip to main content
PUT
/
resources
/
{name}
Updates a resource
curl --request PUT \
  --url https://use.hoop.dev/api/resources/{name} \
  --header 'Content-Type: */*' \
  --data '{
  "agent_id": "1837453e-01fc-46f3-9e4c-dcf22d395393",
  "env_vars": {},
  "name": "my-resource",
  "roles": [
    {
      "agent_id": "1837453e-01fc-46f3-9e4c-dcf22d395393",
      "command": [
        "/bin/bash"
      ],
      "name": "pgdemo",
      "secret": {},
      "subtype": "postgres",
      "type": "database"
    }
  ],
  "type": "mysql"
}'
{
  "agent_id": "1837453e-01fc-46f3-9e4c-dcf22d395393",
  "created_at": "2024-07-25T15:56:35.317601Z",
  "env_vars": {},
  "id": "15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7",
  "name": "my-resource",
  "type": "mysql",
  "updated_at": "2024-07-25T15:56:35.317601Z"
}

Path Parameters

name
string
required

The resource name

Body

*/*

The request body resource

agent_id
string<uuid>
required

The agent associated with this resource

Example:

"1837453e-01fc-46f3-9e4c-dcf22d395393"

env_vars
object
required

The resource environment variables

name
string
required

The resource name

Example:

"my-resource"

roles
object[]
required

The roles associated with this resource

type
string
required

The resource type

Example:

"mysql"

Response

OK

agent_id
string<uuid>
required

The agent associated with this resource

Example:

"1837453e-01fc-46f3-9e4c-dcf22d395393"

created_at
string

The time the resource was created

Example:

"2024-07-25T15:56:35.317601Z"

env_vars
object

The resource environment variables

id
string<uuid>

The resource ID

Example:

"15B5A2FD-0706-4A47-B1CF-B93CCFC5B3D7"

name
string

The resource name

Example:

"my-resource"

type
string

The resource type

Example:

"mysql"

updated_at
string

The time the resource was updated

Example:

"2024-07-25T15:56:35.317601Z"