Skip to content

Latest commit

 

History

History
97 lines (76 loc) · 2.58 KB

orgs-stats-other-devices.md

File metadata and controls

97 lines (76 loc) · 2.58 KB

Orgs Stats-Other Devices

orgsStatsOtherDevices := client.OrgsStatsOtherDevices()

Class Name

OrgsStatsOtherDevices

Get Org Other Device Stats

Get Otherdevice Stats

GetOrgOtherDeviceStats(
    ctx context.Context,
    orgId uuid.UUID,
    deviceMac string) (
    models.ApiResponse[models.StatsDeviceOther],
    error)

Parameters

Parameter Type Tags Description
orgId uuid.UUID Template, Required -
deviceMac string Template, Required Constraints: Pattern: ^[0-9a-fA-F]{12}$

Response Type

models.StatsDeviceOther

Example Usage

ctx := context.Background()

orgId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")

deviceMac := "0000000000ab"

apiResponse, err := orgsStatsOtherDevices.GetOrgOtherDeviceStats(ctx, orgId, deviceMac)
if err != nil {
    log.Fatalln(err)
} else {
    // Printing the result and response
    fmt.Println(apiResponse.Data)
    fmt.Println(apiResponse.Response.StatusCode)
}

Example Response (as JSON)

{
  "config_status": "synced",
  "last_config": 1675392788,
  "last_seen": 1675843629,
  "mac": "5c5b35000018",
  "status": "online",
  "uptime": 20296,
  "vendor": "cradlepoint",
  "vendor_specific": {
    "ports": {
      "mdm-4d0e073b": {
        "bytes_in": 33004879,
        "bytes_out": 41103393,
        "health_category": "",
        "health_score": 0,
        "id": "101027967",
        "mode": "wan",
        "model": "Internal 5GB (SIM1)",
        "state": "READY",
        "type": "5G",
        "uptime": 252371.34149021498
      }
    },
    "router_id": null,
    "target_version": "7.23.40"
  },
  "version": "7.22.70"
}

Errors

HTTP Status Code Error Description Exception Class
400 Bad Syntax ResponseHttp400Exception
401 Unauthorized ResponseHttp401ErrorException
403 Permission Denied ResponseHttp403ErrorException
404 Not found. The API endpoint doesn’t exist or resource doesn’ t exist ResponseHttp404Exception
429 Too Many Request. The API Token used for the request reached the 5000 API Calls per hour threshold ResponseHttp429ErrorException