Add Volume management API & example

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Guillaume Tardif 2020-09-29 10:10:52 +02:00
Родитель 4e9b2cbf92
Коммит de9ce936ca
9 изменённых файлов: 1880 добавлений и 0 удалений

61
examples/volume.ts Normal file
Просмотреть файл

@ -0,0 +1,61 @@
/*
Copyright 2020 The Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import * as grpc from '@grpc/grpc-js';
import { Volumes } from '../src/index';
import {
AciVolumeCreateOptions,
VolumesCreateRequest,
VolumesCreateResponse,
VolumesListRequest,
VolumesListResponse,
} from '../src/volumes';
const client = new Volumes();
client.volumesList(
new VolumesListRequest(),
(error: grpc.ServiceError | null, response: VolumesListResponse) => {
if (error != null) {
throw error;
}
response.getVolumesList().forEach((volume) => {
console.log(
volume.getId() + " : " + volume.getDescription()
);
});
}
);
let request = new VolumesCreateRequest();
request.setName("test-volume")
let aciVolumeCreateOptions = new AciVolumeCreateOptions();
aciVolumeCreateOptions.setStorageAccount("mystorageaccount")
request.setAciOption(aciVolumeCreateOptions)
client.volumesCreate(
request,
(error: grpc.ServiceError | null, response: VolumesCreateResponse) => {
if (error != null) {
console.log(error.message);
} else {
console.log(
response.getVolume()?.getId()
);
}
}
);

Просмотреть файл

@ -21,6 +21,7 @@ node_modules/.bin/grpc_tools_node_protoc \
src/protos/contexts/v1/*.proto \
src/protos/containers/v1/*.proto \
src/protos/compose/v1/*.proto \
src/protos/volumes/v1/*.proto \
src/protos/streams/v1/*.proto
# generate d.ts codes
@ -31,4 +32,5 @@ node_modules/.bin/grpc_tools_node_protoc \
src/protos/contexts/v1/*.proto \
src/protos/containers/v1/*.proto \
src/protos/compose/v1/*.proto \
src/protos/volumes/v1/*.proto \
src/protos/streams/v1/*.proto

Просмотреть файл

@ -18,6 +18,7 @@ import { homedir, platform } from 'os';
import { credentials } from '@grpc/grpc-js';
import { ContainersClient } from './protos/containers/v1/containers_grpc_pb';
import { VolumesClient } from './protos/volumes/v1/volumes_grpc_pb';
import { ContextsClient } from './protos/contexts/v1/contexts_grpc_pb';
import { ComposeClient } from './protos/compose/v1/compose_grpc_pb';
import { StreamingClient } from './protos/streams/v1/streams_grpc_pb';
@ -33,6 +34,12 @@ export class Containers extends ContainersClient {
}
}
export class Volumes extends VolumesClient {
constructor(address: string = addr) {
super(address, credentials.createInsecure());
}
}
export class Contexts extends ContextsClient {
constructor(address: string = addr) {
super(address, credentials.createInsecure());

Просмотреть файл

@ -0,0 +1,62 @@
//
// Copyright 2020 Docker Compose CLI authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package com.docker.api.protos.volumes.v1;
import "google/protobuf/any.proto";
option go_package = "github.com/docker/compose-cli/protos/volumes/v1;v1";
service Volumes {
rpc VolumesCreate(VolumesCreateRequest) returns (VolumesCreateResponse);
rpc VolumesList(VolumesListRequest) returns (VolumesListResponse);
rpc VolumesDelete(VolumesDeleteRequest) returns (VolumesDeleteResponse);
}
message Volume {
string id = 1;
string description = 2;
}
message AciVolumeCreateOptions {
string storage_account = 1;
}
message VolumesCreateRequest {
string name = 1;
oneof options {
AciVolumeCreateOptions aci_option = 2;
}
}
message VolumesCreateResponse {
Volume volume = 1;
}
message VolumesListRequest {
}
message VolumesListResponse {
repeated Volume volumes = 1;
}
message VolumesDeleteRequest {
string id = 1;
}
message VolumesDeleteResponse {
}

77
src/protos/volumes/v1/volumes_grpc_pb.d.ts поставляемый Normal file
Просмотреть файл

@ -0,0 +1,77 @@
// package: com.docker.api.protos.volumes.v1
// file: volumes/v1/volumes.proto
/* tslint:disable */
/* eslint-disable */
import * as grpc from "@grpc/grpc-js";
import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call";
import * as volumes_v1_volumes_pb from "../../volumes/v1/volumes_pb";
import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb";
interface IVolumesService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
volumesCreate: IVolumesService_IVolumesCreate;
volumesList: IVolumesService_IVolumesList;
volumesDelete: IVolumesService_IVolumesDelete;
}
interface IVolumesService_IVolumesCreate extends grpc.MethodDefinition<volumes_v1_volumes_pb.VolumesCreateRequest, volumes_v1_volumes_pb.VolumesCreateResponse> {
path: string; // "/com.docker.api.protos.volumes.v1.Volumes/VolumesCreate"
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesCreateRequest>;
requestDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesCreateRequest>;
responseSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesCreateResponse>;
responseDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesCreateResponse>;
}
interface IVolumesService_IVolumesList extends grpc.MethodDefinition<volumes_v1_volumes_pb.VolumesListRequest, volumes_v1_volumes_pb.VolumesListResponse> {
path: string; // "/com.docker.api.protos.volumes.v1.Volumes/VolumesList"
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesListRequest>;
requestDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesListRequest>;
responseSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesListResponse>;
responseDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesListResponse>;
}
interface IVolumesService_IVolumesDelete extends grpc.MethodDefinition<volumes_v1_volumes_pb.VolumesDeleteRequest, volumes_v1_volumes_pb.VolumesDeleteResponse> {
path: string; // "/com.docker.api.protos.volumes.v1.Volumes/VolumesDelete"
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesDeleteRequest>;
requestDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesDeleteRequest>;
responseSerialize: grpc.serialize<volumes_v1_volumes_pb.VolumesDeleteResponse>;
responseDeserialize: grpc.deserialize<volumes_v1_volumes_pb.VolumesDeleteResponse>;
}
export const VolumesService: IVolumesService;
export interface IVolumesServer {
volumesCreate: grpc.handleUnaryCall<volumes_v1_volumes_pb.VolumesCreateRequest, volumes_v1_volumes_pb.VolumesCreateResponse>;
volumesList: grpc.handleUnaryCall<volumes_v1_volumes_pb.VolumesListRequest, volumes_v1_volumes_pb.VolumesListResponse>;
volumesDelete: grpc.handleUnaryCall<volumes_v1_volumes_pb.VolumesDeleteRequest, volumes_v1_volumes_pb.VolumesDeleteResponse>;
}
export interface IVolumesClient {
volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
}
export class VolumesClient extends grpc.Client implements IVolumesClient {
constructor(address: string, credentials: grpc.ChannelCredentials, options?: object);
public volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
public volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
public volumesCreate(request: volumes_v1_volumes_pb.VolumesCreateRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesCreateResponse) => void): grpc.ClientUnaryCall;
public volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
public volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
public volumesList(request: volumes_v1_volumes_pb.VolumesListRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesListResponse) => void): grpc.ClientUnaryCall;
public volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
public volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
public volumesDelete(request: volumes_v1_volumes_pb.VolumesDeleteRequest, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: volumes_v1_volumes_pb.VolumesDeleteResponse) => void): grpc.ClientUnaryCall;
}

Просмотреть файл

@ -0,0 +1,127 @@
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
//
// Copyright 2020 Docker Compose CLI authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
'use strict';
var grpc = require('@grpc/grpc-js');
var volumes_v1_volumes_pb = require('../../volumes/v1/volumes_pb.js');
var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
function serialize_com_docker_api_protos_volumes_v1_VolumesCreateRequest(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesCreateRequest)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesCreateRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesCreateRequest(buffer_arg) {
return volumes_v1_volumes_pb.VolumesCreateRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_com_docker_api_protos_volumes_v1_VolumesCreateResponse(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesCreateResponse)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesCreateResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesCreateResponse(buffer_arg) {
return volumes_v1_volumes_pb.VolumesCreateResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_com_docker_api_protos_volumes_v1_VolumesDeleteRequest(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesDeleteRequest)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesDeleteRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesDeleteRequest(buffer_arg) {
return volumes_v1_volumes_pb.VolumesDeleteRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_com_docker_api_protos_volumes_v1_VolumesDeleteResponse(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesDeleteResponse)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesDeleteResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesDeleteResponse(buffer_arg) {
return volumes_v1_volumes_pb.VolumesDeleteResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_com_docker_api_protos_volumes_v1_VolumesListRequest(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesListRequest)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesListRequest');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesListRequest(buffer_arg) {
return volumes_v1_volumes_pb.VolumesListRequest.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_com_docker_api_protos_volumes_v1_VolumesListResponse(arg) {
if (!(arg instanceof volumes_v1_volumes_pb.VolumesListResponse)) {
throw new Error('Expected argument of type com.docker.api.protos.volumes.v1.VolumesListResponse');
}
return Buffer.from(arg.serializeBinary());
}
function deserialize_com_docker_api_protos_volumes_v1_VolumesListResponse(buffer_arg) {
return volumes_v1_volumes_pb.VolumesListResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
var VolumesService = exports.VolumesService = {
volumesCreate: {
path: '/com.docker.api.protos.volumes.v1.Volumes/VolumesCreate',
requestStream: false,
responseStream: false,
requestType: volumes_v1_volumes_pb.VolumesCreateRequest,
responseType: volumes_v1_volumes_pb.VolumesCreateResponse,
requestSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesCreateRequest,
requestDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesCreateRequest,
responseSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesCreateResponse,
responseDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesCreateResponse,
},
volumesList: {
path: '/com.docker.api.protos.volumes.v1.Volumes/VolumesList',
requestStream: false,
responseStream: false,
requestType: volumes_v1_volumes_pb.VolumesListRequest,
responseType: volumes_v1_volumes_pb.VolumesListResponse,
requestSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesListRequest,
requestDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesListRequest,
responseSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesListResponse,
responseDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesListResponse,
},
volumesDelete: {
path: '/com.docker.api.protos.volumes.v1.Volumes/VolumesDelete',
requestStream: false,
responseStream: false,
requestType: volumes_v1_volumes_pb.VolumesDeleteRequest,
responseType: volumes_v1_volumes_pb.VolumesDeleteResponse,
requestSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesDeleteRequest,
requestDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesDeleteRequest,
responseSerialize: serialize_com_docker_api_protos_volumes_v1_VolumesDeleteResponse,
responseDeserialize: deserialize_com_docker_api_protos_volumes_v1_VolumesDeleteResponse,
},
};
exports.VolumesClient = grpc.makeGenericClientConstructor(VolumesService);

194
src/protos/volumes/v1/volumes_pb.d.ts поставляемый Normal file
Просмотреть файл

@ -0,0 +1,194 @@
// package: com.docker.api.protos.volumes.v1
// file: volumes/v1/volumes.proto
/* tslint:disable */
/* eslint-disable */
import * as jspb from "google-protobuf";
import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb";
export class Volume extends jspb.Message {
getId(): string;
setId(value: string): Volume;
getDescription(): string;
setDescription(value: string): Volume;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Volume.AsObject;
static toObject(includeInstance: boolean, msg: Volume): Volume.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: Volume, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Volume;
static deserializeBinaryFromReader(message: Volume, reader: jspb.BinaryReader): Volume;
}
export namespace Volume {
export type AsObject = {
id: string,
description: string,
}
}
export class AciVolumeCreateOptions extends jspb.Message {
getStorageAccount(): string;
setStorageAccount(value: string): AciVolumeCreateOptions;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AciVolumeCreateOptions.AsObject;
static toObject(includeInstance: boolean, msg: AciVolumeCreateOptions): AciVolumeCreateOptions.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: AciVolumeCreateOptions, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): AciVolumeCreateOptions;
static deserializeBinaryFromReader(message: AciVolumeCreateOptions, reader: jspb.BinaryReader): AciVolumeCreateOptions;
}
export namespace AciVolumeCreateOptions {
export type AsObject = {
storageAccount: string,
}
}
export class VolumesCreateRequest extends jspb.Message {
getName(): string;
setName(value: string): VolumesCreateRequest;
hasAciOption(): boolean;
clearAciOption(): void;
getAciOption(): AciVolumeCreateOptions | undefined;
setAciOption(value?: AciVolumeCreateOptions): VolumesCreateRequest;
getOptionsCase(): VolumesCreateRequest.OptionsCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesCreateRequest.AsObject;
static toObject(includeInstance: boolean, msg: VolumesCreateRequest): VolumesCreateRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesCreateRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesCreateRequest;
static deserializeBinaryFromReader(message: VolumesCreateRequest, reader: jspb.BinaryReader): VolumesCreateRequest;
}
export namespace VolumesCreateRequest {
export type AsObject = {
name: string,
aciOption?: AciVolumeCreateOptions.AsObject,
}
export enum OptionsCase {
OPTIONS_NOT_SET = 0,
ACI_OPTION = 2,
}
}
export class VolumesCreateResponse extends jspb.Message {
hasVolume(): boolean;
clearVolume(): void;
getVolume(): Volume | undefined;
setVolume(value?: Volume): VolumesCreateResponse;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesCreateResponse.AsObject;
static toObject(includeInstance: boolean, msg: VolumesCreateResponse): VolumesCreateResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesCreateResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesCreateResponse;
static deserializeBinaryFromReader(message: VolumesCreateResponse, reader: jspb.BinaryReader): VolumesCreateResponse;
}
export namespace VolumesCreateResponse {
export type AsObject = {
volume?: Volume.AsObject,
}
}
export class VolumesListRequest extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesListRequest.AsObject;
static toObject(includeInstance: boolean, msg: VolumesListRequest): VolumesListRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesListRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesListRequest;
static deserializeBinaryFromReader(message: VolumesListRequest, reader: jspb.BinaryReader): VolumesListRequest;
}
export namespace VolumesListRequest {
export type AsObject = {
}
}
export class VolumesListResponse extends jspb.Message {
clearVolumesList(): void;
getVolumesList(): Array<Volume>;
setVolumesList(value: Array<Volume>): VolumesListResponse;
addVolumes(value?: Volume, index?: number): Volume;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesListResponse.AsObject;
static toObject(includeInstance: boolean, msg: VolumesListResponse): VolumesListResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesListResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesListResponse;
static deserializeBinaryFromReader(message: VolumesListResponse, reader: jspb.BinaryReader): VolumesListResponse;
}
export namespace VolumesListResponse {
export type AsObject = {
volumesList: Array<Volume.AsObject>,
}
}
export class VolumesDeleteRequest extends jspb.Message {
getId(): string;
setId(value: string): VolumesDeleteRequest;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesDeleteRequest.AsObject;
static toObject(includeInstance: boolean, msg: VolumesDeleteRequest): VolumesDeleteRequest.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesDeleteRequest, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesDeleteRequest;
static deserializeBinaryFromReader(message: VolumesDeleteRequest, reader: jspb.BinaryReader): VolumesDeleteRequest;
}
export namespace VolumesDeleteRequest {
export type AsObject = {
id: string,
}
}
export class VolumesDeleteResponse extends jspb.Message {
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): VolumesDeleteResponse.AsObject;
static toObject(includeInstance: boolean, msg: VolumesDeleteResponse): VolumesDeleteResponse.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: VolumesDeleteResponse, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): VolumesDeleteResponse;
static deserializeBinaryFromReader(message: VolumesDeleteResponse, reader: jspb.BinaryReader): VolumesDeleteResponse;
}
export namespace VolumesDeleteResponse {
export type AsObject = {
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

17
src/volumes.ts Normal file
Просмотреть файл

@ -0,0 +1,17 @@
/*
Copyright 2020 The Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
export * from './protos/volumes/v1/volumes_pb';