Summary

The setParentOrgForOrganization() mutation sets the parent organization that holds the CID capacity size for the calling organization for a specified product type. The result is reflected in the parentOrganizationId field of the returned OrganizationCapacity object. Provide productType to identify the product type; supply parentOrganizationId to set the parent organization, or omit it to clear the association.

This mutation is available on a preview basis.

Syntax

graphql
setParentOrgForOrganization(
      productType: String!,
      parentOrganizationId: String
   ): OrganizationCapacity!

Provide productType (required) โ€” a string identifying the product type, for example falconComplete or main. Supply parentOrganizationId (optional) with the organization ID of the parent; omit it or pass null to clear the association.

Returns a non-nullable OrganizationCapacity! object. See the Returned Values section for available fields.

Example

Raw
graphql
mutation {
  setParentOrgForOrganization(
    productType: "main",
    parentOrganizationId: "org-parent-abc123"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}
Mac OS or Linux (curl)
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}"
}
EOF
Mac OS or Linux (curl) One-line
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json" \
    -d @- << EOF
{"query" : "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}"
}
EOF
Windows Cmd and curl
shell
curl -v -X POST $YOUR_LOGSCALE_URL/graphql ^
    -H "Authorization: Bearer $TOKEN" ^
    -H "Content-Type: application/json" ^
    -d @'{"query" : "mutation { ^
  setParentOrgForOrganization( ^
    productType: \"main\", ^
    parentOrganizationId: \"org-parent-abc123\" ^
  ) { ^
    productType ^
    parentOrganizationId ^
    cidSize ^
  } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $query = "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}";
$query =~ s/\n/ /g;
my $json = sprintf('{"query" : "%s"}',$query);
my $req = HTTP::Request->new("POST", $uri );

$req->header("Authorization" => "Bearer $TOKEN");
$req->header("Content-Type" => "application/json");

$req->content( $json );

my $lwp = LWP::UserAgent->new;

my $result = $lwp->request( $req );

print $result->{"_content"},"\n";
Python
python
#! /usr/local/bin/python3

import requests

url = '$YOUR_LOGSCALE_URL/graphql'
mydata = r'''{"query" : "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}"
}'''

resp = requests.post(url,
                     data = mydata,
                     headers = {
   "Authorization" : "Bearer $TOKEN",
   "Content-Type" : "application/json"
}
)

print(resp.text)
Node.js
javascript
const https = require('https');

const data = JSON.stringify(
    {"query" : "mutation {
  setParentOrgForOrganization(
    productType: \"main\",
    parentOrganizationId: \"org-parent-abc123\"
  ) {
    productType
    parentOrganizationId
    cidSize
  }
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL',
  path: 'graphql',
  port: 443,
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length,
    Authorization: 'BEARER ' + process.env.TOKEN,
    'User-Agent': 'Node',
  },
};

const req = https.request(options, (res) => {
  let data = '';
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    data += d;
  });
  res.on('end', () => {
    console.log(JSON.parse(data).data);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();
Example Responses
Success (HTTP Response Code 200 OK)
json
{
  "data": {
    "setParentOrgForOrganization": {
      "productType": "main",
      "parentOrganizationId": "org-parent-abc123",
      "cidSize": null
    }
  }
}

Input Parameters

Provide productType to identify the product type. Supply parentOrganizationId to set the parent organization, or omit it to clear the existing association.

Table: Input Parameters and Datatypes

Parameter Type Required Default Description
This table contains all input parameters for this mutation.
parentOrganizationId String ย  ย  The organization ID of the parent organization holding the CID size for this organization and product type. Omit or pass null to clear the association.
productType String! yes ย  The product type whose parent organization association to update, for example falconComplete or main.

Returned Values

Returns a non-nullable OrganizationCapacity! object reflecting the capacity state after the update. The parentOrganizationId field contains the value set by this mutation.