From 914af2b44e5bcccdcfead9ddf770ffb6ee30b7f4 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Wed, 16 Jun 2021 15:23:53 +0200 Subject: [PATCH 1/3] Extend app registry with methods to add providers and mimetype filters --- cs3/app/registry/v1beta1/registry_api.proto | 79 ++++- cs3/app/registry/v1beta1/resources.proto | 5 +- cs3/gateway/v1beta1/gateway_api.proto | 6 + docs/index.html | 316 ++++++++++++++++++-- proto.lock | 156 ++++++++-- 5 files changed, 499 insertions(+), 63 deletions(-) diff --git a/cs3/app/registry/v1beta1/registry_api.proto b/cs3/app/registry/v1beta1/registry_api.proto index 3620f314..30e1a2e6 100644 --- a/cs3/app/registry/v1beta1/registry_api.proto +++ b/cs3/app/registry/v1beta1/registry_api.proto @@ -53,8 +53,14 @@ service RegistryAPI { // Returns the app providers that are capable of handling this resource info. // MUST return CODE_NOT_FOUND if no providers are available. rpc GetAppProviders(GetAppProvidersRequest) returns (GetAppProvidersResponse); + // Registers a new app provider to the registry. + rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse); // Returns a list of the available app providers known by this registry. rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse); + // Returns the default app provider which serves a specified mime type. + rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse); + // Sets the default app provider for a specified mime type. + rpc SetDefaultAppProviderForMimeType(SetDefaultAppProviderForMimeTypeRequest) returns (SetDefaultAppProviderForMimeTypeResponse); } message GetAppProvidersRequest { @@ -78,6 +84,24 @@ message GetAppProvidersResponse { repeated ProviderInfo providers = 3; } +message AddAppProviderRequest { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The app provider to be registered. + ProviderInfo provider = 2; +} + +message AddAppProviderResponse { + // REQUIRED. + // The response status. + cs3.rpc.v1beta1.Status status = 1; + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 2; +} + message ListAppProvidersRequest { // OPTIONAL. // Opaque information. @@ -85,17 +109,8 @@ message ListAppProvidersRequest { // REQUIRED. // Represents a filter to apply to the request. message Filter { - // The filter to apply. - enum Type { - TYPE_INVALID = 0; - TYPE_MIME_TYPE = 1; - } - // REQUIRED. - Type type = 2; - oneof term { - // if present, the response MUST list all known app providers for the given mimetype. - string mime_type = 3; - } + // if present, the response MUST list all known app providers for the given mimetype. + string mime_type = 1; } // OPTIONAL. // The list of filters to apply if any. @@ -113,3 +128,45 @@ message ListAppProvidersResponse { // The list of app providers this registry knows about. repeated ProviderInfo providers = 3; } + +message GetDefaultAppProviderForMimeTypeRequest { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The mimetype for which the default app has to be returned. + string mime_type = 2; +} + +message GetDefaultAppProviderForMimeTypeResponse { + // REQUIRED. + // The response status. + cs3.rpc.v1beta1.Status status = 1; + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 2; + // REQUIRED. + // The default app provider for the specified mime type. + ProviderInfo provider = 3; +} + +message SetDefaultAppProviderForMimeTypeRequest { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The mimetype for which the default app has to be returned. + string mime_type = 2; + // REQUIRED. + // The app provider to be marked as default for the specified mime type. + ProviderInfo provider = 3; +} + +message SetDefaultAppProviderForMimeTypeResponse { + // REQUIRED. + // The response status. + cs3.rpc.v1beta1.Status status = 1; + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 2; +} diff --git a/cs3/app/registry/v1beta1/resources.proto b/cs3/app/registry/v1beta1/resources.proto index 73ac1af4..0f65c2e6 100644 --- a/cs3/app/registry/v1beta1/resources.proto +++ b/cs3/app/registry/v1beta1/resources.proto @@ -43,8 +43,11 @@ message ProviderInfo { // For example, tcp://localhost:1099. string address = 3; // OPTIONAL. + // A human-readable name of the app provider. + string name = 4; + // OPTIONAL. // Information to describe the functionalities // offered by the app provider. Meant to be read // by humans. - string description = 4; + string description = 5; } diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index 4338ee57..8e49fb78 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -287,8 +287,14 @@ service GatewayAPI { // Returns the app providers that are capable of handling this resource info. // MUST return CODE_NOT_FOUND if no providers are available. rpc GetAppProviders(cs3.app.registry.v1beta1.GetAppProvidersRequest) returns (cs3.app.registry.v1beta1.GetAppProvidersResponse); + // Registers a new app provider to the registry. + rpc AddAppProvider(cs3.app.registry.v1beta1.AddAppProviderRequest) returns (cs3.app.registry.v1beta1.AddAppProviderResponse); // Returns a list of the available app providers known by this registry. rpc ListAppProviders(cs3.app.registry.v1beta1.ListAppProvidersRequest) returns (cs3.app.registry.v1beta1.ListAppProvidersResponse); + // Returns the default app provider which serves a specified mime type. + rpc GetDefaultAppProviderForMimeType(cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeRequest) returns (cs3.app.registry.v1beta1.GetDefaultAppProviderForMimeTypeResponse); + // Sets the default app provider for a specified mime type. + rpc SetDefaultAppProviderForMimeType(cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest) returns (cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeResponse); // *****************************************************************/ // ************************ USER PROVIDER **************************/ // *****************************************************************/ diff --git a/docs/index.html b/docs/index.html index 7c735f53..f54ae206 100644 --- a/docs/index.html +++ b/docs/index.html @@ -539,6 +539,14 @@

Table of Contents

cs3/app/registry/v1beta1/registry_api.proto