Applies a resource plan
curl --request POST \
--url https://use.hoop.dev/api/resources/{name}/apply \
--header 'Content-Type: application/json' \
--data '
{
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"resource_name": "my-postgres"
}
'import requests
url = "https://use.hoop.dev/api/resources/{name}/apply"
payload = {
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"resource_name": "my-postgres"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sid: '5701046A-7B7A-4A78-ABB0-A24C95E6FE54', resource_name: 'my-postgres'})
};
fetch('https://use.hoop.dev/api/resources/{name}/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/resources/{name}/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sid' => '5701046A-7B7A-4A78-ABB0-A24C95E6FE54',
'resource_name' => 'my-postgres'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/resources/{name}/apply"
payload := strings.NewReader("{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/resources/{name}/apply")
.header("Content-Type", "application/json")
.body("{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/resources/{name}/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}"
response = http.request(request)
puts response.read_body{
"message": "failed obtaining blob stream: empty blob stream",
"resource_name": "my-postgres",
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"status": "success"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Resources
Applies a resource plan
Applies a previously created provisioning plan to a single resource. The plan session referenced by SID must have been created by the plan endpoint. On success, the resulting role and its credentials are synced as a connection.
POST
/
resources
/
{name}
/
apply
Applies a resource plan
curl --request POST \
--url https://use.hoop.dev/api/resources/{name}/apply \
--header 'Content-Type: application/json' \
--data '
{
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"resource_name": "my-postgres"
}
'import requests
url = "https://use.hoop.dev/api/resources/{name}/apply"
payload = {
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"resource_name": "my-postgres"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sid: '5701046A-7B7A-4A78-ABB0-A24C95E6FE54', resource_name: 'my-postgres'})
};
fetch('https://use.hoop.dev/api/resources/{name}/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://use.hoop.dev/api/resources/{name}/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sid' => '5701046A-7B7A-4A78-ABB0-A24C95E6FE54',
'resource_name' => 'my-postgres'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://use.hoop.dev/api/resources/{name}/apply"
payload := strings.NewReader("{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://use.hoop.dev/api/resources/{name}/apply")
.header("Content-Type", "application/json")
.body("{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://use.hoop.dev/api/resources/{name}/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"sid\": \"5701046A-7B7A-4A78-ABB0-A24C95E6FE54\",\n \"resource_name\": \"my-postgres\"\n}"
response = http.request(request)
puts response.read_body{
"message": "failed obtaining blob stream: empty blob stream",
"resource_name": "my-postgres",
"sid": "5701046A-7B7A-4A78-ABB0-A24C95E6FE54",
"status": "success"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}{
"message": "the error description"
}Path Parameters
The resource name
Body
application/json
The request body
Response
OK
Error message populated when status is "failed"; empty on success
Example:
"failed obtaining blob stream: empty blob stream"
The resource name this apply result is for
Example:
"my-postgres"
The session ID for tracking and auditing this apply execution
Example:
"5701046A-7B7A-4A78-ABB0-A24C95E6FE54"
Status of the apply execution
Available options:
success, failed Example:
"success"
Was this page helpful?