local_policy

Device Upgrade Policy

A device update configuration is specific to a location and therefore all Mojo devices placed at that location can take access.You can choose to apply a device firmware update configuration recursively to the child location folders when you are creating or editing the device firmware update configuration, However, a child location folder can have its own device upgrade configuration. If you define the update configuration specific to the child location folder when a schedule for its parent location folder is already defined, the schedule configured to the child location applies to the child location folder

JSON Table

Parameter Data Type Description
policyCreatedAtLocId application/json ID of the location at which the policy has been defined. For details
about the JSON, Click Location
ID
.
policyType String A read-only field for internal use.
scheduledDeviceUpgradeEnabled boolean Whether the device upgrade has been scheduled.
newDeviceUpgradeEnabled boolean Whether a new device must be upgraded.
schedule application/json The device upgrade schedule.
schedule\scheduleId int A system-defined schedule ID.
schedule\locationId application/json ID of the location. For details about the JSON, click Location
ID
.
schedule\recurringSchedule boolean Whether the upgrade schedule is recurring or one-time.
schedule\recurringDeviceUpgradeSchedule application/json Set to null if the schedule is one-time.
schedule\recurringDeviceUpgradeSchedule\startDateTime String The date and time of upgrade in ddMMyyyyHHmmss format.
schedule\recurringDeviceUpgradeSchedule\upgradeWindowDuration application/json The upgrade window duration.
schedule\recurringDeviceUpgradeSchedule\upgradeWindowDuration\minutes int Duration window in minutes.
schedule\recurringDeviceUpgradeSchedule\occursOn String A string array. The applicable values are SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, and SATURDAY.
schedule\onetimeDeviceUpgradeSchedule application/json Set to null if the schedule is recurring.
schedule\onetimeDeviceUpgradeSchedule\startDateTime String The date and time of upgrade in ddMMyyyyHHmmss format.
schedule\onetimeDeviceUpgradeSchedule\upgradeWindowDuration application/json The upgrade window duration.
schedule\onetimeDeviceUpgradeSchedule\upgradeWindowDuration\minutes int Duration window in minutes.
scheduledDeviceUpgradeRecursiveApply boolean A true or false value indicating whether the device upgrade schedule
must be applied to all sub-locations. This field is only applicable to
Save policy, not to the Get policy. True indicates that the changes in
the policy apply to all sub-locations.
newDeviceUpgradeRecursiveApply boolean A true or false value indicating whether the new device upgrade policy
must be applied to all sub-locations. This field is only applicable to
Save policy, not to the Get policy. True indicates that the changes in
the policy apply to all sub-locations.

Copy Sample JSON
Sample JSON
{
    "policyCreatedAtLocId": {
        "type": "locallocationid",
        "id": 0
    },
    "policyType": "DEVICE_UPGRADE",
    "scheduledDeviceUpgradeEnabled": false,
    "newDeviceUpgradeEnabled": false,
    "schedule": {
        "scheduleId": 0,
        "locationId": null,
        "recurringSchedule": false,
        "onetimeDeviceUpgradeSchedule": {
            "startDateTime": "000000",
            "upgradeWindowDuration": {
                "minutes": 0
            }
        },
        "recurringDeviceUpgradeSchedule": null
    },
    "scheduledDeviceUpgradeRecursiveApply": false,
    "newDeviceUpgradeRecursiveApply": false,
    "firmwareUpdateConfigForSchedule": {
        "useLatestFirmwareForAllModels": true,
        "modelConfigurations": {},
        "updateOtherModelsToLatest": false
    },
    "firmwareUpdateConfigForNewDevices": {
        "useLatestFirmwareForAllModels": true,
        "modelConfigurations": {},
        "updateOtherModelsToLatest": true
    }
}
API Calls

/V5/policies/deviceupgrade

<Base_URL>/V2/analytics/associationdata/{startdate}/{enddate}

/V5/policies/deviceupgrade

Get Device Upgrade Policy

Description This API is used to fetch the Device Upgrade Policy at a specified location
from Wireless Manager or Arista Cloud Services.
Users with the roles can call this API: superuser, administrator, operator, and viewer.
Syntax
Get <Base_URL>/policies/deviceupgrade?locationid=<value>&nodeid=<value>

Here,

  • locationid

    It is an integer value specifying the location for
    which the Device Upgrade Policy is fetched. To retrieve the value for location id refer Location call.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

  • fetch_factory_default

    Is a boolean value specifying whether factory default policies will be
    fetched or user-defined policies. If set to true the factory default policies are fetched,
    and if set to false user-defined policies are fetched.

Sample code
Get https://training.mojonetworks.com/new/webservice/v5/policies
/deviceupgrade?locationid=0&nodeid=1
Request Body This API call does not require any request body parameters.
Response Body If the API call is successful, the HTTP response status is 200.
The response body contains the details of Device Upgrade Policy. The response is in the application/json format.

Put APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Put APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Modify Device Upgrade Policy

Description This API is used to modify Device Upgrade Policy at a specified location
in Wireless Manager or Arista Cloud Services.
Users with the roles can call this API:superuser, administrator, operator, and viewer.
Syntax
POST <Base_URL>/policies/deviceupgrade?locationid=<value>&nodeid=<value>

Here,

  • locationid

    It is an integer value specifying the location for which the Device Upgrade
    Policy is modified. To retrieve the value for location id refer Location call.

  • nodeid

    It is an integer value specifying the node in a server cluster setup.

Sample code
POST https://training.mojonetworks.com/new/webservice/v5/policies/
deviceupgrade?locationid=2
Request Body This API call takes optional request body parameters.

A sample request will have a structure as follows:

{
...
List of Device Upgrade Policy attributes.
...
}
Response Body If the API call is successful, the HTTP response status is 204.
The response body does not contain any information.

Delete APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Test APIs

Description This API is used to fetch the APs that match the specified filter criteria from the allowed locations for the logged-in user. If no filters are specified, all the APs from the allowed locations are fetched. However, this API is not supported in a server cluster environment.

Note: Do not use this API to fetch more than 100 devices. For fetching larger number of devices, consider using the Get Paged List of APs API.

User Privileges Users with the following roles can call this API: superuser, administrator, and operator.

Request Body Parameters
This API call does not require any request body parameters.

Response Body
If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.

Error codes
If the API call is successful, the HTTP response status is 200.

Syntax
GET /devices/aps
Sample code
GET https://training.mojonetworks.com/new/webservice/v2/devices/aps
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?macaddress=00:11:74:33:23:12&macaddress=00:11:74:45:12:21
GET
https://training.mojonetworks.com/new/webservice/v2/devices/aps?capability=49&locationid=10&locationid=12&sortcolumn=devicename&sortascending=false
URL Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Query Parameters This API call takes optional URL parameters to filter the list of APs to be fetched and the column on which the output must be sorted. AP Filter Parameters lists the parmeter names, datatypes, applicable values, and whether the results can be sorted based on the parameter.
Response Body If the API call is successful, the HTTP response status is 200. The response body contains the details of the APs that match the filter criteria. The response is in the application/json format. Click AP to view the complete detais of the JSON along with a sample output.