thinkco / rabbitmq-httpclient-dotnet

RabbitMQ Management HTTP Client for .netCore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nuget

Thinkcode.RabbitMQ.OpenAPI - the C# library for the Rabbitmq Http API

This is the OpenAPI specification of the RabbitMQ HTTP API. For more information, please refer to HTTP API official documentation. Also see Github for more information and code.

This library now supports .NETCore 2.0, 2.1, 2.2, 3.0 and .NET Standard 2.0 and 2.1.

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • SDK version: 1.0.8

Release Notes

  • 1.0.8 - Support for Headers as Message Properties. Support for .NETCore 2.0, 2.1, 2.2, 3.0 and .NET Standard 2.0 and 2.1.
  • 1.0.7 - Updated RestSharp to 106.6.10,
  • 1.0.6 - Added fallback Authorization header to bypass filters.
  • 1.0.5 - Configuration merge (with Proxy) fixed.
  • 1.0.4 - Configuration now supports Proxy attribute with custom/explicit IWebProxy settings.

Frameworks supported

  • .NETCore 2.0
  • .NETCore 2.1
  • .NETCore 3.0
  • .NET Standard 2.0
  • .NET Standard 2.1

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Install-Package CompareNETObjects

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Thinkcode.RabbitMQ.OpenAPI.Api;
using Thinkcode.RabbitMQ.OpenAPI.Client;
using Thinkcode.RabbitMQ.OpenAPI.Model;

Getting Started

using System;
using System.Diagnostics;
using Thinkcode.RabbitMQ.OpenAPI.Api;
using Thinkcode.RabbitMQ.OpenAPI.Client;
using Thinkcode.RabbitMQ.OpenAPI.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure HTTP basic authorization: basic_auth
            var configuration = new Configuration() {
                Username = "YOUR_USERNAME",
                Password = "YOUR_PASSWORD",                
                BasePath = "http://YOUR_HOST/api"
            };
            
            // Apply configuration to API
            var userApi = new UsersApi(configuration);
            
            try
            {
                // Check you're connected and your user
                var whoami = userApi.GetUserCurrent()
                Console.WriteLine(whoami);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling BindingsApi.CreateBindingsForQueueExchange: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://mb1.bus.adaptive.me/rabbitmq/api

Class Method HTTP request Description
BindingsApi CreateBindingsForQueueExchange POST /bindings/{vhost}/e/{exchange}/q/{queue} Create Bindings for Queue
BindingsApi DeleteBindingForQueueExchange DELETE /bindings/{vhost}/e/{exchange}/q/{queue}/{propertyKey} Delete Binding for Queue
BindingsApi GetBindingForQueueExchange GET /bindings/{vhost}/e/{exchange}/q/{queue}/{propertyKey} Get Binding for Queue
BindingsApi ListBindings GET /bindings List Bindings
BindingsApi ListBindingsAsDestination GET /exchanges/{vhost}/{exchange}/bindings/destination List Bindings as Destination
BindingsApi ListBindingsAsSource GET /exchanges/{vhost}/{exchange}/bindings/source List Bindings as Source
BindingsApi ListBindingsForQueue GET /queues/{vhost}/{queue}/bindings List All Bindings for Queue
BindingsApi ListBindingsForQueueExchange GET /bindings/{vhost}/e/{exchange}/q/{queue} List Bindings for Queue
ExchangesApi CreateExchange PUT /exchanges/{vhost}/{exchange} Create Exchange
ExchangesApi DeleteExchange DELETE /exchanges/{vhost}/{exchange} Delete Exchange
ExchangesApi GetExchange GET /exchanges/{vhost}/{exchange} Read Exchange
ExchangesApi ListExchanges GET /exchanges List Exchanges
ExchangesApi ListExchangesForHost GET /exchanges/{vhost} List Exchanges for VHost
ExchangesApi PublishMessage POST /exchanges/{vhost}/{exchange}/publish Publish Message
InformationalApi GetClusterName GET /cluster-name Read Cluster Name
InformationalApi GetDefinitionsForVirtualHost GET /definitions/{vhost} Get Definitions for VHost
InformationalApi GetOverview GET /overview Get Overview
InformationalApi ListDefinitions GET /definitions List Definitions
PermissionsApi ListUserPermissions GET /users/{user}/permissions List User Permissions
PermissionsApi ListUsersTopicPermissions GET /users/{user}/topic-permissions List Users Topic Permissions
PermissionsApi ListUsersWithoutPermissions GET /users/without-permissions List Users without Permissions
PubSubApi ConsumeMessage POST /queues/{vhost}/{queue}/get Consume Message
PubSubApi PublishMessage POST /exchanges/{vhost}/{exchange}/publish Publish Message
QueuesApi ConsumeMessage POST /queues/{vhost}/{queue}/get Consume Message
QueuesApi CreateQueue PUT /queues/{vhost}/{queue} Create Queue
QueuesApi CreateQueueActions POST /queues/{vhost}/{queue}/actions Create Actions for Queue
QueuesApi DeleteQueue DELETE /queues/{vhost}/{queue} Delete Queue
QueuesApi DeleteQueueContents DELETE /queues/{vhost}/{queue}/contents Delete Queue Contents (Purge)
QueuesApi GetQueue GET /queues/{vhost}/{queue} Get Queue
QueuesApi ListBindingsForQueue GET /queues/{vhost}/{queue}/bindings List All Bindings for Queue
QueuesApi ListQueues GET /queues List Queues
QueuesApi ListQueuesForVirtualHost GET /queues/{vhost} List Queues for VHost
UsersApi CreateUser PUT /users/{name} Create User
UsersApi DeleteUser DELETE /users/{name} Delete User
UsersApi GetUser GET /users/{name} Get User
UsersApi GetUserCurrent GET /whoami Get Current User
UsersApi ListUserPermissions GET /users/{user}/permissions List User Permissions
UsersApi ListUsers GET /users List Users
UsersApi ListUsersWithoutPermissions GET /users/without-permissions List Users without Permissions
VirtualHostsApi CreateDefinitionsForVirtualHost POST /definitions/{vhost} Create Definitions for VHost
VirtualHostsApi CreateVirtualHost PUT /vhosts/{vhost} Create VHost
VirtualHostsApi DeleteVirtualHost DELETE /vhosts/{vhost} Delete VHost
VirtualHostsApi GetDefinitionsForVirtualHost GET /definitions/{vhost} Get Definitions for VHost
VirtualHostsApi GetVirtualHost GET /vhosts/{vhost} Read VHost
VirtualHostsApi ListVirtualHosts GET /vhosts List VHosts

Documentation for Models

Documentation for Authorization

basic_auth

  • Type: HTTP basic authentication

Brought to you by Thinkco.de!

ThinkCode

About

RabbitMQ Management HTTP Client for .netCore

License:MIT License


Languages

Language:C# 99.8%Language:Shell 0.2%