From 654b66959cf3a513184af8815e08114a9dad83e6 Mon Sep 17 00:00:00 2001 From: rdhabalia Date: Wed, 22 Nov 2017 16:43:58 -0800 Subject: [PATCH 1/3] add admin-api doc for peer-clusters --- site/_data/cli/pulsar-admin.yaml | 3 +++ site/docs/latest/admin-api/clusters.md | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/site/_data/cli/pulsar-admin.yaml b/site/_data/cli/pulsar-admin.yaml index 6cc39cdfdbcbe..7ac972f93f11d 100644 --- a/site/_data/cli/pulsar-admin.yaml +++ b/site/_data/cli/pulsar-admin.yaml @@ -102,6 +102,9 @@ commands: argument: cluster-name - name: list description: List the existing clusters + - name: update-peer-clusters + description: Update peer cluster names + argument: peer-cluster-names - name: namespaces description: Operations about namespaces subcommands: diff --git a/site/docs/latest/admin-api/clusters.md b/site/docs/latest/admin-api/clusters.md index c9f9e5d43ffed..0e8c2228939ea 100644 --- a/site/docs/latest/admin-api/clusters.md +++ b/site/docs/latest/admin-api/clusters.md @@ -113,6 +113,7 @@ $ pulsar-admin clusters get cluster-1 "serviceUrlTls": null, "brokerServiceUrl": "pulsar://my-cluster.org.com:6650/", "brokerServiceUrlTls": null + "peerClusterNames": null } ``` @@ -209,3 +210,27 @@ cluster-2 ```java admin.clusters().getClusters(); ``` + +### Update peer-cluster data + +Peer clusters can be configured for a given cluster in a Pulsar {% popover instance %}. + +#### pulsar-admin + +Use the [`update-peer-clusters`](../../reference/CliTools#pulsar-admin-clusters-update-peer-clusters) subcommand and specify the list of peer-cluster names. + +``` +$ pulsar-admin update-peer-clusters cluster-1 --peer-clusters cluster-2 +``` + +#### REST API + +{% endpoint POST /admin/clusters/:cluster/peers %} + +[More info](../../reference/RestApi#/admin/clusters/:cluster/peers) + +#### Java + +```java +admin.clusters().updatePeerClusterNames(clusterName, peerClusterList); +``` From 1a0d3a15db30e852e7a506e7ecc294638a2caa64 Mon Sep 17 00:00:00 2001 From: rdhabalia Date: Wed, 22 Nov 2017 17:31:01 -0800 Subject: [PATCH 2/3] update latest swagger --- site/_data/admin-rest-api-swagger.json | 2205 +++++++++++++++++++++--- 1 file changed, 1998 insertions(+), 207 deletions(-) diff --git a/site/_data/admin-rest-api-swagger.json b/site/_data/admin-rest-api-swagger.json index 5721c350e1c13..b2a18dc17b18a 100644 --- a/site/_data/admin-rest-api-swagger.json +++ b/site/_data/admin-rest-api-swagger.json @@ -1,7 +1,7 @@ { "swagger" : "2.0", "info" : { - "description" : "This provides the REST API for admin\n operations", + "description" : "This provides the REST API for admin\n operations", "version" : "v1", "title" : "Pulsar Admin REST API", "license" : { @@ -18,6 +18,8 @@ "name" : "clusters" }, { "name" : "namespaces" + }, { + "name" : "non-persistent topic" }, { "name" : "persistent topic" }, { @@ -111,6 +113,9 @@ }, "403" : { "description" : "Don't have admin permission" + }, + "409" : { + "description" : "Load-manager doesn't support operation" } } } @@ -295,7 +300,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -355,7 +364,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -592,6 +605,35 @@ } } }, + "/clusters/{cluster}/peers" : { + "post" : { + "tags" : [ "clusters" ], + "summary" : "Update peer-cluster-list for a cluster.", + "description" : "This operation requires Pulsar super-user privileges.", + "operationId" : "setPeerClusterNames", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "204" : { + "description" : "Cluster has been updated" + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Cluster doesn't exist" + }, + "412" : { + "description" : "Peer cluster doesn't exist" + } + } + } + }, "/namespaces/{property}" : { "get" : { "tags" : [ "namespaces" ], @@ -610,7 +652,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -645,7 +691,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -1034,6 +1084,40 @@ } } }, + "/namespaces/{property}/{cluster}/{namespace}/deduplication" : { + "post" : { + "tags" : [ "namespaces" ], + "summary" : "Enable or disable broker side deduplication for all topics in a namespace", + "description" : "", + "operationId" : "modifyDeduplication", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Property or cluster or namespace doesn't exist" + } + } + } + }, "/namespaces/{property}/{cluster}/{namespace}/destinations" : { "get" : { "tags" : [ "namespaces" ], @@ -1062,7 +1146,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -1074,6 +1162,75 @@ } } }, + "/namespaces/{property}/{cluster}/{namespace}/dispatchRate" : { + "get" : { + "tags" : [ "namespaces" ], + "summary" : "Get dispatch-rate configured for the namespace, -1 represents not configured yet", + "description" : "", + "operationId" : "getDispatchRate", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/DispatchRate" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace does not exist" + } + } + }, + "post" : { + "tags" : [ "namespaces" ], + "summary" : "Set dispatch-rate throttling for all topics of the namespace", + "description" : "", + "operationId" : "setDispatchRate", + "consumes" : [ "application/json" ], + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + } + } + } + }, "/namespaces/{property}/{cluster}/{namespace}/messageTTL" : { "get" : { "tags" : [ "namespaces" ], @@ -1341,6 +1498,9 @@ "type" : "string" } ], "responses" : { + "400" : { + "description" : "Invalid persistence policies" + }, "403" : { "description" : "Don't have admin permission" }, @@ -1428,6 +1588,9 @@ "404" : { "description" : "Property or cluster or namespace doesn't exist" }, + "409" : { + "description" : "Peer-cluster can't be part of replication-cluster" + }, "412" : { "description" : "Namespace is not global or invalid cluster ids" } @@ -1771,6 +1934,12 @@ "required" : false, "type" : "boolean", "default" : false + }, { + "name" : "unload", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false } ], "responses" : { "403" : { @@ -1871,9 +2040,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}" : { + "/non-persistent/{property}/{cluster}/{namespace}" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the list of destinations under a namespace.", "description" : "", "operationId" : "getList", @@ -1913,9 +2082,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/partitioned" : { + "/non-persistent/{property}/{cluster}/{namespace}/partitioned" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the list of partitioned topics under a namespace.", "description" : "", "operationId" : "getPartitionedTopicList", @@ -1955,9 +2124,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}" : { "delete" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Delete a topic.", "description" : "The topic cannot be deleted if there's any active subscription or producer connected to the it.", "operationId" : "deleteTopic", @@ -2002,9 +2171,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/all_subscription/expireMessages/{expireTimeInSeconds}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/all_subscription/expireMessages/{expireTimeInSeconds}" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Expire messages on all subscriptions of topic.", "description" : "", "operationId" : "expireMessagesForAllSubscriptions", @@ -2052,9 +2221,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/backlog" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/backlog" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get estimated backlog for offline topic.", "description" : "", "operationId" : "getBacklog", @@ -2102,9 +2271,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/internal-info" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/internal-info" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the internal stats for the topic.", "description" : "", "operationId" : "getManagedLedgerInfo", @@ -2140,9 +2309,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/internalStats" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/internalStats" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the internal stats for the topic.", "description" : "", "operationId" : "getInternalStats", @@ -2190,9 +2359,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/partitioned-stats" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/partitioned-stats" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the stats for the partitioned topic.", "description" : "", "operationId" : "getPartitionedStats", @@ -2240,9 +2409,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/partitions" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/partitions" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get partitioned topic metadata.", "description" : "", "operationId" : "getPartitionedMetadata", @@ -2287,7 +2456,7 @@ } }, "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Increment partitons of an existing partitioned topic.", "description" : "It only increments partitions of existing non-global partitioned-topic", "operationId" : "updatePartitionedTopic", @@ -2323,7 +2492,7 @@ } }, "put" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Create a partitioned topic.", "description" : "It needs to be called before creating a producer on a partitioned topic.", "operationId" : "createPartitionedTopic", @@ -2365,7 +2534,7 @@ } }, "delete" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Delete a partitioned topic.", "description" : "It will also delete all the partitions of the topic if it exists.", "operationId" : "deletePartitionedTopic", @@ -2407,9 +2576,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/permissions" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/permissions" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get permissions on a destination.", "description" : "Retrieve the effective permissions for a destination. These permissions are defined by the permissions set at thenamespace level combined (union) with any eventual specific permission set on the destination.", "operationId" : "getPermissionsOnDestination", @@ -2454,9 +2623,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/permissions/{role}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/permissions/{role}" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Grant a new permission to a role on a single destination.", "description" : "", "operationId" : "grantPermissionsOnDestination", @@ -2500,7 +2669,7 @@ } }, "delete" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Revoke permissions on a destination.", "description" : "Revoke permissions to a role on a single destination. If the permission was not set at the destinationlevel, but rather at the namespace level, this operation will return an error (HTTP status code 412).", "operationId" : "revokePermissionsOnDestination", @@ -2544,9 +2713,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/stats" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/stats" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the stats for the topic.", "description" : "", "operationId" : "getStats", @@ -2594,9 +2763,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}" : { "delete" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Delete a subscription.", "description" : "There should not be any active consumers on the subscription.", "operationId" : "deleteSubscription", @@ -2646,9 +2815,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/expireMessages/{expireTimeInSeconds}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/expireMessages/{expireTimeInSeconds}" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Expire messages on a topic subscription.", "description" : "", "operationId" : "expireTopicMessages", @@ -2701,9 +2870,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/position/{messagePosition}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/position/{messagePosition}" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Peek nth message on a topic subscription.", "description" : "", "operationId" : "peekNthMessage", @@ -2756,11 +2925,63 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/resetcursor/{timestamp}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/resetcursor" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], + "summary" : "Reset subscription to message position closest to given position.", + "description" : "It fence cursor and disconnects all active consumers before reseting cursor.", + "operationId" : "resetCursorOnPosition", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic/Subscription does not exist" + }, + "405" : { + "description" : "Not supported for partitioned topics" + } + } + } + }, + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/resetcursor/{timestamp}" : { + "post" : { + "tags" : [ "non-persistent topic" ], "summary" : "Reset subscription to message position closest to absolute timestamp (in ms).", - "description" : "There should not be any active consumers on the subscription.", + "description" : "It fence cursor and disconnects all active consumers before reseting cursor.", "operationId" : "resetCursor", "produces" : [ "application/json" ], "parameters" : [ { @@ -2806,20 +3027,14 @@ "description" : "Don't have admin permission" }, "404" : { - "description" : "Topic does not exist" - }, - "405" : { - "description" : "Not supported for global topics" - }, - "412" : { - "description" : "Subscription has active consumers" + "description" : "Topic/Subscription does not exist" } } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip/{numMessages}" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip/{numMessages}" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Skip messages on a topic subscription.", "description" : "", "operationId" : "skipMessages", @@ -2872,9 +3087,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip_all" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip_all" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Skip all messages on a topic subscription.", "description" : "Completely clears the backlog on the subscription.", "operationId" : "skipAllMessages", @@ -2917,13 +3132,16 @@ }, "404" : { "description" : "Topic or subscription does not exist" + }, + "405" : { + "description" : "Operation not allowed on non-persistent topic" } } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/subscriptions" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/subscriptions" : { "get" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Get the list of persistent subscriptions for a given topic.", "description" : "", "operationId" : "getSubscriptions", @@ -2974,9 +3192,9 @@ } } }, - "/persistent/{property}/{cluster}/{namespace}/{destination}/terminate" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/terminate" : { "post" : { - "tags" : [ "persistent topic" ], + "tags" : [ "non-persistent topic" ], "summary" : "Terminate a topic. A topic that is terminated will not accept any more messages to be published and will let consumer to drain existing messages in backlog", "description" : "", "operationId" : "terminate", @@ -3020,11 +3238,1307 @@ }, "404" : { "description" : "Topic does not exist" + }, + "405" : { + "description" : "Operation not allowed on non-persistent topic" } } } }, - "/properties" : { + "/non-persistent/{property}/{cluster}/{namespace}/{destination}/unload" : { + "put" : { + "tags" : [ "non-persistent topic" ], + "summary" : "Unload a topic", + "description" : "", + "operationId" : "unloadTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the list of destinations under a namespace.", + "description" : "", + "operationId" : "getList", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace doesn't exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/partitioned" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the list of partitioned topics under a namespace.", + "description" : "", + "operationId" : "getPartitionedTopicList", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace doesn't exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}" : { + "delete" : { + "tags" : [ "persistent topic" ], + "summary" : "Delete a topic.", + "description" : "The topic cannot be deleted if there's any active subscription or producer connected to the it.", + "operationId" : "deleteTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + }, + "412" : { + "description" : "Topic has active producers/subscriptions" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/all_subscription/expireMessages/{expireTimeInSeconds}" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Expire messages on all subscriptions of topic.", + "description" : "", + "operationId" : "expireMessagesForAllSubscriptions", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "expireTimeInSeconds", + "in" : "path", + "required" : true, + "type" : "integer", + "format" : "int32" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic or subscription does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/backlog" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get estimated backlog for offline topic.", + "description" : "", + "operationId" : "getBacklog", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/PersistentOfflineTopicStats" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/internal-info" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the internal stats for the topic.", + "description" : "", + "operationId" : "getManagedLedgerInfo", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/internalStats" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the internal stats for the topic.", + "description" : "", + "operationId" : "getInternalStats", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/PersistentTopicInternalStats" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/partitioned-stats" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the stats for the partitioned topic.", + "description" : "", + "operationId" : "getPartitionedStats", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/PartitionedTopicStats" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/partitions" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get partitioned topic metadata.", + "description" : "", + "operationId" : "getPartitionedMetadata", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/PartitionedTopicMetadata" + } + }, + "403" : { + "description" : "Don't have admin permission" + } + } + }, + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Increment partitons of an existing partitioned topic.", + "description" : "It only increments partitions of existing non-global partitioned-topic", + "operationId" : "updatePartitionedTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "409" : { + "description" : "Partitioned topic does not exist" + } + } + }, + "put" : { + "tags" : [ "persistent topic" ], + "summary" : "Create a partitioned topic.", + "description" : "It needs to be called before creating a producer on a partitioned topic.", + "operationId" : "createPartitionedTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "409" : { + "description" : "Partitioned topic already exist" + } + } + }, + "delete" : { + "tags" : [ "persistent topic" ], + "summary" : "Delete a partitioned topic.", + "description" : "It will also delete all the partitions of the topic if it exists.", + "operationId" : "deletePartitionedTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Partitioned topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/permissions" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get permissions on a destination.", + "description" : "Retrieve the effective permissions for a destination. These permissions are defined by the permissions set at thenamespace level combined (union) with any eventual specific permission set on the destination.", + "operationId" : "getPermissionsOnDestination", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "object" + } + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace doesn't exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/permissions/{role}" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Grant a new permission to a role on a single destination.", + "description" : "", + "operationId" : "grantPermissionsOnDestination", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "role", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace doesn't exist" + }, + "409" : { + "description" : "Concurrent modification" + } + } + }, + "delete" : { + "tags" : [ "persistent topic" ], + "summary" : "Revoke permissions on a destination.", + "description" : "Revoke permissions to a role on a single destination. If the permission was not set at the destinationlevel, but rather at the namespace level, this operation will return an error (HTTP status code 412).", + "operationId" : "revokePermissionsOnDestination", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "role", + "in" : "path", + "required" : true, + "type" : "string" + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Namespace doesn't exist" + }, + "412" : { + "description" : "Permissions are not set at the destination level" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/stats" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the stats for the topic.", + "description" : "", + "operationId" : "getStats", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/PersistentTopicStats" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}" : { + "delete" : { + "tags" : [ "persistent topic" ], + "summary" : "Delete a subscription.", + "description" : "There should not be any active consumers on the subscription.", + "operationId" : "deleteSubscription", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + }, + "412" : { + "description" : "Subscription has active consumers" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/expireMessages/{expireTimeInSeconds}" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Expire messages on a topic subscription.", + "description" : "", + "operationId" : "expireTopicMessages", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "expireTimeInSeconds", + "in" : "path", + "required" : true, + "type" : "integer", + "format" : "int32" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic or subscription does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/position/{messagePosition}" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Peek nth message on a topic subscription.", + "description" : "", + "operationId" : "peekNthMessage", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "messagePosition", + "in" : "path", + "required" : true, + "type" : "integer", + "format" : "int32" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic, subscription or the message position does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/resetcursor" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Reset subscription to message position closest to given position.", + "description" : "It fence cursor and disconnects all active consumers before reseting cursor.", + "operationId" : "resetCursorOnPosition", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic/Subscription does not exist" + }, + "405" : { + "description" : "Not supported for partitioned topics" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/resetcursor/{timestamp}" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Reset subscription to message position closest to absolute timestamp (in ms).", + "description" : "It fence cursor and disconnects all active consumers before reseting cursor.", + "operationId" : "resetCursor", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "timestamp", + "in" : "path", + "required" : true, + "type" : "integer", + "format" : "int64" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic/Subscription does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip/{numMessages}" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Skip messages on a topic subscription.", + "description" : "", + "operationId" : "skipMessages", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "numMessages", + "in" : "path", + "required" : true, + "type" : "integer", + "format" : "int32" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic or subscription does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscription/{subName}/skip_all" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Skip all messages on a topic subscription.", + "description" : "Completely clears the backlog on the subscription.", + "operationId" : "skipAllMessages", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "subName", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic or subscription does not exist" + }, + "405" : { + "description" : "Operation not allowed on non-persistent topic" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/subscriptions" : { + "get" : { + "tags" : [ "persistent topic" ], + "summary" : "Get the list of persistent subscriptions for a given topic.", + "description" : "", + "operationId" : "getSubscriptions", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "type" : "object" + } + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/terminate" : { + "post" : { + "tags" : [ "persistent topic" ], + "summary" : "Terminate a topic. A topic that is terminated will not accept any more messages to be published and will let consumer to drain existing messages in backlog", + "description" : "", + "operationId" : "terminate", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/MessageId" + } + }, + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + }, + "405" : { + "description" : "Operation not allowed on non-persistent topic" + } + } + } + }, + "/persistent/{property}/{cluster}/{namespace}/{destination}/unload" : { + "put" : { + "tags" : [ "persistent topic" ], + "summary" : "Unload a topic", + "description" : "", + "operationId" : "unloadTopic", + "produces" : [ "application/json" ], + "parameters" : [ { + "name" : "property", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "cluster", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "namespace", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "destination", + "in" : "path", + "required" : true, + "type" : "string" + }, { + "name" : "authoritative", + "in" : "query", + "required" : false, + "type" : "boolean", + "default" : false + } ], + "responses" : { + "403" : { + "description" : "Don't have admin permission" + }, + "404" : { + "description" : "Topic does not exist" + } + } + } + }, + "/properties" : { "get" : { "tags" : [ "properties" ], "summary" : "Get the list of properties.", @@ -3168,7 +4682,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -3187,7 +4705,11 @@ "200" : { "description" : "successful operation", "schema" : { - "type" : "string" + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } }, "403" : { @@ -3445,6 +4967,13 @@ }, "brokerServiceUrlTls" : { "type" : "string" + }, + "peerClusterNames" : { + "type" : "array", + "uniqueItems" : true, + "items" : { + "type" : "string" + } } } }, @@ -3475,8 +5004,7 @@ "format" : "int32" }, "blockedConsumerOnUnackedMsgs" : { - "type" : "boolean", - "default" : false + "type" : "boolean" }, "address" : { "type" : "string" @@ -3512,8 +5040,7 @@ "type" : "string" }, "waitingReadOp" : { - "type" : "boolean", - "default" : false + "type" : "boolean" }, "pendingReadOps" : { "type" : "integer", @@ -3539,6 +5066,38 @@ }, "state" : { "type" : "string" + }, + "numberOfEntriesSinceFirstNotAckedMessage" : { + "type" : "integer", + "format" : "int64" + }, + "totalNonContiguousDeletedMessagesRange" : { + "type" : "integer", + "format" : "int32" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int64" + } + } + } + }, + "DispatchRate" : { + "type" : "object", + "properties" : { + "dispatchThrottlingRatePerTopicInMsg" : { + "type" : "integer", + "format" : "int32" + }, + "dispatchThrottlingRatePerTopicInByte" : { + "type" : "integer", + "format" : "int64" + }, + "ratePeriodInSecond" : { + "type" : "integer", + "format" : "int32" } } }, @@ -3601,6 +5160,12 @@ "pulsarServiceUrlTls" : { "type" : "string" }, + "persistentTopicsEnabled" : { + "type" : "boolean" + }, + "nonPersistentTopicsEnabled" : { + "type" : "boolean" + }, "timestamp" : { "type" : "integer", "format" : "int64" @@ -3615,19 +5180,19 @@ }, "numTopics" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, "numConsumers" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, "numProducers" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, "numBundles" : { "type" : "integer", - "format" : "int64" + "format" : "int32" }, "systemResourceUsage" : { "$ref" : "#/definitions/SystemResourceUsage" @@ -3660,77 +5225,318 @@ "type" : "number", "format" : "double" }, - "allocatedBandwidthIn" : { + "allocatedBandwidthIn" : { + "type" : "number", + "format" : "double" + }, + "allocatedBandwidthOut" : { + "type" : "number", + "format" : "double" + }, + "allocatedMsgRateIn" : { + "type" : "number", + "format" : "double" + }, + "allocatedMsgRateOut" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedCPU" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedMemory" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedBandwidthIn" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedBandwidthOut" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedMsgRateIn" : { + "type" : "number", + "format" : "double" + }, + "preAllocatedMsgRateOut" : { + "type" : "number", + "format" : "double" + }, + "cpu" : { + "$ref" : "#/definitions/ResourceUsage" + }, + "directMemory" : { + "$ref" : "#/definitions/ResourceUsage" + }, + "bandwidthIn" : { + "$ref" : "#/definitions/ResourceUsage" + }, + "memory" : { + "$ref" : "#/definitions/ResourceUsage" + }, + "bandwidthOut" : { + "$ref" : "#/definitions/ResourceUsage" + }, + "lastUpdate" : { + "type" : "integer", + "format" : "int64" + }, + "msgThroughputIn" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputOut" : { + "type" : "number", + "format" : "double" + }, + "underLoaded" : { + "type" : "boolean" + }, + "overLoaded" : { + "type" : "boolean" + }, + "loadReportType" : { + "type" : "string" + } + } + }, + "MessageId" : { + "type" : "object" + }, + "Metrics" : { + "type" : "object", + "properties" : { + "metrics" : { + "type" : "object", + "additionalProperties" : { + "type" : "object" + } + }, + "dimensions" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "NamespaceBundleStats" : { + "type" : "object", + "properties" : { + "msgRateIn" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputIn" : { + "type" : "number", + "format" : "double" + }, + "msgRateOut" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputOut" : { + "type" : "number", + "format" : "double" + }, + "consumerCount" : { + "type" : "integer", + "format" : "int32" + }, + "producerCount" : { + "type" : "integer", + "format" : "int32" + }, + "topics" : { + "type" : "integer", + "format" : "int64" + }, + "cacheSize" : { + "type" : "integer", + "format" : "int64" + } + } + }, + "NamespaceIsolationData" : { + "type" : "object", + "properties" : { + "namespaces" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "primary" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "secondary" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "auto_failover_policy" : { + "$ref" : "#/definitions/AutoFailoverPolicyData" + } + } + }, + "NamespaceOwnershipStatus" : { + "type" : "object", + "properties" : { + "broker_assignment" : { + "type" : "string", + "enum" : [ "primary", "secondary", "shared" ] + }, + "is_controlled" : { + "type" : "boolean" + }, + "is_active" : { + "type" : "boolean" + } + } + }, + "NonPersistentPublisherStats" : { + "type" : "object", + "properties" : { + "msgRateIn" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputIn" : { + "type" : "number", + "format" : "double" + }, + "averageMsgSize" : { + "type" : "number", + "format" : "double" + }, + "producerId" : { + "type" : "integer", + "format" : "int64" + }, + "producerName" : { + "type" : "string" + }, + "address" : { + "type" : "string" + }, + "connectedSince" : { + "type" : "string" + }, + "clientVersion" : { + "type" : "string" + }, + "msgDropRate" : { + "type" : "number", + "format" : "double" + } + } + }, + "NonPersistentReplicatorStats" : { + "type" : "object", + "properties" : { + "msgRateIn" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputIn" : { "type" : "number", "format" : "double" }, - "allocatedBandwidthOut" : { + "msgRateOut" : { "type" : "number", "format" : "double" }, - "allocatedMsgRateIn" : { + "msgThroughputOut" : { "type" : "number", "format" : "double" }, - "allocatedMsgRateOut" : { + "msgRateExpired" : { "type" : "number", "format" : "double" }, - "preAllocatedCPU" : { - "type" : "number", - "format" : "double" + "replicationBacklog" : { + "type" : "integer", + "format" : "int64" }, - "preAllocatedMemory" : { + "connected" : { + "type" : "boolean" + }, + "replicationDelayInSeconds" : { + "type" : "integer", + "format" : "int64" + }, + "inboundConnection" : { + "type" : "string" + }, + "inboundConnectedSince" : { + "type" : "string" + }, + "outboundConnection" : { + "type" : "string" + }, + "outboundConnectedSince" : { + "type" : "string" + }, + "msgDropRate" : { "type" : "number", "format" : "double" - }, - "preAllocatedBandwidthIn" : { + } + } + }, + "NonPersistentSubscriptionStats" : { + "type" : "object", + "properties" : { + "msgRateOut" : { "type" : "number", "format" : "double" }, - "preAllocatedBandwidthOut" : { + "msgThroughputOut" : { "type" : "number", "format" : "double" }, - "preAllocatedMsgRateIn" : { + "msgRateRedeliver" : { "type" : "number", "format" : "double" }, - "preAllocatedMsgRateOut" : { + "msgBacklog" : { + "type" : "integer", + "format" : "int64" + }, + "blockedSubscriptionOnUnackedMsgs" : { + "type" : "boolean" + }, + "unackedMessages" : { + "type" : "integer", + "format" : "int64" + }, + "type" : { + "type" : "string", + "enum" : [ "Exclusive", "Shared", "Failover" ] + }, + "msgRateExpired" : { "type" : "number", "format" : "double" }, - "underLoaded" : { - "type" : "boolean", - "default" : false - }, - "overLoaded" : { - "type" : "boolean", - "default" : false - } - } - }, - "MessageId" : { - "type" : "object" - }, - "Metrics" : { - "type" : "object", - "properties" : { - "metrics" : { - "type" : "object", - "additionalProperties" : { - "type" : "object" + "consumers" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConsumerStats" } }, - "dimensions" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } + "msgDropRate" : { + "type" : "number", + "format" : "double" } } }, - "NamespaceBundleStats" : { + "NonPersistentTopicStats" : { "type" : "object", "properties" : { "msgRateIn" : { @@ -3749,64 +5555,38 @@ "type" : "number", "format" : "double" }, - "consumerCount" : { - "type" : "integer", - "format" : "int32" - }, - "producerCount" : { - "type" : "integer", - "format" : "int32" + "averageMsgSize" : { + "type" : "number", + "format" : "double" }, - "topics" : { + "storageSize" : { "type" : "integer", "format" : "int64" }, - "cacheSize" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "NamespaceIsolationData" : { - "type" : "object", - "properties" : { - "namespaces" : { + "publishers" : { "type" : "array", "items" : { - "type" : "string" + "$ref" : "#/definitions/NonPersistentPublisherStats" } }, - "primary" : { - "type" : "array", - "items" : { - "type" : "string" + "subscriptions" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/NonPersistentSubscriptionStats" } }, - "secondary" : { - "type" : "array", - "items" : { - "type" : "string" + "replication" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/NonPersistentReplicatorStats" } }, - "auto_failover_policy" : { - "$ref" : "#/definitions/AutoFailoverPolicyData" - } - } - }, - "NamespaceOwnershipStatus" : { - "type" : "object", - "properties" : { - "broker_assignment" : { - "type" : "string", - "enum" : [ "primary", "secondary", "shared" ] - }, - "is_controlled" : { - "type" : "boolean", - "default" : false + "deduplicationStatus" : { + "type" : "string" }, - "is_active" : { - "type" : "boolean", - "default" : false + "msgDropRate" : { + "type" : "number", + "format" : "double" } } }, @@ -3858,7 +5638,7 @@ "subscriptions" : { "type" : "object", "additionalProperties" : { - "$ref" : "#/definitions/PersistentSubscriptionStats" + "$ref" : "#/definitions/SubscriptionStats" } }, "replication" : { @@ -3867,6 +5647,9 @@ "$ref" : "#/definitions/ReplicatorStats" } }, + "deduplicationStatus" : { + "type" : "string" + }, "metadata" : { "$ref" : "#/definitions/PartitionedTopicMetadata" }, @@ -3975,49 +5758,6 @@ } } }, - "PersistentSubscriptionStats" : { - "type" : "object", - "properties" : { - "msgRateOut" : { - "type" : "number", - "format" : "double" - }, - "msgThroughputOut" : { - "type" : "number", - "format" : "double" - }, - "msgRateRedeliver" : { - "type" : "number", - "format" : "double" - }, - "msgBacklog" : { - "type" : "integer", - "format" : "int64" - }, - "blockedSubscriptionOnUnackedMsgs" : { - "type" : "boolean", - "default" : false - }, - "unackedMessages" : { - "type" : "integer", - "format" : "int64" - }, - "type" : { - "type" : "string", - "enum" : [ "Exclusive", "Shared", "Failover" ] - }, - "msgRateExpired" : { - "type" : "number", - "format" : "double" - }, - "consumers" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/ConsumerStats" - } - } - } - }, "PersistentTopicInternalStats" : { "type" : "object", "properties" : { @@ -4111,7 +5851,7 @@ "subscriptions" : { "type" : "object", "additionalProperties" : { - "$ref" : "#/definitions/PersistentSubscriptionStats" + "$ref" : "#/definitions/SubscriptionStats" } }, "replication" : { @@ -4119,6 +5859,9 @@ "additionalProperties" : { "$ref" : "#/definitions/ReplicatorStats" } + }, + "deduplicationStatus" : { + "type" : "string" } } }, @@ -4143,9 +5886,18 @@ "$ref" : "#/definitions/BacklogQuota" } }, + "clusterDispatchRate" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/definitions/DispatchRate" + } + }, "persistence" : { "$ref" : "#/definitions/PersistencePolicies" }, + "deduplicationEnabled" : { + "type" : "boolean" + }, "latency_stats_sample_rate" : { "type" : "object", "additionalProperties" : { @@ -4161,8 +5913,7 @@ "$ref" : "#/definitions/RetentionPolicies" }, "deleted" : { - "type" : "boolean", - "default" : false + "type" : "boolean" } } }, @@ -4397,8 +6148,7 @@ "format" : "int64" }, "connected" : { - "type" : "boolean", - "default" : false + "type" : "boolean" }, "replicationDelayInSeconds" : { "type" : "integer", @@ -4457,19 +6207,18 @@ "format" : "double" }, "dynamic" : { - "type" : "boolean", - "default" : false + "type" : "boolean" } } }, "ResourceUnit" : { "type" : "object", "properties" : { - "resourceId" : { - "type" : "string" - }, "availableResource" : { "$ref" : "#/definitions/ResourceDescription" + }, + "resourceId" : { + "type" : "string" } } }, @@ -4499,6 +6248,48 @@ } } }, + "SubscriptionStats" : { + "type" : "object", + "properties" : { + "msgRateOut" : { + "type" : "number", + "format" : "double" + }, + "msgThroughputOut" : { + "type" : "number", + "format" : "double" + }, + "msgRateRedeliver" : { + "type" : "number", + "format" : "double" + }, + "msgBacklog" : { + "type" : "integer", + "format" : "int64" + }, + "blockedSubscriptionOnUnackedMsgs" : { + "type" : "boolean" + }, + "unackedMessages" : { + "type" : "integer", + "format" : "int64" + }, + "type" : { + "type" : "string", + "enum" : [ "Exclusive", "Shared", "Failover" ] + }, + "msgRateExpired" : { + "type" : "number", + "format" : "double" + }, + "consumers" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConsumerStats" + } + } + } + }, "SystemResourceUsage" : { "type" : "object", "properties" : { From 7984dec1aeab4ee650cfce9906fceb08e6c4dd49 Mon Sep 17 00:00:00 2001 From: rdhabalia Date: Wed, 22 Nov 2017 17:31:57 -0800 Subject: [PATCH 3/3] update swagger file generation doc --- site/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/README.md b/site/README.md index d7fcfe976ce83..26974d2c668ed 100644 --- a/site/README.md +++ b/site/README.md @@ -125,7 +125,7 @@ $ make protobuf_doc_gen ### REST API docs -The REST API docs are built using a JSON definition generated by Maven's Swagger plugin. This definition is automatically generated when Maven builds Pulsar. In the rare case when you do need to re-generate this JSON definition, run `mvn package` to build all of Pulsar. Then you'll need to copy the new definition into the `site/_data` folder using this command: +The REST API docs are built using a JSON definition generated by Maven's Swagger plugin. This definition is automatically generated when Maven builds Pulsar. In the rare case when you do need to re-generate this JSON definition, run `mvn package -P swagger` to build all of Pulsar. Then you'll need to copy the new definition into the `site/_data` folder using this command: ```bash $ make swagger_definition_copy