API Stability Short-Term

The checkRemoteClusterConnection() GraphQL query is used to validate a remote cluster connection.

Syntax

Below is the syntax for the checkRemoteClusterConnection() query field:

graphql
checkRemoteClusterConnection(
      input: CheckRemoteClusterConnectionInput!
    ): RemoteClusterConnectionStatus!

For CheckRemoteClusterConnectionInput represents a few required parameters, which are described in the next section. The return datatype, RemoteClusterConnectionStatus is described in the subsequent section. Below is an example of how this query can be used:

Raw
graphql
query {
	checkRemoteClusterConnection(
    input:{publicUrl:"https://logger.company.com",
      token: "7lEkz4aL1dByiwNI1kWuusyBFQQtv086"
    }) 
  {id, remoteViewName, isValid}
}
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" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}
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" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}
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" : "query { ^
	checkRemoteClusterConnection( ^
    input:{publicUrl:\"https://logger.company.com\", ^
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\" ^
    })  ^
  {id, remoteViewName, isValid} ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}'
    "$YOUR_LOGSCALE_URL/graphql"
Perl
perl
#!/usr/bin/perl

use HTTP::Request;
use LWP;

my $INGEST_TOKEN = "TOKEN";

my $uri = '$YOUR_LOGSCALE_URL/graphql';

my $json = '{"query" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}';
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" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}'''

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" : "query {
	checkRemoteClusterConnection(
    input:{publicUrl:\"https://logger.company.com\",
      token: \"7lEkz4aL1dByiwNI1kWuusyBFQQtv086\"
    }) 
  {id, remoteViewName, isValid}
}"
}
);


const options = {
  hostname: '$YOUR_LOGSCALE_URL/graphql',
  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": {
    "checkRemoteClusterConnection": {
      "id": null,
      "remoteViewName": "humio",
      "isValid": true
    }
  }
}

For the input's special datatype, the values are given within curly-brackets. As for the returned results, a list of requests is entered in a comma-separated list, also within curly-brackets. Further down this page is a list of what's allowed.

Given Datatypes

For CheckRemoteClusterConnectionInput, there are a few parameters. Below is a list of them along with descriptions of each:

Table: CheckRemoteClusterConnectionInput

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 17, 2024
connectionIdstring  Short-TermThe unique identifier of the connection to check. Must be supplied if the token is not supplied.
multiClusterViewNamestring  Short-TermThe name of the multi-cluster view to which the connection belongs. Must be supplied if the token is not supplied.
publicUrlstringyes Short-TermThe public URL of the remote cluster to connect.
queryPrefixstring  Short-TermFilter query that restricts the data visible through this connection.
tags[ClusterConnectionInputTag]yes Short-TermAdditional tags that can be used to filter queries. See ClusterConnectionInputTag.
tokenstringyes Short-TermThe access token for the remote view to connect with. Can be omitted if checking an existing connection with no token change.

Returned Datatypes

For RemoteClusterConnectionStatus, there are several possible values returned, which are listed below:

Table: RemoteClusterConnectionStatus

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Oct 3, 2024
errorMessages[ConnectionAspectErrorType]yes Short-TermErrors if the connection is invalid. See ConnectionAspectErrorType.
idstring  Short-TermThe unique identifier of the connection.
isValidbooleanyes Short-TermWhether the connection is valid.
remoteServerCompatVersionstring  Short-TermOldest server version that is protocol compatible with the remote server.
remoteServerVersionstring  Short-TermSoftware version of the remote view.
remoteViewNamestring  Short-TermThe name of the remote view.