Forum Discussion

TomRobijns's avatar
TomRobijns
Icon for Contributor III rankContributor III
3 days ago

ScienceLogic 12.1 /gql endpoint displays incorrect contract for updateDevice(s)

When using the GraphiQL interface, you can see which GraphQL operations are available. Under 'Mutation', the operation "updateDevice" and "updateDevices" exists, which allow you to modify device properties via API.

Using the normal Device Investigater Settings UI screen, we can change the SNMP Read dropdown value to whatever value we like (including 'none' to empty it), but the GQL contract does not show this option.

Upon examining the action, ther browser shows that the properties "snmpReadCredentials" and "snmpReadWriteCredential" are used to update these values.

I tried entering that same command in the /GQL and confirms it works; it's just showing an error in the syntax:

Query:

mutation UpdateDeviceSettings($deviceId: ID!, $snmpReadCredential: ID, $snmpReadWriteCredential: ID) {
  updateDevice(id: $deviceId, snmpReadCredential: $snmpReadCredential, snmpReadWriteCredential: $snmpReadWriteCredential) {
    id
    snmpReadCredential { id }
  }
}

Variables:

{
  "deviceId": "10104",
  "snmpReadCredential": null,
  "snmpReadWriteCredential": null
}

 

Result:

{
  "data": {
    "updateDevice": {
      "id": "10104",
      "snmpReadCredential": null
    }
  }
}

Error:

Unknown argument: "snmpReadCredential" on diels "Mutations.updateDevice".

Can this be corrected please?