Skip to content

Latest commit

 

History

History
283 lines (203 loc) · 10.1 KB

File metadata and controls

283 lines (203 loc) · 10.1 KB

cloudflare_dart.api.WorkerRoutesApi

Load the API package

import 'package:cloudflare_dart/api.dart';

All URIs are relative to https://api.cloudflare.com/client/v4

Method HTTP request Description
workerRoutesCreateRoute POST /zones/{zone_id}/workers/routes Create Route
workerRoutesDeleteRoute DELETE /zones/{zone_id}/workers/routes/{route_id} Delete Route
workerRoutesGetRoute GET /zones/{zone_id}/workers/routes/{route_id} Get Route
workerRoutesListRoutes GET /zones/{zone_id}/workers/routes List Routes
workerRoutesUpdateRoute PUT /zones/{zone_id}/workers/routes/{route_id} Update Route

workerRoutesCreateRoute

WorkerRoutesCreateRoute200Response workerRoutesCreateRoute(zoneId, workersRoute)

Create Route

Creates a route that maps a URL pattern to a Worker.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getWorkerRoutesApi();
final String zoneId = zoneId_example; // String | 
final WorkersRoute workersRoute = ; // WorkersRoute | 

try {
    final response = api.workerRoutesCreateRoute(zoneId, workersRoute);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WorkerRoutesApi->workerRoutesCreateRoute: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
workersRoute WorkersRoute

Return type

WorkerRoutesCreateRoute200Response

Authorization

api_key, api_token, api_email

HTTP request headers

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

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

workerRoutesDeleteRoute

WorkerRoutesDeleteRoute200Response workerRoutesDeleteRoute(routeId, zoneId)

Delete Route

Deletes a route.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getWorkerRoutesApi();
final String routeId = routeId_example; // String | 
final String zoneId = zoneId_example; // String | 

try {
    final response = api.workerRoutesDeleteRoute(routeId, zoneId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WorkerRoutesApi->workerRoutesDeleteRoute: $e\n');
}

Parameters

Name Type Description Notes
routeId String
zoneId String

Return type

WorkerRoutesDeleteRoute200Response

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

workerRoutesGetRoute

WorkerRoutesCreateRoute200Response workerRoutesGetRoute(routeId, zoneId)

Get Route

Returns information about a route, including URL pattern and Worker.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getWorkerRoutesApi();
final String routeId = routeId_example; // String | 
final String zoneId = zoneId_example; // String | 

try {
    final response = api.workerRoutesGetRoute(routeId, zoneId);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WorkerRoutesApi->workerRoutesGetRoute: $e\n');
}

Parameters

Name Type Description Notes
routeId String
zoneId String

Return type

WorkerRoutesCreateRoute200Response

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

workerRoutesListRoutes

WorkerRoutesListRoutes200Response workerRoutesListRoutes(zoneId)

List Routes

Returns routes for a zone.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getWorkerRoutesApi();
final String zoneId = zoneId_example; // String | 

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

Parameters

Name Type Description Notes
zoneId String

Return type

WorkerRoutesListRoutes200Response

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

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

workerRoutesUpdateRoute

WorkerRoutesCreateRoute200Response workerRoutesUpdateRoute(routeId, zoneId, workersRoute)

Update Route

Updates the URL pattern or Worker associated with a route.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getWorkerRoutesApi();
final String routeId = routeId_example; // String | 
final String zoneId = zoneId_example; // String | 
final WorkersRoute workersRoute = ; // WorkersRoute | 

try {
    final response = api.workerRoutesUpdateRoute(routeId, zoneId, workersRoute);
    print(response);
} catch on DioException (e) {
    print('Exception when calling WorkerRoutesApi->workerRoutesUpdateRoute: $e\n');
}

Parameters

Name Type Description Notes
routeId String
zoneId String
workersRoute WorkersRoute

Return type

WorkerRoutesCreateRoute200Response

Authorization

api_key, api_token, api_email

HTTP request headers

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

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