/// <summary> /// Registrate service to Kong /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='serviceUpsert'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Service> AddServiceAsync(this IKongAdminAPI operations, ServiceUpsert serviceUpsert, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddServiceWithHttpMessagesAsync(serviceUpsert, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update a Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The unique identifier of the new Consumer. /// </param> /// <param name='consumerUpsert'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Consumer> AddConsumerWithIdAsync(this IKongAdminAPI operations, string consumer, ConsumerUpsert consumerUpsert, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddConsumerWithIdWithHttpMessagesAsync(consumer, consumerUpsert, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve all ACLs for the given Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity which ACLs will be /// listed. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AclList> ListAclsForConsumerAsync(this IKongAdminAPI operations, string consumer, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListAclsForConsumerWithHttpMessagesAsync(consumer, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Add ACL to a consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='group'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Acl> AddAclAsync(this IKongAdminAPI operations, string consumer, string group, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddAclWithHttpMessagesAsync(consumer, group, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Enabling the plugin on a Service /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='service'> /// The id or name of the Service that this plugin configuration will target.. /// </param> /// <param name='pluginUpsert'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Plugin> AddPluginAsync(this IKongAdminAPI operations, string service, PluginUpsert pluginUpsert, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.AddPluginWithHttpMessagesAsync(service, pluginUpsert, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get a JWT Credential /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='id'> /// The id or the key of the JWT credential. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Credential> GetCredentialAsync(this IKongAdminAPI operations, string consumer, string id, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetCredentialWithHttpMessagesAsync(consumer, id, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List all services /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='offset'> /// An uid of a service as an offset. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ServiceList> ListServicesAsync(this IKongAdminAPI operations, string offset = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListServicesWithHttpMessagesAsync(offset, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve all ACLs /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static AclList ListAcls(this IKongAdminAPI operations) { return(operations.ListAclsAsync().GetAwaiter().GetResult()); }
/// <summary> /// Get a JWT Credential /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='id'> /// The id or the key of the JWT credential. /// </param> public static Credential GetCredential(this IKongAdminAPI operations, string consumer, string id) { return(operations.GetCredentialAsync(consumer, id).GetAwaiter().GetResult()); }
/// <summary> /// Create a JWT credential /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='credentialUpsert'> /// </param> public static Credential AddCredential(this IKongAdminAPI operations, string consumer, CredentialUpsert credentialUpsert = default(CredentialUpsert)) { return(operations.AddCredentialAsync(consumer, credentialUpsert).GetAwaiter().GetResult()); }
/// <summary> /// Registrate service to Kong /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='serviceUpsert'> /// </param> public static Service AddService(this IKongAdminAPI operations, ServiceUpsert serviceUpsert) { return(operations.AddServiceAsync(serviceUpsert).GetAwaiter().GetResult()); }
/// <summary> /// Delete a Route by a name or id /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='route'> /// The unique identifier or the name of the Route to delete. /// </param> public static void DeleteRoute(this IKongAdminAPI operations, string route) { operations.DeleteRouteAsync(route).GetAwaiter().GetResult(); }
/// <summary> /// Delete an ACL /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='id'> /// The id of the ACL. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAclAsync(this IKongAdminAPI operations, string consumer, string id, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteAclWithHttpMessagesAsync(consumer, id, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// List all services /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='offset'> /// An uid of a service as an offset. /// </param> public static ServiceList ListServices(this IKongAdminAPI operations, string offset = default(string)) { return(operations.ListServicesAsync(offset).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve all ACLs for the given Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity which ACLs will be /// listed. /// </param> public static AclList ListAclsForConsumer(this IKongAdminAPI operations, string consumer) { return(operations.ListAclsForConsumerAsync(consumer).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve a Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The unique identifier or the username of the Consumer to retrieve. /// </param> public static Consumer GetConsumer(this IKongAdminAPI operations, string consumer) { return(operations.GetConsumerAsync(consumer).GetAwaiter().GetResult()); }
/// <summary> /// List all Consumers /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='offset'> /// An uid of a consumer as an offset. /// </param> public static ConsumerList ListConsumers(this IKongAdminAPI operations, string offset = default(string)) { return(operations.ListConsumersAsync(offset).GetAwaiter().GetResult()); }
/// <summary> /// Delete a Plugin by an id /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='pluginId'> /// The unique identifier of the Plugin to delete. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeletePluginAsync(this IKongAdminAPI operations, string pluginId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeletePluginWithHttpMessagesAsync(pluginId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Delete a Plugin by an id /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='pluginId'> /// The unique identifier of the Plugin to delete. /// </param> public static void DeletePlugin(this IKongAdminAPI operations, string pluginId) { operations.DeletePluginAsync(pluginId).GetAwaiter().GetResult(); }
/// <summary> /// Enabling the plugin on a Service /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='service'> /// The id or name of the Service that this plugin configuration will target.. /// </param> /// <param name='pluginUpsert'> /// </param> public static Plugin AddPlugin(this IKongAdminAPI operations, string service, PluginUpsert pluginUpsert) { return(operations.AddPluginAsync(service, pluginUpsert).GetAwaiter().GetResult()); }
/// <summary> /// Create or update a Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The unique identifier of the new Consumer. /// </param> /// <param name='consumerUpsert'> /// </param> public static Consumer AddConsumerWithId(this IKongAdminAPI operations, string consumer, ConsumerUpsert consumerUpsert) { return(operations.AddConsumerWithIdAsync(consumer, consumerUpsert).GetAwaiter().GetResult()); }
/// <summary> /// List Plugins associated to a specific Service /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='service'> /// The unique identifier or the name attribute of the Service that's Plugins /// should be listed. /// </param> /// <param name='offset'> /// An uid of a plugin as an offset. /// </param> public static PluginList ListPlugins(this IKongAdminAPI operations, string service, string offset = default(string)) { return(operations.ListPluginsAsync(service, offset).GetAwaiter().GetResult()); }
/// <summary> /// Add ACL to a consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='group'> /// </param> public static Acl AddAcl(this IKongAdminAPI operations, string consumer, string group) { return(operations.AddAclAsync(consumer, group).GetAwaiter().GetResult()); }
/// <summary> /// Delete a Consumer by username or id /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The unique identifier or the username of the Consumer to delete. /// </param> public static void DeleteConsumer(this IKongAdminAPI operations, string consumer) { operations.DeleteConsumerAsync(consumer).GetAwaiter().GetResult(); }
/// <summary> /// Delete an ACL /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to associate the /// credentials to. /// </param> /// <param name='id'> /// The id of the ACL. /// </param> public static void DeleteAcl(this IKongAdminAPI operations, string consumer, string id) { operations.DeleteAclAsync(consumer, id).GetAwaiter().GetResult(); }
/// <summary> /// List JWT credentials of Consumer /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='consumer'> /// The id or username property of the Consumer entity to list credentials for. /// </param> public static CredentialList ListCredentials(this IKongAdminAPI operations, string consumer) { return(operations.ListCredentialsAsync(consumer).GetAwaiter().GetResult()); }
/// <summary> /// Delete a service by a name or id /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='service'> /// The unique identifier or the name of the Service to delete. /// </param> public static void DeleteService(this IKongAdminAPI operations, string service) { operations.DeleteServiceAsync(service).GetAwaiter().GetResult(); }
/// <summary> /// Create Route associated to a specific Service /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='service'> /// The unique identifier or the name attribute of the Service that should be /// associated to the newly-created Route. /// </param> /// <param name='routeUpsert'> /// </param> public static Route AddRoute(this IKongAdminAPI operations, string service, RouteUpsert routeUpsert) { return(operations.AddRouteAsync(service, routeUpsert).GetAwaiter().GetResult()); }