Pular para o conteúdo principal
PUT
/
v1
/
organizations
/
{organization_id}
/
reporting-groups
/
{reporting_group_id}
/
agent-versions
Atualizar configuração de versões de agente
curl --request PUT \
  --url https://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_auto_update": false,
  "versions": {
    "windows_cp": {
      "early": "latest",
      "production": "latest"
    },
    "windows": {
      "early": "2.31.0",
      "production": "2.30.4"
    },
    "macos": {
      "early": "latest",
      "production": "1.10.0"
    },
    "linux": {
      "early": "latest",
      "production": "1.12.0"
    }
  }
}
'
import requests

url = "https://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions"

payload = {
    "agent_auto_update": False,
    "versions": {
        "windows_cp": {
            "early": "latest",
            "production": "latest"
        },
        "windows": {
            "early": "2.31.0",
            "production": "2.30.4"
        },
        "macos": {
            "early": "latest",
            "production": "1.10.0"
        },
        "linux": {
            "early": "latest",
            "production": "1.12.0"
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    agent_auto_update: false,
    versions: {
      windows_cp: {early: 'latest', production: 'latest'},
      windows: {early: '2.31.0', production: '2.30.4'},
      macos: {early: 'latest', production: '1.10.0'},
      linux: {early: 'latest', production: '1.12.0'}
    }
  })
};

fetch('https://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions', 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://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'agent_auto_update' => false,
    'versions' => [
        'windows_cp' => [
                'early' => 'latest',
                'production' => 'latest'
        ],
        'windows' => [
                'early' => '2.31.0',
                'production' => '2.30.4'
        ],
        'macos' => [
                'early' => 'latest',
                'production' => '1.10.0'
        ],
        'linux' => [
                'early' => 'latest',
                'production' => '1.12.0'
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "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://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions"

	payload := strings.NewReader("{\n  \"agent_auto_update\": false,\n  \"versions\": {\n    \"windows_cp\": {\n      \"early\": \"latest\",\n      \"production\": \"latest\"\n    },\n    \"windows\": {\n      \"early\": \"2.31.0\",\n      \"production\": \"2.30.4\"\n    },\n    \"macos\": {\n      \"early\": \"latest\",\n      \"production\": \"1.10.0\"\n    },\n    \"linux\": {\n      \"early\": \"latest\",\n      \"production\": \"1.12.0\"\n    }\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	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.put("https://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"agent_auto_update\": false,\n  \"versions\": {\n    \"windows_cp\": {\n      \"early\": \"latest\",\n      \"production\": \"latest\"\n    },\n    \"windows\": {\n      \"early\": \"2.31.0\",\n      \"production\": \"2.30.4\"\n    },\n    \"macos\": {\n      \"early\": \"latest\",\n      \"production\": \"1.10.0\"\n    },\n    \"linux\": {\n      \"early\": \"latest\",\n      \"production\": \"1.12.0\"\n    }\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.flexxible.net/v1/organizations/{organization_id}/reporting-groups/{reporting_group_id}/agent-versions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"agent_auto_update\": false,\n  \"versions\": {\n    \"windows_cp\": {\n      \"early\": \"latest\",\n      \"production\": \"latest\"\n    },\n    \"windows\": {\n      \"early\": \"2.31.0\",\n      \"production\": \"2.30.4\"\n    },\n    \"macos\": {\n      \"early\": \"latest\",\n      \"production\": \"1.10.0\"\n    },\n    \"linux\": {\n      \"early\": \"latest\",\n      \"production\": \"1.12.0\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "agent_auto_update": false,
  "versions": {
    "windows_cp": {
      "early": "latest",
      "production": "latest"
    },
    "windows": {
      "early": "2.31.0",
      "production": "2.30.4"
    },
    "macos": {
      "early": "latest",
      "production": "1.10.0"
    },
    "linux": {
      "early": "latest",
      "production": "1.12.0"
    }
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "details": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "details": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "details": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "details": "<string>"
  }
}
{
  "error": {
    "message": "<string>",
    "code": "<string>",
    "details": "<string>"
  }
}

Autorizações

Authorization
string
header
obrigatório

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Parâmetros de caminho

organization_id
string
obrigatório

Identificador da organização alvo.

Required string length: 24
Pattern: ^[0-9a-f]{24}$
reporting_group_id
string
obrigatório

Identificador do grupo de relatório alvo.

Required string length: 24
Pattern: ^[0-9a-f]{24}$

Corpo

application/json
agent_auto_update
boolean
obrigatório
versions
object
obrigatório

Resposta

Versões de agente atualizadas corretamente.

agent_auto_update
boolean
obrigatório
versions
object
obrigatório