Summary

The updateRemoteTableConfig() mutation updates a remote table configuration in your organization. Use it to change the connection name, description, label, connection details, or access requirements of a configuration. The configuration is identified by its connectionName, which must remain unique within the organization. To create a new remote table configuration, use createRemoteTableConfig().

Syntax

graphql
updateRemoteTableConfig(
      input: CreateOrUpdateRemoteTableConfigInput!
   ): RemoteTableConfig!

The required input argument accepts a CreateOrUpdateRemoteTableConfigInput! object. The connectionName, connectionDescription, and accessRequirement fields are required. Provide either connectionConfigGeneric or connectionConfigLogscale to specify the remote source type — not both. The optional connectionLabel field sets a label that LogScale records in logs for the connection. The mutation returns the updated RemoteTableConfig object.

Input parameters

The following parameters define the updated remote table configuration. The connectionName, connectionDescription, and accessRequirement fields are required. Provide connectionConfigGeneric for a generic external data source, or connectionConfigLogscale for another LogScale instance as the remote source.

Table: CreateOrUpdateRemoteTableConfigInput Input Datatype

ParameterTypeRequiredDefaultStabilityAvailabilityDescription
accessRequirementAccessRequirementInputyes   An access requirement that must be fulfilled in order to run a remote table query based on this config
connectionConfigGenericGenericConnectionConfigInput    The config for a generic remote table.
connectionConfigLogscaleLogScaleConnectionConfigInput    The config for a Logscale remote table.
connectionDescriptionStringyes   The description of the remote table config.
connectionLabelString    Label associated with the connection. Logged by LogScale.
connectionNameStringyes   The name of the remote table config. Must be unique in the organization. Cannot be empty

Example

Raw
graphql
mutation {
  updateRemoteTableConfig(
    input: { 
      connectionName: "someother-table"
    }
  ) { connectionName }
}
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 {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}"
}
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 {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}"
}
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 { ^
  updateRemoteTableConfig( ^
    input: {  ^
      connectionName: \"someother-table\" ^
    } ^
  ) { connectionName } ^
}" ^
} '
Windows Powershell and curl
powershell
curl.exe -X POST 
    -H "Authorization: Bearer $TOKEN"
    -H "Content-Type: application/json"
    -d '{"query" : "mutation {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}"
}'
    "$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 {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}";
$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 {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}"
}'''

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 {
  updateRemoteTableConfig(
    input: { 
      connectionName: \"someother-table\"
    }
  ) { connectionName }
}"
}
);


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": {
    "updateRemoteTableConfig": {
      "connectionName": "someother-table"
    }
  }
}

Returned values

The mutation returns a non-null RemoteTableConfig! object representing the updated configuration. The returned object includes the connectionName, connectionDescription, connectionConfig, accessRequirement, and viewIds fields. Include viewIds in the return fields to confirm which views remain connected to the configuration after the update.