sitesZones := client.SitesZones()
SitesZones
- Count Site Zone Sessions
- Create Site Zone
- Delete Site Zone
- Get Site Zone
- List Site Zones
- Search Site Zone Sessions
- Update Site Zone
Count Site Zone Sessions
CountSiteZoneSessions(
ctx context.Context,
siteId uuid.UUID,
zoneType models.ZoneTypeEnum,
distinct *models.SiteZoneCountDistinctEnum,
userType *models.RfClientTypeEnum,
user *string,
scopeId *string,
scope *models.ZoneScopeEnum,
start *int,
end *int,
duration *string,
limit *int,
page *int) (
models.ApiResponse[models.RepsonseCount],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
zoneType |
models.ZoneTypeEnum |
Template, Required | - |
distinct |
*models.SiteZoneCountDistinctEnum |
Query, Optional | Default: "scope_id" |
userType |
*models.RfClientTypeEnum |
Query, Optional | user type |
user |
*string |
Query, Optional | client MAC / Asset MAC / SDK UUID |
scopeId |
*string |
Query, Optional | if scope ==map /zone /rssizone , the scope id |
scope |
*models.ZoneScopeEnum |
Query, Optional | scope Default: "site" |
start |
*int |
Query, Optional | start datetime, can be epoch or relative time like -1d, -1w; -1d if not specified |
end |
*int |
Query, Optional | end datetime, can be epoch or relative time like -1d, -2h; now if not specified |
duration |
*string |
Query, Optional | duration like 7d, 2w Default: "1d" |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
page |
*int |
Query, Optional | Default: 1 Constraints: >= 1 |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
zoneType := models.ZoneTypeEnum("rssizones")
distinct := models.SiteZoneCountDistinctEnum("scope_id")
scope := models.ZoneScopeEnum("site")
duration := "10m"
limit := 100
page := 1
apiResponse, err := sitesZones.CountSiteZoneSessions(ctx, siteId, zoneType, &distinct, nil, nil, nil, &scope, nil, nil, &duration, &limit, &page)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"distinct": "string",
"end": 0,
"limit": 0,
"results": [
{
"count": 0,
"property": "string"
}
],
"start": 0,
"total": 0
}
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 |
Create Site Zone
CreateSiteZone(
ctx context.Context,
siteId uuid.UUID,
body *models.Zone) (
models.ApiResponse[models.Zone],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
body |
*models.Zone |
Body, Optional | Request Body |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.Zone{
Name: models.ToPointer("string"),
Vertices: []models.ZoneVertex{
models.ZoneVertex{
X: float64(0),
Y: float64(0),
},
},
}
apiResponse, err := sitesZones.CreateSiteZone(ctx, siteId, &body)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"created_time": 0,
"id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"map_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"modified_time": 0,
"name": "string",
"org_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"site_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"vertices": [
{
"x": 0,
"y": 0
}
]
}
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 |
Delete Site Zone
DeleteSiteZone(
ctx context.Context,
siteId uuid.UUID,
zoneId uuid.UUID) (
http.Response,
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
zoneId |
uuid.UUID |
Template, Required | - |
``
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
zoneId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
resp, err := sitesZones.DeleteSiteZone(ctx, siteId, zoneId)
if err != nil {
log.Fatalln(err)
} else {
fmt.Println(resp.StatusCode)
}
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 |
Get Site Zone Details
GetSiteZone(
ctx context.Context,
siteId uuid.UUID,
zoneId uuid.UUID) (
models.ApiResponse[models.Zone],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
zoneId |
uuid.UUID |
Template, Required | - |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
zoneId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
apiResponse, err := sitesZones.GetSiteZone(ctx, siteId, zoneId)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"created_time": 0,
"id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"map_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"modified_time": 0,
"name": "string",
"org_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"site_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"vertices": [
{
"x": 0,
"y": 0
}
]
}
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 |
Get List of Site Zones
ListSiteZones(
ctx context.Context,
siteId uuid.UUID,
limit *int,
page *int) (
models.ApiResponse[[]models.Zone],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
page |
*int |
Query, Optional | Default: 1 Constraints: >= 1 |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
limit := 100
page := 1
apiResponse, err := sitesZones.ListSiteZones(ctx, siteId, &limit, &page)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
[
{
"created_time": 0,
"id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"map_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"modified_time": 0,
"name": "string",
"org_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"site_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"vertices": [
{
"x": 0,
"y": 0
}
]
}
]
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 |
Search Zone Sessions
SearchSiteZoneSessions(
ctx context.Context,
siteId uuid.UUID,
zoneType models.ZoneTypeEnum,
userType *models.RfClientTypeEnum,
user *string,
scopeId *string,
scope *models.VisitsScopeEnum,
start *int,
end *int,
duration *string,
limit *int,
page *int) (
models.ApiResponse[models.ResponseZoneSearch],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
zoneType |
models.ZoneTypeEnum |
Template, Required | - |
userType |
*models.RfClientTypeEnum |
Query, Optional | user type, client (default) / sdkclient / asset |
user |
*string |
Query, Optional | client MAC / Asset MAC / SDK UUID |
scopeId |
*string |
Query, Optional | if scope ==map /zone /rssizone , the scope id |
scope |
*models.VisitsScopeEnum |
Query, Optional | scope Default: "site" |
start |
*int |
Query, Optional | start datetime, can be epoch or relative time like -1d, -1w; -1d if not specified |
end |
*int |
Query, Optional | end datetime, can be epoch or relative time like -1d, -2h; now if not specified |
duration |
*string |
Query, Optional | duration like 7d, 2w Default: "1d" |
limit |
*int |
Query, Optional | Default: 100 Constraints: >= 0 |
page |
*int |
Query, Optional | Default: 1 Constraints: >= 1 |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
zoneType := models.ZoneTypeEnum("rssizones")
scope := models.VisitsScopeEnum("site")
duration := "10m"
limit := 100
page := 1
apiResponse, err := sitesZones.SearchSiteZoneSessions(ctx, siteId, zoneType, nil, nil, nil, &scope, nil, nil, &duration, &limit, &page)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"end": 1541705289.769911,
"limit": 1,
"next": "/api/v1/sites/67970e46-4e12-11e6-9188-0242ac110007/zones/visits/search?limit=2&end=1541705247.000&scope_id=85fbba9e-4e12-11e6-9188-0242ac110007&user_type=asset&start=1541618889.77",
"results": [
{
"enter": 1541705254,
"scope": "map",
"timestamp": 1541705254,
"user": "c4b301c81166"
}
],
"start": 1541618889.769886,
"total": 5892
}
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 |
Update Site Zone
UpdateSiteZone(
ctx context.Context,
siteId uuid.UUID,
zoneId uuid.UUID,
body *models.Zone) (
models.ApiResponse[models.Zone],
error)
Parameter | Type | Tags | Description |
---|---|---|---|
siteId |
uuid.UUID |
Template, Required | - |
zoneId |
uuid.UUID |
Template, Required | - |
body |
*models.Zone |
Body, Optional | Request Body |
ctx := context.Background()
siteId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
zoneId := uuid.MustParse("000000ab-00ab-00ab-00ab-0000000000ab")
body := models.Zone{
Name: models.ToPointer("string"),
Vertices: []models.ZoneVertex{
models.ZoneVertex{
X: float64(0),
Y: float64(0),
},
},
}
apiResponse, err := sitesZones.UpdateSiteZone(ctx, siteId, zoneId, &body)
if err != nil {
log.Fatalln(err)
} else {
// Printing the result and response
fmt.Println(apiResponse.Data)
fmt.Println(apiResponse.Response.StatusCode)
}
{
"created_time": 0,
"id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"map_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"modified_time": 0,
"name": "string",
"org_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"site_id": "b069b358-4c97-5319-1f8c-7c5ca64d6ab1",
"vertices": [
{
"x": 0,
"y": 0
}
]
}
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 |