Skip to content

Latest commit

 

History

History
306 lines (205 loc) · 9.32 KB

PolicyV1alpha1Api.md

File metadata and controls

306 lines (205 loc) · 9.32 KB

halo_client.api.PolicyV1alpha1Api

Load the API package

import 'package:halo_client/api.dart';

All URIs are relative to http://localhost:8091

Method HTTP request Description
createPolicy POST /apis/storage.halo.run/v1alpha1/policies
deletePolicy DELETE /apis/storage.halo.run/v1alpha1/policies/{name}
getPolicy GET /apis/storage.halo.run/v1alpha1/policies/{name}
listPolicy GET /apis/storage.halo.run/v1alpha1/policies
patchPolicy PATCH /apis/storage.halo.run/v1alpha1/policies/{name}
updatePolicy PUT /apis/storage.halo.run/v1alpha1/policies/{name}

createPolicy

Policy createPolicy(policy)

Create Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final Policy policy = ; // Policy | Fresh policy

try {
    final response = api.createPolicy(policy);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->createPolicy: $e\n');
}

Parameters

Name Type Description Notes
policy Policy Fresh policy [optional]

Return type

Policy

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deletePolicy

deletePolicy(name)

Delete Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final String name = name_example; // String | Name of policy

try {
    api.deletePolicy(name);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->deletePolicy: $e\n');
}

Parameters

Name Type Description Notes
name String Name of policy

Return type

void (empty response body)

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getPolicy

Policy getPolicy(name)

Get Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final String name = name_example; // String | Name of policy

try {
    final response = api.getPolicy(name);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->getPolicy: $e\n');
}

Parameters

Name Type Description Notes
name String Name of policy

Return type

Policy

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listPolicy

PolicyList listPolicy(page, size, labelSelector, fieldSelector, sort)

List Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final int page = 56; // int | Page number. Default is 0.
final int size = 56; // int | Size number. Default is 0.
final BuiltList<String> labelSelector = ; // BuiltList<String> | Label selector. e.g.: hidden!=true
final BuiltList<String> fieldSelector = ; // BuiltList<String> | Field selector. e.g.: metadata.name==halo
final BuiltList<String> sort = ; // BuiltList<String> | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.

try {
    final response = api.listPolicy(page, size, labelSelector, fieldSelector, sort);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->listPolicy: $e\n');
}

Parameters

Name Type Description Notes
page int Page number. Default is 0. [optional]
size int Size number. Default is 0. [optional]
labelSelector BuiltList<String> Label selector. e.g.: hidden!=true [optional]
fieldSelector BuiltList<String> Field selector. e.g.: metadata.name==halo [optional]
sort BuiltList<String> Sorting criteria in the format: property,(asc desc). Default sort order is ascending. Multiple sort criteria are supported.

Return type

PolicyList

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchPolicy

Policy patchPolicy(name, jsonPatchInner)

Patch Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final String name = name_example; // String | Name of policy
final BuiltSet<JsonPatchInner> jsonPatchInner = ; // BuiltSet<JsonPatchInner> | 

try {
    final response = api.patchPolicy(name, jsonPatchInner);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->patchPolicy: $e\n');
}

Parameters

Name Type Description Notes
name String Name of policy
jsonPatchInner BuiltSet<JsonPatchInner> [optional]

Return type

Policy

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: application/json-patch+json
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updatePolicy

Policy updatePolicy(name, policy)

Update Policy

Example

import 'package:halo_client/api.dart';
// TODO Configure HTTP basic authorization: basicAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('basicAuth').password = 'YOUR_PASSWORD';

final api = HaloClient().getPolicyV1alpha1Api();
final String name = name_example; // String | Name of policy
final Policy policy = ; // Policy | Updated policy

try {
    final response = api.updatePolicy(name, policy);
    print(response);
} catch on DioException (e) {
    print('Exception when calling PolicyV1alpha1Api->updatePolicy: $e\n');
}

Parameters

Name Type Description Notes
name String Name of policy
policy Policy Updated policy [optional]

Return type

Policy

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to README]