コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
 /// <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);
     }
 }
コード例 #4
0
 /// <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);
     }
 }
コード例 #5
0
 /// <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);
     }
 }
コード例 #6
0
 /// <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);
     }
 }
コード例 #7
0
 /// <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);
     }
 }
コード例 #8
0
 /// <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());
 }
コード例 #9
0
 /// <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());
 }
コード例 #10
0
 /// <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());
 }
コード例 #11
0
 /// <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());
 }
コード例 #12
0
 /// <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();
 }
コード例 #13
0
 /// <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();
 }
コード例 #14
0
 /// <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());
 }
コード例 #15
0
 /// <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());
 }
コード例 #16
0
 /// <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());
 }
コード例 #17
0
 /// <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());
 }
コード例 #18
0
 /// <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();
 }
コード例 #19
0
 /// <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();
 }
コード例 #20
0
 /// <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());
 }
コード例 #21
0
 /// <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());
 }
コード例 #22
0
 /// <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());
 }
コード例 #23
0
 /// <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());
 }
コード例 #24
0
 /// <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();
 }
コード例 #25
0
 /// <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();
 }
コード例 #26
0
 /// <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());
 }
コード例 #27
0
 /// <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();
 }
コード例 #28
0
 /// <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());
 }