github.com/optim-corp/cios-golang-sdk@v0.5.1/sdk/service/device/README.md (about) 1 # Device 2 3 ## Device Management API 4 5 ### interface 6 ``` 7 GetDevices(ciosctx.RequestCtx, cios.ApiGetDevicesRequest) (cios.MultipleDevice, *_nethttp.Response, error) 8 GetDevicesAll(ciosctx.RequestCtx, cios.ApiGetDevicesRequest) ([]cios.Device, *_nethttp.Response, error) 9 GetDevicesUnlimited(ciosctx.RequestCtx, cios.ApiGetDevicesRequest) ([]cios.Device, *_nethttp.Response, error) 10 GetDevice(ciosctx.RequestCtx, string, *string, *bool) (cios.Device, *_nethttp.Response, error) 11 GetDeviceInventory(ciosctx.RequestCtx, string) (map[string]interface{}, *_nethttp.Response, error) 12 DeleteDevice(ciosctx.RequestCtx, string) (*_nethttp.Response, error) 13 CreateDevice(ciosctx.RequestCtx, cios.DeviceInfo) (cios.Device, *_nethttp.Response, error) 14 UpdateDevice(ciosctx.RequestCtx, string, cios.DeviceUpdateRequest) (cios.Device, *_nethttp.Response, error) 15 ``` 16 17 ### Usage 18 19 #### Get a Device 20 ```go 21 device, httpResponse, err := client.DeviceManagement().GetDevice(ctx, "device_id") 22 ``` 23 24 #### Get a Device Inventory 25 ```go 26 inventory, httpResponse, err := client.DeviceManagement().GetDeviceInventory(ctx, "device_id") 27 ``` 28 29 #### Get Devices max limit 1000 30 ```go 31 options := srvdevice.MakeGetDevicesOpts 32 devices, httpResponse, err := client.DeviceManagement().GetDevices(ctx, options()) 33 ``` 34 35 #### Get Devices max no limit 36 37 ```go 38 options := srvdevice.MakeGetDevicesOpts 39 devices, httpResponse, err := client.DeviceManagement().GetDevicesAll(ctx, options()) 40 ``` 41 42 #### Get Devices max unlimited 43 44 ```go 45 options := srvdevice.MakeGetDevicesOpts 46 devices, httpResponse, err := client.DeviceManagement().GetDevicesUnlimited(ctx, options()) 47 ``` 48 49 ### Create a Device 50 51 ```go 52 device, httpResponse, err := client.DeviceManagement().CreateDevice(ctx, cios.DeviceInfo{}) 53 ``` 54 55 ### Update a Device 56 57 ```go 58 device, httpResponse, err := client.DeviceManagement().UpdateDevice(ctx, "device_id", cios.DeviceUpdateRequest{}) 59 ``` 60 61 ### Delete a Device 62 63 ```go 64 httpResponse, err := client.DeviceManagement().DeleteDevice(ctx, "device_id") 65 ``` 66 67 ## Device Monitoring API 68 69 ### interface 70 ``` 71 GetMonitoringLatestList(ciosctx.RequestCtx, []string) ([]cios.DeviceMonitoring, *_nethttp.Response, error) 72 GetMonitoring(ciosctx.RequestCtx, string) (cios.DeviceMonitoring, *_nethttp.Response, error) 73 74 ``` 75 76 ### Usage 77 78 #### Get Devices Monitoring info 79 80 ```go 81 monitoringList, httpResponse, err := client.DeviceManagement().GetMonitoringLatestList(ctx, []string{"device_id1", "device_id2"}) 82 ``` 83 84 #### Get a Device Monitoring info 85 86 ```go 87 monitoring, httpResponse, err := client.DeviceManagement().GetMonitoring(ctx, "device_id1") 88 ``` 89 90 91 ## Device Policy API 92 93 ### interface 94 ``` 95 GetPolicies(ciosctx.RequestCtx, cios.ApiGetDevicePoliciesRequest) (cios.MultipleDevicePolicy, *_nethttp.Response, error) 96 GetPoliciesAll(ciosctx.RequestCtx, cios.ApiGetDevicePoliciesRequest) ([]cios.DevicePolicy, *_nethttp.Response, error) 97 GetPoliciesUnlimited(ciosctx.RequestCtx, cios.ApiGetDevicePoliciesRequest) ([]cios.DevicePolicy, *_nethttp.Response, error) 98 DeletePolicy(ciosctx.RequestCtx, string) (*_nethttp.Response, error) 99 CreatePolicy(ciosctx.RequestCtx, string) (cios.DevicePolicy, *_nethttp.Response, error) 100 ``` 101 102 ### Usage 103 104 #### Get Policies max limit 1000 105 106 ```go 107 options := srvdevice.MakeGetPoliciesOpts() 108 policies, httpResponse, err := client.DeviceManagement().GetPolicies(ctx, options()) 109 ``` 110 111 #### Get Policies max no limit 112 113 ```go 114 options := srvdevice.MakeGetPoliciesOpts() 115 policies, httpResponse, err := client.DeviceManagement().GetPoliciesAll(ctx, options()) 116 ``` 117 118 #### Get Policies unlimited 119 120 ```go 121 options := srvdevice.MakeGetPoliciesOpts() 122 policies, httpResponse, err := client.DeviceManagement().GetPoliciesUnlimited(ctx, options()) 123 ``` 124 125 #### Create a Policy 126 127 ```go 128 policy, httpResponse, err := client.DeviceManagement().CreatePolicy(ctx, "resource_owner_id") 129 ``` 130 131 #### Delete a Policy 132 133 ```go 134 httpResponse, err := client.DeviceManagement().DeletePolicy(ctx, "policy_id") 135 ``` 136