We strongly recommend that before you start using the Cato API, please review the Support Policy for the Cato API.
This article explains how to use the Cato API to manage hosts that are defined for a site with these commands:
-
addStaticHost
-
updateStaticHost
-
removeStaticHost
Use the staticHost mutation APIs to add, update, and remove hosts for a site in your account and define the following settings for the host:
-
Name of the host
-
IP address of the host
-
MAC address (optional - used for reserving a DHCP IP assignment for the host)
For reseller accounts, you can create separate API keys inside each customer account that you are configuring the settings with the Cato API.
The site ID isn't shown in the Cato Management Application, you can locate the site ID:
-
Using the entityLookup API query (see Cato API - EntityLookup), use the
type
with the value siteYou can also use the
search
parameter with the value as the name of the site, and the query returns the site ID -
Number in the URL for the Cato Management Application, when you selected a site (Network > Sites > {site name}). For example, the site ID is 12345 for the following URL: https://cc.catonetworks.com/#/26/sites/12345/networkAnalytics
The same arguments are used for creating or updating a host behind a site using the Cato configuration API. For addStaticHost
, the arguments are mandatory unless marked as optional. For updateStaticHost
, include the arguments for the host settings that you are updating.
-
hostId - For
updateStaticHost
, enter the ID for the host you are updatingFor
addStaticHost
, this ID is generated when the new host is created -
name - Name of the host behind the site
-
ip - IP address of the host behind the site
-
macAddress - (optional) MAC address of the host behind the site
The host MAC address is used to for DHCP reservation for hosts with a static IP address
The hostId
is the internal Cato ID for the host entity.
The networkRangeId
can be retrieved using the entityLookup read-only API, use the type
with the value host
Use the macAddress
argument to define the MAC address of the host for DHCP reservation.
For accounts that use Cato as the DHCP server, the IP address of hosts defined with a MAC address is reserved and can't be assigned to a different host. Make sure that the IP address for the host isn't within the DHCP range for a network segment defined for the site.
Use the removeStaticHost
API to delete a host that is defined for a site. You only need to use the hostId
with this API.
mutation addStaticHost ($accountId: ID!, $siteId: ID!, $input:AddStaticHostInput!) { site(accountId: $accountId) { addStaticHost( siteId: $siteId, input: $input ) { hostId } } }
{ "accountId": "26", "siteId": 126, "input": { "primaryManagementIp": "192.168.4.2", "secondaryManagementIp": "192.168.4.3", "vrid": 100 } }
Related Resources
0 comments
Article is closed for comments.