|
| 1 | +# wavefront_api_client.SecurityPolicyApi |
| 2 | + |
| 3 | +All URIs are relative to *https://YOUR_INSTANCE.wavefront.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**get_metrics_policy**](SecurityPolicyApi.md#get_metrics_policy) | **GET** /api/v2/metricspolicy | Get the metrics policy |
| 8 | +[**get_metrics_policy_by_version**](SecurityPolicyApi.md#get_metrics_policy_by_version) | **GET** /api/v2/metricspolicy/history/{version} | Get a specific historical version of a metrics policy |
| 9 | +[**get_metrics_policy_history**](SecurityPolicyApi.md#get_metrics_policy_history) | **GET** /api/v2/metricspolicy/history | Get the version history of metrics policy |
| 10 | +[**revert_metrics_policy_by_version**](SecurityPolicyApi.md#revert_metrics_policy_by_version) | **POST** /api/v2/metricspolicy/revert/{version} | Revert to a specific historical version of a metrics policy |
| 11 | +[**update_metrics_policy**](SecurityPolicyApi.md#update_metrics_policy) | **PUT** /api/v2/metricspolicy | Update the metrics policy |
| 12 | + |
| 13 | + |
| 14 | +# **get_metrics_policy** |
| 15 | +> ResponseContainerMetricsPolicyReadModel get_metrics_policy() |
| 16 | +
|
| 17 | +Get the metrics policy |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +### Example |
| 22 | +```python |
| 23 | +from __future__ import print_function |
| 24 | +import time |
| 25 | +import wavefront_api_client |
| 26 | +from wavefront_api_client.rest import ApiException |
| 27 | +from pprint import pprint |
| 28 | + |
| 29 | +# Configure API key authorization: api_key |
| 30 | +configuration = wavefront_api_client.Configuration() |
| 31 | +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' |
| 32 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 33 | +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' |
| 34 | + |
| 35 | +# create an instance of the API class |
| 36 | +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) |
| 37 | + |
| 38 | +try: |
| 39 | + # Get the metrics policy |
| 40 | + api_response = api_instance.get_metrics_policy() |
| 41 | + pprint(api_response) |
| 42 | +except ApiException as e: |
| 43 | + print("Exception when calling SecurityPolicyApi->get_metrics_policy: %s\n" % e) |
| 44 | +``` |
| 45 | + |
| 46 | +### Parameters |
| 47 | +This endpoint does not need any parameter. |
| 48 | + |
| 49 | +### Return type |
| 50 | + |
| 51 | +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) |
| 52 | + |
| 53 | +### Authorization |
| 54 | + |
| 55 | +[api_key](../README.md#api_key) |
| 56 | + |
| 57 | +### HTTP request headers |
| 58 | + |
| 59 | + - **Content-Type**: application/json |
| 60 | + - **Accept**: application/json |
| 61 | + |
| 62 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 63 | + |
| 64 | +# **get_metrics_policy_by_version** |
| 65 | +> ResponseContainerMetricsPolicyReadModel get_metrics_policy_by_version(version) |
| 66 | +
|
| 67 | +Get a specific historical version of a metrics policy |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +### Example |
| 72 | +```python |
| 73 | +from __future__ import print_function |
| 74 | +import time |
| 75 | +import wavefront_api_client |
| 76 | +from wavefront_api_client.rest import ApiException |
| 77 | +from pprint import pprint |
| 78 | + |
| 79 | +# Configure API key authorization: api_key |
| 80 | +configuration = wavefront_api_client.Configuration() |
| 81 | +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' |
| 82 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 83 | +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' |
| 84 | + |
| 85 | +# create an instance of the API class |
| 86 | +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) |
| 87 | +version = 789 # int | |
| 88 | + |
| 89 | +try: |
| 90 | + # Get a specific historical version of a metrics policy |
| 91 | + api_response = api_instance.get_metrics_policy_by_version(version) |
| 92 | + pprint(api_response) |
| 93 | +except ApiException as e: |
| 94 | + print("Exception when calling SecurityPolicyApi->get_metrics_policy_by_version: %s\n" % e) |
| 95 | +``` |
| 96 | + |
| 97 | +### Parameters |
| 98 | + |
| 99 | +Name | Type | Description | Notes |
| 100 | +------------- | ------------- | ------------- | ------------- |
| 101 | + **version** | **int**| | |
| 102 | + |
| 103 | +### Return type |
| 104 | + |
| 105 | +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) |
| 106 | + |
| 107 | +### Authorization |
| 108 | + |
| 109 | +[api_key](../README.md#api_key) |
| 110 | + |
| 111 | +### HTTP request headers |
| 112 | + |
| 113 | + - **Content-Type**: application/json |
| 114 | + - **Accept**: application/json |
| 115 | + |
| 116 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 117 | + |
| 118 | +# **get_metrics_policy_history** |
| 119 | +> ResponseContainerHistoryResponse get_metrics_policy_history(offset=offset, limit=limit) |
| 120 | +
|
| 121 | +Get the version history of metrics policy |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | +### Example |
| 126 | +```python |
| 127 | +from __future__ import print_function |
| 128 | +import time |
| 129 | +import wavefront_api_client |
| 130 | +from wavefront_api_client.rest import ApiException |
| 131 | +from pprint import pprint |
| 132 | + |
| 133 | +# Configure API key authorization: api_key |
| 134 | +configuration = wavefront_api_client.Configuration() |
| 135 | +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' |
| 136 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 137 | +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' |
| 138 | + |
| 139 | +# create an instance of the API class |
| 140 | +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) |
| 141 | +offset = 0 # int | (optional) (default to 0) |
| 142 | +limit = 100 # int | (optional) (default to 100) |
| 143 | + |
| 144 | +try: |
| 145 | + # Get the version history of metrics policy |
| 146 | + api_response = api_instance.get_metrics_policy_history(offset=offset, limit=limit) |
| 147 | + pprint(api_response) |
| 148 | +except ApiException as e: |
| 149 | + print("Exception when calling SecurityPolicyApi->get_metrics_policy_history: %s\n" % e) |
| 150 | +``` |
| 151 | + |
| 152 | +### Parameters |
| 153 | + |
| 154 | +Name | Type | Description | Notes |
| 155 | +------------- | ------------- | ------------- | ------------- |
| 156 | + **offset** | **int**| | [optional] [default to 0] |
| 157 | + **limit** | **int**| | [optional] [default to 100] |
| 158 | + |
| 159 | +### Return type |
| 160 | + |
| 161 | +[**ResponseContainerHistoryResponse**](ResponseContainerHistoryResponse.md) |
| 162 | + |
| 163 | +### Authorization |
| 164 | + |
| 165 | +[api_key](../README.md#api_key) |
| 166 | + |
| 167 | +### HTTP request headers |
| 168 | + |
| 169 | + - **Content-Type**: application/json |
| 170 | + - **Accept**: application/json |
| 171 | + |
| 172 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 173 | + |
| 174 | +# **revert_metrics_policy_by_version** |
| 175 | +> ResponseContainerMetricsPolicyReadModel revert_metrics_policy_by_version(version) |
| 176 | +
|
| 177 | +Revert to a specific historical version of a metrics policy |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | +### Example |
| 182 | +```python |
| 183 | +from __future__ import print_function |
| 184 | +import time |
| 185 | +import wavefront_api_client |
| 186 | +from wavefront_api_client.rest import ApiException |
| 187 | +from pprint import pprint |
| 188 | + |
| 189 | +# Configure API key authorization: api_key |
| 190 | +configuration = wavefront_api_client.Configuration() |
| 191 | +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' |
| 192 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 193 | +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' |
| 194 | + |
| 195 | +# create an instance of the API class |
| 196 | +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) |
| 197 | +version = 789 # int | |
| 198 | + |
| 199 | +try: |
| 200 | + # Revert to a specific historical version of a metrics policy |
| 201 | + api_response = api_instance.revert_metrics_policy_by_version(version) |
| 202 | + pprint(api_response) |
| 203 | +except ApiException as e: |
| 204 | + print("Exception when calling SecurityPolicyApi->revert_metrics_policy_by_version: %s\n" % e) |
| 205 | +``` |
| 206 | + |
| 207 | +### Parameters |
| 208 | + |
| 209 | +Name | Type | Description | Notes |
| 210 | +------------- | ------------- | ------------- | ------------- |
| 211 | + **version** | **int**| | |
| 212 | + |
| 213 | +### Return type |
| 214 | + |
| 215 | +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) |
| 216 | + |
| 217 | +### Authorization |
| 218 | + |
| 219 | +[api_key](../README.md#api_key) |
| 220 | + |
| 221 | +### HTTP request headers |
| 222 | + |
| 223 | + - **Content-Type**: application/json |
| 224 | + - **Accept**: application/json |
| 225 | + |
| 226 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 227 | + |
| 228 | +# **update_metrics_policy** |
| 229 | +> ResponseContainerMetricsPolicyReadModel update_metrics_policy(body=body) |
| 230 | +
|
| 231 | +Update the metrics policy |
| 232 | + |
| 233 | + |
| 234 | + |
| 235 | +### Example |
| 236 | +```python |
| 237 | +from __future__ import print_function |
| 238 | +import time |
| 239 | +import wavefront_api_client |
| 240 | +from wavefront_api_client.rest import ApiException |
| 241 | +from pprint import pprint |
| 242 | + |
| 243 | +# Configure API key authorization: api_key |
| 244 | +configuration = wavefront_api_client.Configuration() |
| 245 | +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' |
| 246 | +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 247 | +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' |
| 248 | + |
| 249 | +# create an instance of the API class |
| 250 | +api_instance = wavefront_api_client.SecurityPolicyApi(wavefront_api_client.ApiClient(configuration)) |
| 251 | +body = wavefront_api_client.MetricsPolicyWriteModel() # MetricsPolicyWriteModel | Example Body: <pre>{ \"policyRules\": [{ \"name\": \"Policy rule1 name\", \"description\": \"Policy rule1 description\", \"prefixes\": [\"revenue.*\"], \"tags\": [{\"key\":\"sensitive\", \"value\":\"false\"}, {\"key\":\"source\", \"value\":\"app1\"}], \"tagsAnded\": \"true\", \"accessType\": \"ALLOW\", \"accounts\": [\"accountId1\", \"accountId2\"], \"userGroups\": [\"userGroupId1\"], \"roles\": [\"roleId\"] }, { \"name\": \"Policy rule2 name\", \"description\": \"Policy rule2 description\", \"prefixes\": [\"revenue.*\"], \"accessType\": \"BLOCK\", \"accounts\": [\"accountId3\"], \"userGroups\": [\"userGroupId1\"] }] }</pre> (optional) |
| 252 | + |
| 253 | +try: |
| 254 | + # Update the metrics policy |
| 255 | + api_response = api_instance.update_metrics_policy(body=body) |
| 256 | + pprint(api_response) |
| 257 | +except ApiException as e: |
| 258 | + print("Exception when calling SecurityPolicyApi->update_metrics_policy: %s\n" % e) |
| 259 | +``` |
| 260 | + |
| 261 | +### Parameters |
| 262 | + |
| 263 | +Name | Type | Description | Notes |
| 264 | +------------- | ------------- | ------------- | ------------- |
| 265 | + **body** | [**MetricsPolicyWriteModel**](MetricsPolicyWriteModel.md)| Example Body: <pre>{ \"policyRules\": [{ \"name\": \"Policy rule1 name\", \"description\": \"Policy rule1 description\", \"prefixes\": [\"revenue.*\"], \"tags\": [{\"key\":\"sensitive\", \"value\":\"false\"}, {\"key\":\"source\", \"value\":\"app1\"}], \"tagsAnded\": \"true\", \"accessType\": \"ALLOW\", \"accounts\": [\"accountId1\", \"accountId2\"], \"userGroups\": [\"userGroupId1\"], \"roles\": [\"roleId\"] }, { \"name\": \"Policy rule2 name\", \"description\": \"Policy rule2 description\", \"prefixes\": [\"revenue.*\"], \"accessType\": \"BLOCK\", \"accounts\": [\"accountId3\"], \"userGroups\": [\"userGroupId1\"] }] }</pre> | [optional] |
| 266 | + |
| 267 | +### Return type |
| 268 | + |
| 269 | +[**ResponseContainerMetricsPolicyReadModel**](ResponseContainerMetricsPolicyReadModel.md) |
| 270 | + |
| 271 | +### Authorization |
| 272 | + |
| 273 | +[api_key](../README.md#api_key) |
| 274 | + |
| 275 | +### HTTP request headers |
| 276 | + |
| 277 | + - **Content-Type**: application/json |
| 278 | + - **Accept**: application/json |
| 279 | + |
| 280 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 281 | + |
0 commit comments