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

October 14, 2019 ยท View on GitHub

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

ClassMethodHTTP requestDescription
BindingsApiCreateBindingsForQueueExchangePOST /bindings/{vhost}/e/{exchange}/q/{queue}Create Bindings for Queue
BindingsApiDeleteBindingForQueueExchangeDELETE /bindings/{vhost}/e/{exchange}/q/{queue}/{propertyKey}Delete Binding for Queue
BindingsApiGetBindingForQueueExchangeGET /bindings/{vhost}/e/{exchange}/q/{queue}/{propertyKey}Get Binding for Queue
BindingsApiListBindingsGET /bindingsList Bindings
BindingsApiListBindingsAsDestinationGET /exchanges/{vhost}/{exchange}/bindings/destinationList Bindings as Destination
BindingsApiListBindingsAsSourceGET /exchanges/{vhost}/{exchange}/bindings/sourceList Bindings as Source
BindingsApiListBindingsForQueueGET /queues/{vhost}/{queue}/bindingsList All Bindings for Queue
BindingsApiListBindingsForQueueExchangeGET /bindings/{vhost}/e/{exchange}/q/{queue}List Bindings for Queue
ExchangesApiCreateExchangePUT /exchanges/{vhost}/{exchange}Create Exchange
ExchangesApiDeleteExchangeDELETE /exchanges/{vhost}/{exchange}Delete Exchange
ExchangesApiGetExchangeGET /exchanges/{vhost}/{exchange}Read Exchange
ExchangesApiListExchangesGET /exchangesList Exchanges
ExchangesApiListExchangesForHostGET /exchanges/{vhost}List Exchanges for VHost
ExchangesApiPublishMessagePOST /exchanges/{vhost}/{exchange}/publishPublish Message
InformationalApiGetClusterNameGET /cluster-nameRead Cluster Name
InformationalApiGetDefinitionsForVirtualHostGET /definitions/{vhost}Get Definitions for VHost
InformationalApiGetOverviewGET /overviewGet Overview
InformationalApiListDefinitionsGET /definitionsList Definitions
PermissionsApiListUserPermissionsGET /users/{user}/permissionsList User Permissions
PermissionsApiListUsersTopicPermissionsGET /users/{user}/topic-permissionsList Users Topic Permissions
PermissionsApiListUsersWithoutPermissionsGET /users/without-permissionsList Users without Permissions
PubSubApiConsumeMessagePOST /queues/{vhost}/{queue}/getConsume Message
PubSubApiPublishMessagePOST /exchanges/{vhost}/{exchange}/publishPublish Message
QueuesApiConsumeMessagePOST /queues/{vhost}/{queue}/getConsume Message
QueuesApiCreateQueuePUT /queues/{vhost}/{queue}Create Queue
QueuesApiCreateQueueActionsPOST /queues/{vhost}/{queue}/actionsCreate Actions for Queue
QueuesApiDeleteQueueDELETE /queues/{vhost}/{queue}Delete Queue
QueuesApiDeleteQueueContentsDELETE /queues/{vhost}/{queue}/contentsDelete Queue Contents (Purge)
QueuesApiGetQueueGET /queues/{vhost}/{queue}Get Queue
QueuesApiListBindingsForQueueGET /queues/{vhost}/{queue}/bindingsList All Bindings for Queue
QueuesApiListQueuesGET /queuesList Queues
QueuesApiListQueuesForVirtualHostGET /queues/{vhost}List Queues for VHost
UsersApiCreateUserPUT /users/{name}Create User
UsersApiDeleteUserDELETE /users/{name}Delete User
UsersApiGetUserGET /users/{name}Get User
UsersApiGetUserCurrentGET /whoamiGet Current User
UsersApiListUserPermissionsGET /users/{user}/permissionsList User Permissions
UsersApiListUsersGET /usersList Users
UsersApiListUsersWithoutPermissionsGET /users/without-permissionsList Users without Permissions
VirtualHostsApiCreateDefinitionsForVirtualHostPOST /definitions/{vhost}Create Definitions for VHost
VirtualHostsApiCreateVirtualHostPUT /vhosts/{vhost}Create VHost
VirtualHostsApiDeleteVirtualHostDELETE /vhosts/{vhost}Delete VHost
VirtualHostsApiGetDefinitionsForVirtualHostGET /definitions/{vhost}Get Definitions for VHost
VirtualHostsApiGetVirtualHostGET /vhosts/{vhost}Read VHost
VirtualHostsApiListVirtualHostsGET /vhostsList VHosts

Documentation for Models

Documentation for Authorization

basic_auth

  • Type: HTTP basic authentication

Brought to you by Thinkco.de!

ThinkCode