diff --git a/examples/python/ip-list.py b/examples/python/ip-list.py index 0e312f6c..67ac0984 100755 --- a/examples/python/ip-list.py +++ b/examples/python/ip-list.py @@ -6,8 +6,8 @@ from connectrpc.errors import ConnectError from metalstack.client import client as apiclient -from metalstack.api.v2 import ip_pb2 -from metalstack.admin.v2 import network_pb2 +from metalstack.api.v2 import ip_pb +from metalstack.admin.v2 import network_pb timeout_s = 5 baseurl = os.environ['METAL_APISERVER_URL'] @@ -20,7 +20,7 @@ try: resp = client.apiv2().ip().list( headers=headers, - request=ip_pb2.IPServiceListRequest( + request=ip_pb.IPServiceListRequest( project=project), ) except ConnectError as e: @@ -33,7 +33,7 @@ resp = client.adminv2().network().list( headers=headers, - request=network_pb2.NetworkServiceListRequest(), + request=network_pb.NetworkServiceListRequest(), ) for nw in resp.networks: diff --git a/go.mod b/go.mod index b81521f6..a0788595 100644 --- a/go.mod +++ b/go.mod @@ -24,14 +24,10 @@ require ( github.com/google/cel-go v0.29.2 // indirect github.com/klauspost/compress v1.19.0 // indirect github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect github.com/minio/minlz v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/sync v0.22.0 // indirect golang.org/x/sys v0.47.0 // indirect golang.org/x/text v0.40.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260715232425-e75dac1f907d // indirect diff --git a/go.sum b/go.sum index 81778360..4e194f3f 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/minio/minlz v1.1.1 h1:OGmft1V6AnI/Wme332U6bhG54nxEan+VFgkD7lat4KM= -github.com/minio/minlz v1.1.1/go.mod h1:qT0aEB35q79LLornSzeDH75LBf3aH1MV+jB5w9Wasec= github.com/minio/minlz v1.2.0 h1:6IOBuiHg04QxvbFfgFLT/9sMaO/UhL7S+ApW1mK8q5A= github.com/minio/minlz v1.2.0/go.mod h1:Ls9H7nlkASeCcdl5thjVD5Eraj6z+zGa7xtq57jIKD4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -57,22 +55,14 @@ golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597 h1:qLvzZeaANDgyVOA8pyHCOStGl golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597/go.mod h1:EdfpwwqSu+0Li0mzskwHU6FWDV3t9Q+RZDo3QMUtL3Q= golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= -google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800 h1:admdQBe8jR3VWhBsUrAOaF2Qw6K/+p5pSm1GN8+6Fw4= -google.golang.org/genproto/googleapis/api v0.0.0-20260706201446-f0a921348800/go.mod h1:FPk7EXUKMtImne7AmknoYjT4QXqKIzzRbeQIXzLk6fQ= google.golang.org/genproto/googleapis/api v0.0.0-20260715232425-e75dac1f907d h1:QwnJwPte4XXAkhPu26LTDIahnsMSUV0kK8HkxbC+Pc4= google.golang.org/genproto/googleapis/api v0.0.0-20260715232425-e75dac1f907d/go.mod h1:WRrQ7/7N19PypuT0fxLOL5Lq0waoiRri4FbtHDEKrGE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800 h1:qEHAMpSaUhtD0p3NbEEI83HwNGFxEwaSJ1G9PLnCBZE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260706201446-f0a921348800/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d h1:Jkpk39hlTZOIp3RbfvNX9R8Hv+Sw0X89nlU/xFOErsc= google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.82.0 h1:vguDnZUPjE26w09A63VoxZPnvPjB5Riyc0mkXPFmAIU= -google.golang.org/grpc v1.82.0/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= diff --git a/go/metalstack/admin/v2/project.pb.go b/go/metalstack/admin/v2/project.pb.go index 03e3d242..1be7d8cd 100644 --- a/go/metalstack/admin/v2/project.pb.go +++ b/go/metalstack/admin/v2/project.pb.go @@ -7,7 +7,6 @@ package adminv2 import ( - _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" v2 "github.com/metal-stack/api/go/metalstack/api/v2" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -119,7 +118,7 @@ var File_metalstack_admin_v2_project_proto protoreflect.FileDescriptor const file_metalstack_admin_v2_project_proto_rawDesc = "" + "\n" + - "!metalstack/admin/v2/project.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/project.proto\"a\n" + + "!metalstack/admin/v2/project.proto\x12\x13metalstack.admin.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/project.proto\"a\n" + "\x19ProjectServiceListRequest\x12:\n" + "\x05query\x18\x01 \x01(\v2\x1f.metalstack.api.v2.ProjectQueryH\x00R\x05query\x88\x01\x01B\b\n" + "\x06_query\"T\n" + diff --git a/go/metalstack/infra/v2/event.pb.go b/go/metalstack/infra/v2/event.pb.go index 7d68bb15..1cc203f1 100644 --- a/go/metalstack/infra/v2/event.pb.go +++ b/go/metalstack/infra/v2/event.pb.go @@ -7,11 +7,9 @@ package infrav2 import ( - _ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate" v2 "github.com/metal-stack/api/go/metalstack/api/v2" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -129,7 +127,7 @@ var File_metalstack_infra_v2_event_proto protoreflect.FileDescriptor const file_metalstack_infra_v2_event_proto_rawDesc = "" + "\n" + - "\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"\xd3\x01\n" + + "\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"\xd3\x01\n" + "\x17EventServiceSendRequest\x12P\n" + "\x06events\x18\x01 \x03(\v28.metalstack.infra.v2.EventServiceSendRequest.EventsEntryR\x06events\x1af\n" + "\vEventsEntry\x12\x10\n" + diff --git a/js/metalstack/admin/v2/project_pb.js b/js/metalstack/admin/v2/project_pb.js index f3178cb1..015ff522 100644 --- a/js/metalstack/admin/v2/project_pb.js +++ b/js/metalstack/admin/v2/project_pb.js @@ -2,14 +2,12 @@ // @generated from file metalstack/admin/v2/project.proto (package metalstack.admin.v2, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_buf_validate_validate } from "../../../buf/validate/validate_pb"; import { file_metalstack_api_v2_common } from "../../api/v2/common_pb"; -import { file_metalstack_api_v2_predefined_rules } from "../../api/v2/predefined_rules_pb"; import { file_metalstack_api_v2_project } from "../../api/v2/project_pb"; /** * Describes the file metalstack/admin/v2/project.proto. */ -export const file_metalstack_admin_v2_project = /*@__PURE__*/ fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL3Byb2plY3QucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiWgoZUHJvamVjdFNlcnZpY2VMaXN0UmVxdWVzdBIzCgVxdWVyeRgBIAEoCzIfLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3RRdWVyeUgAiAEBQggKBl9xdWVyeSJKChpQcm9qZWN0U2VydmljZUxpc3RSZXNwb25zZRIsCghwcm9qZWN0cxgBIAMoCzIaLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3QyhQEKDlByb2plY3RTZXJ2aWNlEnMKBExpc3QSLi5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlcXVlc3QaLy5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlc3BvbnNlIgrS8xgCAQLg8xgCQtABChdjb20ubWV0YWxzdGFjay5hZG1pbi52MkIMUHJvamVjdFByb3RvUAFaOWdpdGh1Yi5jb20vbWV0YWwtc3RhY2svYXBpL2dvL21ldGFsc3RhY2svYWRtaW4vdjI7YWRtaW52MqICA01BWKoCE01ldGFsc3RhY2suQWRtaW4uVjLKAhNNZXRhbHN0YWNrXEFkbWluXFYy4gIfTWV0YWxzdGFja1xBZG1pblxWMlxHUEJNZXRhZGF0YeoCFU1ldGFsc3RhY2s6OkFkbWluOjpWMmIGcHJvdG8z", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_predefined_rules, file_metalstack_api_v2_project]); +export const file_metalstack_admin_v2_project = /*@__PURE__*/ fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL3Byb2plY3QucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiWgoZUHJvamVjdFNlcnZpY2VMaXN0UmVxdWVzdBIzCgVxdWVyeRgBIAEoCzIfLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3RRdWVyeUgAiAEBQggKBl9xdWVyeSJKChpQcm9qZWN0U2VydmljZUxpc3RSZXNwb25zZRIsCghwcm9qZWN0cxgBIAMoCzIaLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3QyhQEKDlByb2plY3RTZXJ2aWNlEnMKBExpc3QSLi5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlcXVlc3QaLy5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlc3BvbnNlIgrS8xgCAQLg8xgCQtABChdjb20ubWV0YWxzdGFjay5hZG1pbi52MkIMUHJvamVjdFByb3RvUAFaOWdpdGh1Yi5jb20vbWV0YWwtc3RhY2svYXBpL2dvL21ldGFsc3RhY2svYWRtaW4vdjI7YWRtaW52MqICA01BWKoCE01ldGFsc3RhY2suQWRtaW4uVjLKAhNNZXRhbHN0YWNrXEFkbWluXFYy4gIfTWV0YWxzdGFja1xBZG1pblxWMlxHUEJNZXRhZGF0YeoCFU1ldGFsc3RhY2s6OkFkbWluOjpWMmIGcHJvdG8z", [file_metalstack_api_v2_common, file_metalstack_api_v2_project]); /** * Describes the message metalstack.admin.v2.ProjectServiceListRequest. * Use `create(ProjectServiceListRequestSchema)` to create a new message. diff --git a/js/metalstack/admin/v2/project_pb.ts b/js/metalstack/admin/v2/project_pb.ts index f4d2d738..fb1a5b47 100644 --- a/js/metalstack/admin/v2/project_pb.ts +++ b/js/metalstack/admin/v2/project_pb.ts @@ -4,9 +4,7 @@ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_buf_validate_validate } from "../../../buf/validate/validate_pb"; import { file_metalstack_api_v2_common } from "../../api/v2/common_pb"; -import { file_metalstack_api_v2_predefined_rules } from "../../api/v2/predefined_rules_pb"; import type { Project, ProjectQuery } from "../../api/v2/project_pb"; import { file_metalstack_api_v2_project } from "../../api/v2/project_pb"; import type { Message } from "@bufbuild/protobuf"; @@ -15,7 +13,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file metalstack/admin/v2/project.proto. */ export const file_metalstack_admin_v2_project: GenFile = /*@__PURE__*/ - fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL3Byb2plY3QucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiWgoZUHJvamVjdFNlcnZpY2VMaXN0UmVxdWVzdBIzCgVxdWVyeRgBIAEoCzIfLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3RRdWVyeUgAiAEBQggKBl9xdWVyeSJKChpQcm9qZWN0U2VydmljZUxpc3RSZXNwb25zZRIsCghwcm9qZWN0cxgBIAMoCzIaLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3QyhQEKDlByb2plY3RTZXJ2aWNlEnMKBExpc3QSLi5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlcXVlc3QaLy5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlc3BvbnNlIgrS8xgCAQLg8xgCQtABChdjb20ubWV0YWxzdGFjay5hZG1pbi52MkIMUHJvamVjdFByb3RvUAFaOWdpdGh1Yi5jb20vbWV0YWwtc3RhY2svYXBpL2dvL21ldGFsc3RhY2svYWRtaW4vdjI7YWRtaW52MqICA01BWKoCE01ldGFsc3RhY2suQWRtaW4uVjLKAhNNZXRhbHN0YWNrXEFkbWluXFYy4gIfTWV0YWxzdGFja1xBZG1pblxWMlxHUEJNZXRhZGF0YeoCFU1ldGFsc3RhY2s6OkFkbWluOjpWMmIGcHJvdG8z", [file_buf_validate_validate, file_metalstack_api_v2_common, file_metalstack_api_v2_predefined_rules, file_metalstack_api_v2_project]); + fileDesc("CiFtZXRhbHN0YWNrL2FkbWluL3YyL3Byb2plY3QucHJvdG8SE21ldGFsc3RhY2suYWRtaW4udjIiWgoZUHJvamVjdFNlcnZpY2VMaXN0UmVxdWVzdBIzCgVxdWVyeRgBIAEoCzIfLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3RRdWVyeUgAiAEBQggKBl9xdWVyeSJKChpQcm9qZWN0U2VydmljZUxpc3RSZXNwb25zZRIsCghwcm9qZWN0cxgBIAMoCzIaLm1ldGFsc3RhY2suYXBpLnYyLlByb2plY3QyhQEKDlByb2plY3RTZXJ2aWNlEnMKBExpc3QSLi5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlcXVlc3QaLy5tZXRhbHN0YWNrLmFkbWluLnYyLlByb2plY3RTZXJ2aWNlTGlzdFJlc3BvbnNlIgrS8xgCAQLg8xgCQtABChdjb20ubWV0YWxzdGFjay5hZG1pbi52MkIMUHJvamVjdFByb3RvUAFaOWdpdGh1Yi5jb20vbWV0YWwtc3RhY2svYXBpL2dvL21ldGFsc3RhY2svYWRtaW4vdjI7YWRtaW52MqICA01BWKoCE01ldGFsc3RhY2suQWRtaW4uVjLKAhNNZXRhbHN0YWNrXEFkbWluXFYy4gIfTWV0YWxzdGFja1xBZG1pblxWMlxHUEJNZXRhZGF0YeoCFU1ldGFsc3RhY2s6OkFkbWluOjpWMmIGcHJvdG8z", [file_metalstack_api_v2_common, file_metalstack_api_v2_project]); /** * ProjectServiceListRequest is the request payload for listing projects. diff --git a/js/metalstack/infra/v2/event_pb.js b/js/metalstack/infra/v2/event_pb.js index 121891d6..fc3240b0 100644 --- a/js/metalstack/infra/v2/event_pb.js +++ b/js/metalstack/infra/v2/event_pb.js @@ -2,14 +2,12 @@ // @generated from file metalstack/infra/v2/event.proto (package metalstack.infra.v2, syntax proto3) /* eslint-disable */ import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_buf_validate_validate } from "../../../buf/validate/validate_pb"; -import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import { file_metalstack_api_v2_common } from "../../api/v2/common_pb"; import { file_metalstack_api_v2_machine } from "../../api/v2/machine_pb"; /** * Describes the file metalstack/infra/v2/event.proto. */ -export const file_metalstack_infra_v2_event = /*@__PURE__*/ fileDesc("Ch9tZXRhbHN0YWNrL2luZnJhL3YyL2V2ZW50LnByb3RvEhNtZXRhbHN0YWNrLmluZnJhLnYyIr8BChdFdmVudFNlcnZpY2VTZW5kUmVxdWVzdBJICgZldmVudHMYASADKAsyOC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0LkV2ZW50c0VudHJ5GloKC0V2ZW50c0VudHJ5EgsKA2tleRgBIAEoCRI6CgV2YWx1ZRgCIAEoCzIrLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVQcm92aXNpb25pbmdFdmVudDoCOAEiOgoYRXZlbnRTZXJ2aWNlU2VuZFJlc3BvbnNlEg4KBmV2ZW50cxgBIAEoBBIOCgZmYWlsZWQYAiADKAkyfgoMRXZlbnRTZXJ2aWNlEm4KBFNlbmQSLC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0Gi0ubWV0YWxzdGFjay5pbmZyYS52Mi5FdmVudFNlcnZpY2VTZW5kUmVzcG9uc2UiCeDzGALq8xgBAULOAQoXY29tLm1ldGFsc3RhY2suaW5mcmEudjJCCkV2ZW50UHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9pbmZyYS92MjtpbmZyYXYyogIDTUlYqgITTWV0YWxzdGFjay5JbmZyYS5WMsoCE01ldGFsc3RhY2tcSW5mcmFcVjLiAh9NZXRhbHN0YWNrXEluZnJhXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6SW5mcmE6OlYyYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_timestamp, file_metalstack_api_v2_common, file_metalstack_api_v2_machine]); +export const file_metalstack_infra_v2_event = /*@__PURE__*/ fileDesc("Ch9tZXRhbHN0YWNrL2luZnJhL3YyL2V2ZW50LnByb3RvEhNtZXRhbHN0YWNrLmluZnJhLnYyIr8BChdFdmVudFNlcnZpY2VTZW5kUmVxdWVzdBJICgZldmVudHMYASADKAsyOC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0LkV2ZW50c0VudHJ5GloKC0V2ZW50c0VudHJ5EgsKA2tleRgBIAEoCRI6CgV2YWx1ZRgCIAEoCzIrLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVQcm92aXNpb25pbmdFdmVudDoCOAEiOgoYRXZlbnRTZXJ2aWNlU2VuZFJlc3BvbnNlEg4KBmV2ZW50cxgBIAEoBBIOCgZmYWlsZWQYAiADKAkyfgoMRXZlbnRTZXJ2aWNlEm4KBFNlbmQSLC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0Gi0ubWV0YWxzdGFjay5pbmZyYS52Mi5FdmVudFNlcnZpY2VTZW5kUmVzcG9uc2UiCeDzGALq8xgBAULOAQoXY29tLm1ldGFsc3RhY2suaW5mcmEudjJCCkV2ZW50UHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9pbmZyYS92MjtpbmZyYXYyogIDTUlYqgITTWV0YWxzdGFjay5JbmZyYS5WMsoCE01ldGFsc3RhY2tcSW5mcmFcVjLiAh9NZXRhbHN0YWNrXEluZnJhXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6SW5mcmE6OlYyYgZwcm90bzM", [file_metalstack_api_v2_common, file_metalstack_api_v2_machine]); /** * Describes the message metalstack.infra.v2.EventServiceSendRequest. * Use `create(EventServiceSendRequestSchema)` to create a new message. diff --git a/js/metalstack/infra/v2/event_pb.ts b/js/metalstack/infra/v2/event_pb.ts index 6685c224..84354bfd 100644 --- a/js/metalstack/infra/v2/event_pb.ts +++ b/js/metalstack/infra/v2/event_pb.ts @@ -4,8 +4,6 @@ import type { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2"; import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2"; -import { file_buf_validate_validate } from "../../../buf/validate/validate_pb"; -import { file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import { file_metalstack_api_v2_common } from "../../api/v2/common_pb"; import type { MachineProvisioningEvent } from "../../api/v2/machine_pb"; import { file_metalstack_api_v2_machine } from "../../api/v2/machine_pb"; @@ -15,7 +13,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file metalstack/infra/v2/event.proto. */ export const file_metalstack_infra_v2_event: GenFile = /*@__PURE__*/ - fileDesc("Ch9tZXRhbHN0YWNrL2luZnJhL3YyL2V2ZW50LnByb3RvEhNtZXRhbHN0YWNrLmluZnJhLnYyIr8BChdFdmVudFNlcnZpY2VTZW5kUmVxdWVzdBJICgZldmVudHMYASADKAsyOC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0LkV2ZW50c0VudHJ5GloKC0V2ZW50c0VudHJ5EgsKA2tleRgBIAEoCRI6CgV2YWx1ZRgCIAEoCzIrLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVQcm92aXNpb25pbmdFdmVudDoCOAEiOgoYRXZlbnRTZXJ2aWNlU2VuZFJlc3BvbnNlEg4KBmV2ZW50cxgBIAEoBBIOCgZmYWlsZWQYAiADKAkyfgoMRXZlbnRTZXJ2aWNlEm4KBFNlbmQSLC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0Gi0ubWV0YWxzdGFjay5pbmZyYS52Mi5FdmVudFNlcnZpY2VTZW5kUmVzcG9uc2UiCeDzGALq8xgBAULOAQoXY29tLm1ldGFsc3RhY2suaW5mcmEudjJCCkV2ZW50UHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9pbmZyYS92MjtpbmZyYXYyogIDTUlYqgITTWV0YWxzdGFjay5JbmZyYS5WMsoCE01ldGFsc3RhY2tcSW5mcmFcVjLiAh9NZXRhbHN0YWNrXEluZnJhXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6SW5mcmE6OlYyYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_timestamp, file_metalstack_api_v2_common, file_metalstack_api_v2_machine]); + fileDesc("Ch9tZXRhbHN0YWNrL2luZnJhL3YyL2V2ZW50LnByb3RvEhNtZXRhbHN0YWNrLmluZnJhLnYyIr8BChdFdmVudFNlcnZpY2VTZW5kUmVxdWVzdBJICgZldmVudHMYASADKAsyOC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0LkV2ZW50c0VudHJ5GloKC0V2ZW50c0VudHJ5EgsKA2tleRgBIAEoCRI6CgV2YWx1ZRgCIAEoCzIrLm1ldGFsc3RhY2suYXBpLnYyLk1hY2hpbmVQcm92aXNpb25pbmdFdmVudDoCOAEiOgoYRXZlbnRTZXJ2aWNlU2VuZFJlc3BvbnNlEg4KBmV2ZW50cxgBIAEoBBIOCgZmYWlsZWQYAiADKAkyfgoMRXZlbnRTZXJ2aWNlEm4KBFNlbmQSLC5tZXRhbHN0YWNrLmluZnJhLnYyLkV2ZW50U2VydmljZVNlbmRSZXF1ZXN0Gi0ubWV0YWxzdGFjay5pbmZyYS52Mi5FdmVudFNlcnZpY2VTZW5kUmVzcG9uc2UiCeDzGALq8xgBAULOAQoXY29tLm1ldGFsc3RhY2suaW5mcmEudjJCCkV2ZW50UHJvdG9QAVo5Z2l0aHViLmNvbS9tZXRhbC1zdGFjay9hcGkvZ28vbWV0YWxzdGFjay9pbmZyYS92MjtpbmZyYXYyogIDTUlYqgITTWV0YWxzdGFjay5JbmZyYS5WMsoCE01ldGFsc3RhY2tcSW5mcmFcVjLiAh9NZXRhbHN0YWNrXEluZnJhXFYyXEdQQk1ldGFkYXRh6gIVTWV0YWxzdGFjazo6SW5mcmE6OlYyYgZwcm90bzM", [file_metalstack_api_v2_common, file_metalstack_api_v2_machine]); /** * EventServiceSendRequest is the request payload for sending provisioning events. diff --git a/proto/Makefile b/proto/Makefile index 69bc2c5b..ef600128 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.71.0 +BUF_VERSION := 1.72.0 _buf: docker run --rm \ diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 16d17d24..c1548af0 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -20,12 +20,10 @@ plugins: out: ../go opt: paths=source_relative,simple # python - - remote: buf.build/protocolbuffers/python:v35.1 + - remote: buf.build/bufbuild/py:v0.2.0 out: ../python include_imports: True - - remote: buf.build/protocolbuffers/pyi:v35.1 - out: ../python - - remote: buf.build/connectrpc/python:v0.10.1 + - remote: buf.build/connectrpc/py:v0.11.1 out: ../python # js - remote: buf.build/bufbuild/es:v2.12.1 diff --git a/proto/metalstack/admin/v2/image.proto b/proto/metalstack/admin/v2/image.proto index b2f2652e..06fa8419 100644 --- a/proto/metalstack/admin/v2/image.proto +++ b/proto/metalstack/admin/v2/image.proto @@ -60,7 +60,9 @@ message ImageServiceUpdateRequest { // Features of this image repeated metalstack.api.v2.ImageFeature features = 6 [(buf.validate.field).repeated = { unique: true - items: {enum: {defined_only: true}} + items: { + enum: {defined_only: true} + } }]; // Classification of this image metalstack.api.v2.ImageClassification classification = 7 [(buf.validate.field).enum.defined_only = true]; diff --git a/proto/metalstack/admin/v2/machine.proto b/proto/metalstack/admin/v2/machine.proto index dc1e5e83..a027d4cb 100644 --- a/proto/metalstack/admin/v2/machine.proto +++ b/proto/metalstack/admin/v2/machine.proto @@ -137,7 +137,11 @@ message MachineServiceListBMCRequest { // MachineServiceListBMCResponse is the response payload for a machine listbmc request message MachineServiceListBMCResponse { // BMCReports maps the bmc report per machine uuid - map bmc_reports = 1 [(buf.validate.field).map = {keys: {string: {uuid: true}}}]; + map bmc_reports = 1 [(buf.validate.field).map = { + keys: { + string: {uuid: true} + } + }]; } // MachineServiceConsolePasswordRequest is the request payload for getting the console password. diff --git a/proto/metalstack/admin/v2/project.proto b/proto/metalstack/admin/v2/project.proto index d68364a5..e0b2292c 100644 --- a/proto/metalstack/admin/v2/project.proto +++ b/proto/metalstack/admin/v2/project.proto @@ -2,9 +2,7 @@ syntax = "proto3"; package metalstack.admin.v2; -import "buf/validate/validate.proto"; import "metalstack/api/v2/common.proto"; -import "metalstack/api/v2/predefined_rules.proto"; import "metalstack/api/v2/project.proto"; // ProjectService provides project management operations. diff --git a/proto/metalstack/api/v2/common.proto b/proto/metalstack/api/v2/common.proto index b448be33..ecf9c11d 100644 --- a/proto/metalstack/api/v2/common.proto +++ b/proto/metalstack/api/v2/common.proto @@ -179,7 +179,9 @@ message LabelsPatch { // Remove labels by key repeated string remove = 2 [(buf.validate.field).repeated = { unique: true - items: {string: {[metalstack.api.v2.trimmed]: true}} + items: { + string: {[metalstack.api.v2.trimmed]: true} + } }]; } diff --git a/proto/metalstack/api/v2/filesystem.proto b/proto/metalstack/api/v2/filesystem.proto index f10b7f10..6a7c637a 100644 --- a/proto/metalstack/api/v2/filesystem.proto +++ b/proto/metalstack/api/v2/filesystem.proto @@ -108,13 +108,17 @@ message Filesystem { repeated string mount_options = 7 [(buf.validate.field).repeated = { unique: true max_items: 32 - items: {string: {[metalstack.api.v2.is_option]: true}} + items: { + string: {[metalstack.api.v2.is_option]: true} + } }]; // CreateOptions the options to use to create (mkfs) this filesystem repeated string create_options = 8 [(buf.validate.field).repeated = { unique: true max_items: 32 - items: {string: {[metalstack.api.v2.is_option]: true}} + items: { + string: {[metalstack.api.v2.is_option]: true} + } }]; } @@ -140,7 +144,9 @@ message Raid { repeated string devices = 2 [ (buf.validate.field).repeated = { max_items: 128 - items: {string: {[metalstack.api.v2.is_name]: true}} + items: { + string: {[metalstack.api.v2.is_name]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; @@ -153,7 +159,9 @@ message Raid { repeated string create_options = 4 [(buf.validate.field).repeated = { unique: true max_items: 32 - items: {string: {[metalstack.api.v2.is_option]: true}} + items: { + string: {[metalstack.api.v2.is_option]: true} + } }]; // Spares number of spares for the raid array int32 spares = 5; @@ -185,7 +193,9 @@ message VolumeGroup { repeated string devices = 2 [ (buf.validate.field).repeated = { max_items: 128 - items: {string: {[metalstack.api.v2.is_name]: true}} + items: { + string: {[metalstack.api.v2.is_name]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; @@ -193,7 +203,9 @@ message VolumeGroup { repeated string tags = 3 [ (buf.validate.field).repeated = { max_items: 128 - items: {string: {[metalstack.api.v2.is_name]: true}} + items: { + string: {[metalstack.api.v2.is_name]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; diff --git a/proto/metalstack/api/v2/image.proto b/proto/metalstack/api/v2/image.proto index e92ecf37..dfed9d51 100644 --- a/proto/metalstack/api/v2/image.proto +++ b/proto/metalstack/api/v2/image.proto @@ -80,7 +80,9 @@ message Image { // Features of this image repeated ImageFeature features = 6 [(buf.validate.field).repeated = { unique: true - items: {enum: {defined_only: true}} + items: { + enum: {defined_only: true} + } }]; // Classification of this image ImageClassification classification = 7 [(buf.validate.field).enum.defined_only = true]; diff --git a/proto/metalstack/api/v2/machine.proto b/proto/metalstack/api/v2/machine.proto index 2a354f71..dff40722 100644 --- a/proto/metalstack/api/v2/machine.proto +++ b/proto/metalstack/api/v2/machine.proto @@ -114,7 +114,9 @@ message MachineServiceCreateRequest { // A lower bound can be set similarly with `min_items`. max_items: 50 // `items` validate each value in this `repeated` field. - items: {string: {[metalstack.api.v2.is_key]: true}} + items: { + string: {[metalstack.api.v2.is_key]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; @@ -172,7 +174,9 @@ message MachineServiceUpdateRequest { // A lower bound can be set similarly with `min_items`. max_items: 50 // `items` validate each value in this `repeated` field. - items: {string: {[metalstack.api.v2.is_key]: true}} + items: { + string: {[metalstack.api.v2.is_key]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; @@ -319,7 +323,9 @@ message MachineAllocation { // A lower bound can be set similarly with `min_items`. max_items: 50 // `items` validate each value in this `repeated` field. - items: {string: {[metalstack.api.v2.is_key]: true}} + items: { + string: {[metalstack.api.v2.is_key]: true} + } }, (buf.validate.field).repeated.(metalstack.api.v2.all_trimmed) = true ]; @@ -364,7 +370,11 @@ message FirewallEgressRule { // Protocol the protocol for the rule, defaults to tcp IPProtocol protocol = 1 [(buf.validate.field).enum.defined_only = true]; // Ports the ports affected by this rule - repeated uint32 ports = 2 [(buf.validate.field).repeated = {items: {uint32: {lte: 65532}}}]; + repeated uint32 ports = 2 [(buf.validate.field).repeated = { + items: { + uint32: {lte: 65532} + } + }]; // To the destination cidrs affected by this rule repeated string to = 3 [(buf.validate.field).repeated.(metalstack.api.v2.prefixes) = true]; // Comment for this rule @@ -382,7 +392,11 @@ message FirewallIngressRule { // Protocol the protocol for the rule, defaults to tcp IPProtocol protocol = 1 [(buf.validate.field).enum.defined_only = true]; // Ports the ports affected by this rule - repeated uint32 ports = 2 [(buf.validate.field).repeated = {items: {uint32: {lte: 65532}}}]; + repeated uint32 ports = 2 [(buf.validate.field).repeated = { + items: { + uint32: {lte: 65532} + } + }]; // To the destination cidrs affected by this rule repeated string to = 3 [(buf.validate.field).repeated.(metalstack.api.v2.prefixes) = true]; // From the source cidrs affected by this rule @@ -815,25 +829,33 @@ message MachineNicQuery { repeated string macs = 1 [(buf.validate.field).repeated = { max_items: 100 unique: true - items: {string: {[metalstack.api.v2.macaddress]: true}} + items: { + string: {[metalstack.api.v2.macaddress]: true} + } }]; // Names this machine nic has repeated string names = 2 [(buf.validate.field).repeated = { max_items: 100 unique: true - items: {string: {max_len: 128}} + items: { + string: {max_len: 128} + } }]; // NeighborMacs this machine nic has repeated string neighbor_macs = 3 [(buf.validate.field).repeated = { max_items: 100 unique: true - items: {string: {[metalstack.api.v2.macaddress]: true}} + items: { + string: {[metalstack.api.v2.macaddress]: true} + } }]; // NeighborNames this machine nic has repeated string neighbor_names = 4 [(buf.validate.field).repeated = { max_items: 100 unique: true - items: {string: {max_len: 128}} + items: { + string: {max_len: 128} + } }]; } @@ -842,7 +864,9 @@ message MachineDiskQuery { // Names of disks in this machine repeated string names = 1 [(buf.validate.field).repeated = { max_items: 100 - items: {string: {max_len: 128}} + items: { + string: {max_len: 128} + } }]; // Sizes of disks in this machine repeated uint64 sizes = 2 [(buf.validate.field).repeated = {max_items: 100}]; @@ -895,9 +919,17 @@ message MachineIssuesQuery { // MachineQuery to select specific machines metalstack.api.v2.MachineQuery machine_query = 1; // Only includes the specified machine issue types - repeated MachineIssueType only = 2 [(buf.validate.field).repeated = {items: {enum: {defined_only: true}}}]; + repeated MachineIssueType only = 2 [(buf.validate.field).repeated = { + items: { + enum: {defined_only: true} + } + }]; // Omits the specified machine issues - repeated MachineIssueType omit = 3 [(buf.validate.field).repeated = {items: {enum: {defined_only: true}}}]; + repeated MachineIssueType omit = 3 [(buf.validate.field).repeated = { + items: { + enum: {defined_only: true} + } + }]; // Severity filters issue for given severity optional MachineIssueSeverity severity = 4 [(buf.validate.field).enum.defined_only = true]; // LastErrorThreshold defines the last error threshold diff --git a/proto/metalstack/api/v2/token.proto b/proto/metalstack/api/v2/token.proto index 0f061dd8..b7e09a09 100644 --- a/proto/metalstack/api/v2/token.proto +++ b/proto/metalstack/api/v2/token.proto @@ -76,13 +76,17 @@ message Token { // ProjectRoles associates a project id with the corresponding role of the token owner map project_roles = 9 [ (buf.validate.field).map.(metalstack.api.v2.project_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // TenantRoles associates a tenant id with the corresponding role of the token owner map tenant_roles = 10 [ (buf.validate.field).map.(metalstack.api.v2.tenant_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // AdminRole defines the admin role of the token owner @@ -93,7 +97,9 @@ message Token { // TODO: decide if we need this map from machine.uuid->role, we could instead use the subject in the token instead map machine_roles = 13 [ (buf.validate.field).map.(metalstack.api.v2.machine_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; } @@ -123,13 +129,17 @@ message TokenServiceCreateRequest { // ProjectRoles associates a project id with the corresponding role of the token owner map project_roles = 4 [ (buf.validate.field).map.(metalstack.api.v2.project_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // TenantRoles associates a tenant id with the corresponding role of the token owner map tenant_roles = 5 [ (buf.validate.field).map.(metalstack.api.v2.tenant_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // AdminRole defines the admin role of the token owner @@ -139,7 +149,9 @@ message TokenServiceCreateRequest { // MachineRoles associates a machine uuid with the corresponding role of the token owner map machine_roles = 8 [ (buf.validate.field).map.(metalstack.api.v2.machine_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // Labels on this token @@ -202,13 +214,17 @@ message TokenServiceUpdateRequest { // ProjectRoles associates a project id with the corresponding role of the token owner map project_roles = 5 [ (buf.validate.field).map.(metalstack.api.v2.project_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // TenantRoles associates a tenant id with the corresponding role of the token owner map tenant_roles = 6 [ (buf.validate.field).map.(metalstack.api.v2.tenant_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // AdminRole defines the admin role of the token owner @@ -218,7 +234,9 @@ message TokenServiceUpdateRequest { // MachineRoles associates a machine uuid with the corresponding role of the token owner map machine_roles = 9 [ (buf.validate.field).map.(metalstack.api.v2.machine_roles_keys_valid) = true, - (buf.validate.field).map.values = {enum: {defined_only: true}}, + (buf.validate.field).map.values = { + enum: {defined_only: true} + }, (buf.validate.field).map.(metalstack.api.v2.keys_trimmed) = true ]; // Labels on this token diff --git a/proto/metalstack/infra/v2/bmc.proto b/proto/metalstack/infra/v2/bmc.proto index 23061e19..41491259 100644 --- a/proto/metalstack/infra/v2/bmc.proto +++ b/proto/metalstack/infra/v2/bmc.proto @@ -31,7 +31,11 @@ message UpdateBMCInfoRequest { // Partition is the partition ID where metal-bmc wants to receive events string partition = 1 [(buf.validate.field).string.(metalstack.api.v2.is_partition) = true]; // BmcReports maps the BMC report per machine UUID - map bmc_reports = 2 [(buf.validate.field).map = {keys: {string: {uuid: true}}}]; + map bmc_reports = 2 [(buf.validate.field).map = { + keys: { + string: {uuid: true} + } + }]; } // UpdateBMCInfoResponse is the response payload for updating BMC information. diff --git a/proto/metalstack/infra/v2/event.proto b/proto/metalstack/infra/v2/event.proto index 65f17a7d..48fcd30b 100644 --- a/proto/metalstack/infra/v2/event.proto +++ b/proto/metalstack/infra/v2/event.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package metalstack.infra.v2; -import "buf/validate/validate.proto"; -import "google/protobuf/timestamp.proto"; import "metalstack/api/v2/common.proto"; import "metalstack/api/v2/machine.proto"; diff --git a/python/__init__.py b/python/__init__.py new file mode 100644 index 00000000..9d48db4f --- /dev/null +++ b/python/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/buf/__init__.py b/python/buf/__init__.py index e69de29b..9d48db4f 100644 --- a/python/buf/__init__.py +++ b/python/buf/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/buf/validate/__init__.py b/python/buf/validate/__init__.py index e69de29b..9d48db4f 100644 --- a/python/buf/validate/__init__.py +++ b/python/buf/validate/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/buf/validate/validate_pb.py b/python/buf/validate/validate_pb.py new file mode 100644 index 00000000..c8648687 --- /dev/null +++ b/python/buf/validate/validate_pb.py @@ -0,0 +1,3637 @@ +# Generated from buf/validate/validate.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Final, Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Extension, Message +from protobuf._codegen import file_desc +from protobuf.wkt import FieldOptions, MessageOptions, OneofOptions, descriptor_pb, duration_pb, field_mask_pb, timestamp_pb + +if TYPE_CHECKING: + from protobuf import DescFile, Oneof + from protobuf.wkt import Duration, FieldDescriptorProto, FieldMask, Timestamp + + +_RuleFields: TypeAlias = Literal["id", "message", "expression"] + +class Rule(Message[_RuleFields]): + """ + `Rule` represents a validation rule written in the Common Expression + Language (CEL) syntax. Each Rule includes a unique identifier, an + optional error message, and the CEL expression to evaluate. For more + information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + + ```proto + message Foo { + option (buf.validate.message).cel = { + id: "foo.bar" + message: "bar must be greater than 0" + expression: "this.bar > 0" + }; + int32 bar = 1; + } + ``` + + ```proto + message buf.validate.Rule + ``` + + Attributes: + id: + `id` is a string that serves as a machine-readable name for this Rule. + It should be unique within its scope, which could be either a message or a field. + + ```proto + optional string id = 1; + ``` + message: + `message` is an optional field that provides a human-readable error message + for this Rule when the CEL expression evaluates to false. If a + non-empty message is provided, any strings resulting from the CEL + expression evaluation are ignored. + + ```proto + optional string message = 2; + ``` + expression: + `expression` is the actual CEL expression that will be evaluated for + validation. This string must resolve to either a boolean or a string + value. If the expression evaluates to false or a non-empty string, the + validation is considered failed, and the message is rejected. + + ```proto + optional string expression = 3; + ``` + """ + + __slots__ = ("id", "message", "expression") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + message: str | None = None, + expression: str | None = None, + ) -> None: + pass + + id: str + message: str + expression: str + +_MessageRulesFields: TypeAlias = Literal["cel_expression", "cel", "oneof"] + +class MessageRules(Message[_MessageRulesFields]): + """ + MessageRules represents validation rules that are applied to the entire message. + It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules. + + ```proto + message buf.validate.MessageRules + ``` + + Attributes: + cel_expression: + `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + + This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + be same as the `expression`. + + For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + + ```proto + message MyMessage { + // The field `foo` must be greater than 42. + option (buf.validate.message).cel_expression = "this.foo > 42"; + // The field `foo` must be less than 84. + option (buf.validate.message).cel_expression = "this.foo < 84"; + optional int32 foo = 1; + } + ``` + + ```proto + repeated string cel_expression = 5; + ``` + cel: + `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message. + These rules are written in Common Expression Language (CEL) syntax. For more information, + [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + + + ```proto + message MyMessage { + // The field `foo` must be greater than 42. + option (buf.validate.message).cel = { + id: "my_message.value", + message: "must be greater than 42", + expression: "this.foo > 42", + }; + optional int32 foo = 1; + } + ``` + + ```proto + repeated buf.validate.Rule cel = 3; + ``` + oneof: + `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields + of which at most one can be present. If `required` is also specified, then exactly one + of the specified fields _must_ be present. + + This will enforce oneof-like constraints with a few features not provided by + actual Protobuf oneof declarations: + 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof, + only scalar fields are allowed. + 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member + fields have explicit presence. This means that, for the purpose of determining + how many fields are set, explicitly setting such a field to its zero value is + effectively the same as not setting it at all. + 3. This will always generate validation errors for a message unmarshalled from + serialized data that sets more than one field. With a Protobuf oneof, when + multiple fields are present in the serialized form, earlier values are usually + silently ignored when unmarshalling, with only the last field being set when + unmarshalling completes. + + Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means + only the field that is set will be validated and the unset fields are not validated according to the field rules. + This behavior can be overridden by setting `ignore` against a field. + + ```proto + message MyMessage { + // Only one of `field1` or `field2` _can_ be present in this message. + option (buf.validate.message).oneof = { fields: ["field1", "field2"] }; + // Exactly one of `field3` or `field4` _must_ be present in this message. + option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true }; + string field1 = 1; + bytes field2 = 2; + bool field3 = 3; + int32 field4 = 4; + } + ``` + + ```proto + repeated buf.validate.MessageOneofRule oneof = 4; + ``` + """ + + __slots__ = ("cel_expression", "cel", "oneof") + + if TYPE_CHECKING: + + def __init__( + self, + *, + cel_expression: list[str] | None = None, + cel: list[Rule] | None = None, + oneof: list[MessageOneofRule] | None = None, + ) -> None: + pass + + cel_expression: list[str] + cel: list[Rule] + oneof: list[MessageOneofRule] + +_MessageOneofRuleFields: TypeAlias = Literal["fields", "required"] + +class MessageOneofRule(Message[_MessageOneofRuleFields]): + """ + ```proto + message buf.validate.MessageOneofRule + ``` + + Attributes: + fields: + A list of field names to include in the oneof. All field names must be + defined in the message. At least one field must be specified, and + duplicates are not permitted. + + ```proto + repeated string fields = 1; + ``` + required: + If true, one of the fields specified _must_ be set. + + ```proto + optional bool required = 2; + ``` + """ + + __slots__ = ("fields", "required") + + if TYPE_CHECKING: + + def __init__( + self, + *, + fields: list[str] | None = None, + required: bool | None = None, + ) -> None: + pass + + fields: list[str] + required: bool + +_OneofRulesFields: TypeAlias = Literal["required"] + +class OneofRules(Message[_OneofRulesFields]): + """ + The `OneofRules` message type enables you to manage rules for + oneof fields in your protobuf messages. + + ```proto + message buf.validate.OneofRules + ``` + + Attributes: + required: + If `required` is true, exactly one field of the oneof must be set. A + validation error is returned if no fields in the oneof are set. Further rules + should be placed on the fields themselves to ensure they are valid values, + such as `min_len` or `gt`. + + ```proto + message MyMessage { + oneof value { + // Either `a` or `b` must be set. If `a` is set, it must also be + // non-empty; whereas if `b` is set, it can still be an empty string. + option (buf.validate.oneof).required = true; + string a = 1 [(buf.validate.field).string.min_len = 1]; + string b = 2; + } + } + ``` + + ```proto + optional bool required = 1; + ``` + """ + + __slots__ = ("required",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + required: bool | None = None, + ) -> None: + pass + + required: bool + +_FieldRulesFields: TypeAlias = Literal["cel_expression", "cel", "required", "ignore", "float", "double", "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", "bool", "string", "bytes", "enum", "repeated", "map", "any", "duration", "field_mask", "timestamp"] + +class FieldRules(Message[_FieldRulesFields]): + """ + FieldRules encapsulates the rules for each type of field. Depending on + the field, the correct set should be used to ensure proper validations. + + ```proto + message buf.validate.FieldRules + ``` + + Attributes: + cel_expression: + `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation + rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax. + + This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for + simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will + be same as the `expression`. + + For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + + ```proto + message MyMessage { + // The field `value` must be greater than 42. + optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"]; + } + ``` + + ```proto + repeated string cel_expression = 29; + ``` + cel: + `cel` is a repeated field used to represent a textual expression + in the Common Expression Language (CEL) syntax. For more information, + [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/). + + ```proto + message MyMessage { + // The field `value` must be greater than 42. + optional int32 value = 1 [(buf.validate.field).cel = { + id: "my_message.value", + message: "must be greater than 42", + expression: "this > 42", + }]; + } + ``` + + ```proto + repeated buf.validate.Rule cel = 23; + ``` + required: + If `required` is true, the field must be set. A validation error is returned + if the field is not set. + + ```proto + syntax="proto3"; + + message FieldsWithPresence { + // Requires any string to be set, including the empty string. + optional string link = 1 [ + (buf.validate.field).required = true + ]; + // Requires true or false to be set. + optional bool disabled = 2 [ + (buf.validate.field).required = true + ]; + // Requires a message to be set, including the empty message. + SomeMessage msg = 4 [ + (buf.validate.field).required = true + ]; + } + ``` + + All fields in the example above track presence. By default, Protovalidate + ignores rules on those fields if no value is set. `required` ensures that + the fields are set and valid. + + Fields that don't track presence are always validated by Protovalidate, + whether they are set or not. It is not necessary to add `required`. It + can be added to indicate that the field cannot be the zero value. + + ```proto + syntax="proto3"; + + message FieldsWithoutPresence { + // `string.email` always applies, even to an empty string. + string link = 1 [ + (buf.validate.field).string.email = true + ]; + // `repeated.min_items` always applies, even to an empty list. + repeated string labels = 2 [ + (buf.validate.field).repeated.min_items = 1 + ]; + // `required`, for fields that don't track presence, indicates + // the value of the field can't be the zero value. + int32 zero_value_not_allowed = 3 [ + (buf.validate.field).required = true + ]; + } + ``` + + To learn which fields track presence, see the + [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + + Note: While field rules can be applied to repeated items, map keys, and map + values, the elements are always considered to be set. Consequently, + specifying `repeated.items.required` is redundant. + + ```proto + optional bool required = 25; + ``` + ignore: + Ignore validation rules on the field if its value matches the specified + criteria. See the `Ignore` enum for details. + + ```proto + message UpdateRequest { + // The uri rule only applies if the field is not an empty string. + string url = 1 [ + (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE, + (buf.validate.field).string.uri = true + ]; + } + ``` + + ```proto + optional buf.validate.Ignore ignore = 27; + ``` + type: + ```proto + oneof type + ``` + """ + + __slots__ = ("cel_expression", "cel", "required", "ignore", "type") + + if TYPE_CHECKING: + + def __init__( + self, + *, + cel_expression: list[str] | None = None, + cel: list[Rule] | None = None, + required: bool | None = None, + ignore: Ignore | None = None, + type: Oneof[Literal["float"], FloatRules] | Oneof[Literal["double"], DoubleRules] | Oneof[Literal["int32"], Int32Rules] | Oneof[Literal["int64"], Int64Rules] | Oneof[Literal["uint32"], UInt32Rules] | Oneof[Literal["uint64"], UInt64Rules] | Oneof[Literal["sint32"], SInt32Rules] | Oneof[Literal["sint64"], SInt64Rules] | Oneof[Literal["fixed32"], Fixed32Rules] | Oneof[Literal["fixed64"], Fixed64Rules] | Oneof[Literal["sfixed32"], SFixed32Rules] | Oneof[Literal["sfixed64"], SFixed64Rules] | Oneof[Literal["bool"], BoolRules] | Oneof[Literal["string"], StringRules] | Oneof[Literal["bytes"], BytesRules] | Oneof[Literal["enum"], EnumRules] | Oneof[Literal["repeated"], RepeatedRules] | Oneof[Literal["map"], MapRules] | Oneof[Literal["any"], AnyRules] | Oneof[Literal["duration"], DurationRules] | Oneof[Literal["field_mask"], FieldMaskRules] | Oneof[Literal["timestamp"], TimestampRules] | None = None, + ) -> None: + pass + + cel_expression: list[str] + cel: list[Rule] + required: bool + ignore: Ignore + type: Oneof[Literal["float"], FloatRules] | Oneof[Literal["double"], DoubleRules] | Oneof[Literal["int32"], Int32Rules] | Oneof[Literal["int64"], Int64Rules] | Oneof[Literal["uint32"], UInt32Rules] | Oneof[Literal["uint64"], UInt64Rules] | Oneof[Literal["sint32"], SInt32Rules] | Oneof[Literal["sint64"], SInt64Rules] | Oneof[Literal["fixed32"], Fixed32Rules] | Oneof[Literal["fixed64"], Fixed64Rules] | Oneof[Literal["sfixed32"], SFixed32Rules] | Oneof[Literal["sfixed64"], SFixed64Rules] | Oneof[Literal["bool"], BoolRules] | Oneof[Literal["string"], StringRules] | Oneof[Literal["bytes"], BytesRules] | Oneof[Literal["enum"], EnumRules] | Oneof[Literal["repeated"], RepeatedRules] | Oneof[Literal["map"], MapRules] | Oneof[Literal["any"], AnyRules] | Oneof[Literal["duration"], DurationRules] | Oneof[Literal["field_mask"], FieldMaskRules] | Oneof[Literal["timestamp"], TimestampRules] | None + +_PredefinedRulesFields: TypeAlias = Literal["cel"] + +class PredefinedRules(Message[_PredefinedRulesFields]): + """ + PredefinedRules are custom rules that can be re-used with + multiple fields. + + ```proto + message buf.validate.PredefinedRules + ``` + + Attributes: + cel: + `cel` is a repeated field used to represent a textual expression + in the Common Expression Language (CEL) syntax. For more information, + [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/). + + ```proto + message MyMessage { + // The field `value` must be greater than 42. + optional int32 value = 1 [(buf.validate.predefined).cel = { + id: "my_message.value", + message: "must be greater than 42", + expression: "this > 42", + }]; + } + ``` + + ```proto + repeated buf.validate.Rule cel = 1; + ``` + """ + + __slots__ = ("cel",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + cel: list[Rule] | None = None, + ) -> None: + pass + + cel: list[Rule] + +_FloatRulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "finite", "example"] + +class FloatRules(Message[_FloatRulesFields]): + """ + FloatRules describes the rules applied to `float` values. These + rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type. + + ```proto + message buf.validate.FloatRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyFloat { + // value must equal 42.0 + float value = 1 [(buf.validate.field).float.const = 42.0]; + } + ``` + + ```proto + optional float const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message + is generated. + + ```proto + message MyFloat { + // must be in list [1.0, 2.0, 3.0] + float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }]; + } + ``` + + ```proto + repeated float in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyFloat { + // value must not be in list [1.0, 2.0, 3.0] + float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }]; + } + ``` + + ```proto + repeated float not_in = 7 [packed = false]; + ``` + finite: + `finite` requires the field value to be finite. If the field value is + infinite or NaN, an error message is generated. + + ```proto + optional bool finite = 8; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyFloat { + float value = 1 [ + (buf.validate.field).float.example = 1.0, + (buf.validate.field).float.example = inf + ]; + } + ``` + + ```proto + repeated float example = 9 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "finite", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: float | None = None, + less_than: Oneof[Literal["lt"], float] | Oneof[Literal["lte"], float] | None = None, + greater_than: Oneof[Literal["gt"], float] | Oneof[Literal["gte"], float] | None = None, + in_: list[float] | None = None, + not_in: list[float] | None = None, + finite: bool | None = None, + example: list[float] | None = None, + ) -> None: + pass + + const: float + less_than: Oneof[Literal["lt"], float] | Oneof[Literal["lte"], float] | None + greater_than: Oneof[Literal["gt"], float] | Oneof[Literal["gte"], float] | None + in_: list[float] + not_in: list[float] + finite: bool + example: list[float] + +_DoubleRulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "finite", "example"] + +class DoubleRules(Message[_DoubleRulesFields]): + """ + DoubleRules describes the rules applied to `double` values. These + rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type. + + ```proto + message buf.validate.DoubleRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyDouble { + // value must equal 42.0 + double value = 1 [(buf.validate.field).double.const = 42.0]; + } + ``` + + ```proto + optional double const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyDouble { + // must be in list [1.0, 2.0, 3.0] + double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }]; + } + ``` + + ```proto + repeated double in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyDouble { + // value must not be in list [1.0, 2.0, 3.0] + double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }]; + } + ``` + + ```proto + repeated double not_in = 7 [packed = false]; + ``` + finite: + `finite` requires the field value to be finite. If the field value is + infinite or NaN, an error message is generated. + + ```proto + optional bool finite = 8; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyDouble { + double value = 1 [ + (buf.validate.field).double.example = 1.0, + (buf.validate.field).double.example = inf + ]; + } + ``` + + ```proto + repeated double example = 9 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "finite", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: float | None = None, + less_than: Oneof[Literal["lt"], float] | Oneof[Literal["lte"], float] | None = None, + greater_than: Oneof[Literal["gt"], float] | Oneof[Literal["gte"], float] | None = None, + in_: list[float] | None = None, + not_in: list[float] | None = None, + finite: bool | None = None, + example: list[float] | None = None, + ) -> None: + pass + + const: float + less_than: Oneof[Literal["lt"], float] | Oneof[Literal["lte"], float] | None + greater_than: Oneof[Literal["gt"], float] | Oneof[Literal["gte"], float] | None + in_: list[float] + not_in: list[float] + finite: bool + example: list[float] + +_Int32RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class Int32Rules(Message[_Int32RulesFields]): + """ + Int32Rules describes the rules applied to `int32` values. These + rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type. + + ```proto + message buf.validate.Int32Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyInt32 { + // value must equal 42 + int32 value = 1 [(buf.validate.field).int32.const = 42]; + } + ``` + + ```proto + optional int32 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyInt32 { + // must be in list [1, 2, 3] + int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated int32 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error message + is generated. + + ```proto + message MyInt32 { + // value must not be in list [1, 2, 3] + int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated int32 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyInt32 { + int32 value = 1 [ + (buf.validate.field).int32.example = 1, + (buf.validate.field).int32.example = -10 + ]; + } + ``` + + ```proto + repeated int32 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_Int64RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class Int64Rules(Message[_Int64RulesFields]): + """ + Int64Rules describes the rules applied to `int64` values. These + rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type. + + ```proto + message buf.validate.Int64Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyInt64 { + // value must equal 42 + int64 value = 1 [(buf.validate.field).int64.const = 42]; + } + ``` + + ```proto + optional int64 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyInt64 { + // must be in list [1, 2, 3] + int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated int64 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyInt64 { + // value must not be in list [1, 2, 3] + int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated int64 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyInt64 { + int64 value = 1 [ + (buf.validate.field).int64.example = 1, + (buf.validate.field).int64.example = -10 + ]; + } + ``` + + ```proto + repeated int64 example = 9 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_UInt32RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class UInt32Rules(Message[_UInt32RulesFields]): + """ + UInt32Rules describes the rules applied to `uint32` values. These + rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type. + + ```proto + message buf.validate.UInt32Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyUInt32 { + // value must equal 42 + uint32 value = 1 [(buf.validate.field).uint32.const = 42]; + } + ``` + + ```proto + optional uint32 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyUInt32 { + // must be in list [1, 2, 3] + uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated uint32 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyUInt32 { + // value must not be in list [1, 2, 3] + uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated uint32 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyUInt32 { + uint32 value = 1 [ + (buf.validate.field).uint32.example = 1, + (buf.validate.field).uint32.example = 10 + ]; + } + ``` + + ```proto + repeated uint32 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_UInt64RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class UInt64Rules(Message[_UInt64RulesFields]): + """ + UInt64Rules describes the rules applied to `uint64` values. These + rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type. + + ```proto + message buf.validate.UInt64Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyUInt64 { + // value must equal 42 + uint64 value = 1 [(buf.validate.field).uint64.const = 42]; + } + ``` + + ```proto + optional uint64 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyUInt64 { + // must be in list [1, 2, 3] + uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated uint64 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyUInt64 { + // value must not be in list [1, 2, 3] + uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated uint64 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyUInt64 { + uint64 value = 1 [ + (buf.validate.field).uint64.example = 1, + (buf.validate.field).uint64.example = 10 + ]; + } + ``` + + ```proto + repeated uint64 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_SInt32RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class SInt32Rules(Message[_SInt32RulesFields]): + """ + SInt32Rules describes the rules applied to `sint32` values. + + ```proto + message buf.validate.SInt32Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MySInt32 { + // value must equal 42 + sint32 value = 1 [(buf.validate.field).sint32.const = 42]; + } + ``` + + ```proto + optional sint32 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MySInt32 { + // must be in list [1, 2, 3] + sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sint32 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MySInt32 { + // value must not be in list [1, 2, 3] + sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sint32 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MySInt32 { + sint32 value = 1 [ + (buf.validate.field).sint32.example = 1, + (buf.validate.field).sint32.example = -10 + ]; + } + ``` + + ```proto + repeated sint32 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_SInt64RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class SInt64Rules(Message[_SInt64RulesFields]): + """ + SInt64Rules describes the rules applied to `sint64` values. + + ```proto + message buf.validate.SInt64Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MySInt64 { + // value must equal 42 + sint64 value = 1 [(buf.validate.field).sint64.const = 42]; + } + ``` + + ```proto + optional sint64 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message + is generated. + + ```proto + message MySInt64 { + // must be in list [1, 2, 3] + sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sint64 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MySInt64 { + // value must not be in list [1, 2, 3] + sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sint64 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MySInt64 { + sint64 value = 1 [ + (buf.validate.field).sint64.example = 1, + (buf.validate.field).sint64.example = -10 + ]; + } + ``` + + ```proto + repeated sint64 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_Fixed32RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class Fixed32Rules(Message[_Fixed32RulesFields]): + """ + Fixed32Rules describes the rules applied to `fixed32` values. + + ```proto + message buf.validate.Fixed32Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. + If the field value doesn't match, an error message is generated. + + ```proto + message MyFixed32 { + // value must equal 42 + fixed32 value = 1 [(buf.validate.field).fixed32.const = 42]; + } + ``` + + ```proto + optional fixed32 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message + is generated. + + ```proto + message MyFixed32 { + // must be in list [1, 2, 3] + fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated fixed32 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyFixed32 { + // value must not be in list [1, 2, 3] + fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated fixed32 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyFixed32 { + fixed32 value = 1 [ + (buf.validate.field).fixed32.example = 1, + (buf.validate.field).fixed32.example = 2 + ]; + } + ``` + + ```proto + repeated fixed32 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_Fixed64RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class Fixed64Rules(Message[_Fixed64RulesFields]): + """ + Fixed64Rules describes the rules applied to `fixed64` values. + + ```proto + message buf.validate.Fixed64Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyFixed64 { + // value must equal 42 + fixed64 value = 1 [(buf.validate.field).fixed64.const = 42]; + } + ``` + + ```proto + optional fixed64 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MyFixed64 { + // must be in list [1, 2, 3] + fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated fixed64 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MyFixed64 { + // value must not be in list [1, 2, 3] + fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated fixed64 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyFixed64 { + fixed64 value = 1 [ + (buf.validate.field).fixed64.example = 1, + (buf.validate.field).fixed64.example = 2 + ]; + } + ``` + + ```proto + repeated fixed64 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_SFixed32RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class SFixed32Rules(Message[_SFixed32RulesFields]): + """ + SFixed32Rules describes the rules applied to `fixed32` values. + + ```proto + message buf.validate.SFixed32Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MySFixed32 { + // value must equal 42 + sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42]; + } + ``` + + ```proto + optional sfixed32 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MySFixed32 { + // must be in list [1, 2, 3] + sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sfixed32 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MySFixed32 { + // value must not be in list [1, 2, 3] + sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sfixed32 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MySFixed32 { + sfixed32 value = 1 [ + (buf.validate.field).sfixed32.example = 1, + (buf.validate.field).sfixed32.example = 2 + ]; + } + ``` + + ```proto + repeated sfixed32 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_SFixed64RulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class SFixed64Rules(Message[_SFixed64RulesFields]): + """ + SFixed64Rules describes the rules applied to `fixed64` values. + + ```proto + message buf.validate.SFixed64Rules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MySFixed64 { + // value must equal 42 + sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42]; + } + ``` + + ```proto + optional sfixed64 const = 1; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` requires the field value to be equal to one of the specified values. + If the field value isn't one of the specified values, an error message is + generated. + + ```proto + message MySFixed64 { + // must be in list [1, 2, 3] + sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sfixed64 in = 6 [packed = false]; + ``` + not_in: + `not_in` requires the field value to not be equal to any of the specified + values. If the field value is one of the specified values, an error + message is generated. + + ```proto + message MySFixed64 { + // value must not be in list [1, 2, 3] + sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }]; + } + ``` + + ```proto + repeated sfixed64 not_in = 7 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MySFixed64 { + sfixed64 value = 1 [ + (buf.validate.field).sfixed64.example = 1, + (buf.validate.field).sfixed64.example = 2 + ]; + } + ``` + + ```proto + repeated sfixed64 example = 8 [packed = false]; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None = None, + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + less_than: Oneof[Literal["lt"], int] | Oneof[Literal["lte"], int] | None + greater_than: Oneof[Literal["gt"], int] | Oneof[Literal["gte"], int] | None + in_: list[int] + not_in: list[int] + example: list[int] + +_BoolRulesFields: TypeAlias = Literal["const", "example"] + +class BoolRules(Message[_BoolRulesFields]): + """ + BoolRules describes the rules applied to `bool` values. These rules + may also be applied to the `google.protobuf.BoolValue` Well-Known-Type. + + ```proto + message buf.validate.BoolRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified boolean value. + If the field value doesn't match, an error message is generated. + + ```proto + message MyBool { + // value must equal true + bool value = 1 [(buf.validate.field).bool.const = true]; + } + ``` + + ```proto + optional bool const = 1; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyBool { + bool value = 1 [ + (buf.validate.field).bool.example = true, + (buf.validate.field).bool.example = false + ]; + } + ``` + + ```proto + repeated bool example = 2 [packed = false]; + ``` + """ + + __slots__ = ("const", "example") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: bool | None = None, + example: list[bool] | None = None, + ) -> None: + pass + + const: bool + example: list[bool] + +_StringRulesFields: TypeAlias = Literal["const", "len", "min_len", "max_len", "len_bytes", "min_bytes", "max_bytes", "pattern", "prefix", "suffix", "contains", "not_contains", "in", "not_in", "email", "hostname", "ip", "ipv4", "ipv6", "uri", "uri_ref", "address", "uuid", "tuuid", "ip_with_prefixlen", "ipv4_with_prefixlen", "ipv6_with_prefixlen", "ip_prefix", "ipv4_prefix", "ipv6_prefix", "host_and_port", "ulid", "protobuf_fqn", "protobuf_dot_fqn", "well_known_regex", "strict", "example"] + +class StringRules(Message[_StringRulesFields]): + """ + StringRules describes the rules applied to `string` values These + rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type. + + ```proto + message buf.validate.StringRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified value. If + the field value doesn't match, an error message is generated. + + ```proto + message MyString { + // value must equal `hello` + string value = 1 [(buf.validate.field).string.const = "hello"]; + } + ``` + + ```proto + optional string const = 1; + ``` + len: + `len` dictates that the field value must have the specified + number of characters (Unicode code points), which may differ from the number + of bytes in the string. If the field value does not meet the specified + length, an error message will be generated. + + ```proto + message MyString { + // value length must be 5 characters + string value = 1 [(buf.validate.field).string.len = 5]; + } + ``` + + ```proto + optional uint64 len = 19; + ``` + min_len: + `min_len` specifies that the field value must have at least the specified + number of characters (Unicode code points), which may differ from the number + of bytes in the string. If the field value contains fewer characters, an error + message will be generated. + + ```proto + message MyString { + // value length must be at least 3 characters + string value = 1 [(buf.validate.field).string.min_len = 3]; + } + ``` + + ```proto + optional uint64 min_len = 2; + ``` + max_len: + `max_len` specifies that the field value must have no more than the specified + number of characters (Unicode code points), which may differ from the + number of bytes in the string. If the field value contains more characters, + an error message will be generated. + + ```proto + message MyString { + // value length must be at most 10 characters + string value = 1 [(buf.validate.field).string.max_len = 10]; + } + ``` + + ```proto + optional uint64 max_len = 3; + ``` + len_bytes: + `len_bytes` dictates that the field value must have the specified number of + bytes. If the field value does not match the specified length in bytes, + an error message will be generated. + + ```proto + message MyString { + // value length must be 6 bytes + string value = 1 [(buf.validate.field).string.len_bytes = 6]; + } + ``` + + ```proto + optional uint64 len_bytes = 20; + ``` + min_bytes: + `min_bytes` specifies that the field value must have at least the specified + number of bytes. If the field value contains fewer bytes, an error message + will be generated. + + ```proto + message MyString { + // value length must be at least 4 bytes + string value = 1 [(buf.validate.field).string.min_bytes = 4]; + } + + ``` + + ```proto + optional uint64 min_bytes = 4; + ``` + max_bytes: + `max_bytes` specifies that the field value must have no more than the + specified number of bytes. If the field value contains more bytes, an + error message will be generated. + + ```proto + message MyString { + // value length must be at most 8 bytes + string value = 1 [(buf.validate.field).string.max_bytes = 8]; + } + ``` + + ```proto + optional uint64 max_bytes = 5; + ``` + pattern: + `pattern` specifies that the field value must match the specified + regular expression (RE2 syntax), with the expression provided without any + delimiters. If the field value doesn't match the regular expression, an + error message will be generated. + + ```proto + message MyString { + // value does not match regex pattern `^[a-zA-Z]//$` + string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"]; + } + ``` + + ```proto + optional string pattern = 6; + ``` + prefix: + `prefix` specifies that the field value must have the + specified substring at the beginning of the string. If the field value + doesn't start with the specified prefix, an error message will be + generated. + + ```proto + message MyString { + // value does not have prefix `pre` + string value = 1 [(buf.validate.field).string.prefix = "pre"]; + } + ``` + + ```proto + optional string prefix = 7; + ``` + suffix: + `suffix` specifies that the field value must have the + specified substring at the end of the string. If the field value doesn't + end with the specified suffix, an error message will be generated. + + ```proto + message MyString { + // value does not have suffix `post` + string value = 1 [(buf.validate.field).string.suffix = "post"]; + } + ``` + + ```proto + optional string suffix = 8; + ``` + contains: + `contains` specifies that the field value must have the + specified substring anywhere in the string. If the field value doesn't + contain the specified substring, an error message will be generated. + + ```proto + message MyString { + // value does not contain substring `inside`. + string value = 1 [(buf.validate.field).string.contains = "inside"]; + } + ``` + + ```proto + optional string contains = 9; + ``` + not_contains: + `not_contains` specifies that the field value must not have the + specified substring anywhere in the string. If the field value contains + the specified substring, an error message will be generated. + + ```proto + message MyString { + // value contains substring `inside`. + string value = 1 [(buf.validate.field).string.not_contains = "inside"]; + } + ``` + + ```proto + optional string not_contains = 23; + ``` + in_: + `in` specifies that the field value must be equal to one of the specified + values. If the field value isn't one of the specified values, an error + message will be generated. + + ```proto + message MyString { + // must be in list ["apple", "banana"] + string value = 1 [(buf.validate.field).string = { in: ["apple", "banana"] }]; + } + ``` + + ```proto + repeated string in = 10; + ``` + not_in: + `not_in` specifies that the field value cannot be equal to any + of the specified values. If the field value is one of the specified values, + an error message will be generated. + ```proto + message MyString { + // value must not be in list ["orange", "grape"] + string value = 1 [(buf.validate.field).string = { not_in: ["orange", "grape"] }]; + } + ``` + + ```proto + repeated string not_in = 11; + ``` + well_known: + `WellKnown` rules provide advanced rules against common string + patterns. + + ```proto + oneof well_known + ``` + strict: + This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to + enable strict header validation. By default, this is true, and HTTP header + validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser + validations that only disallow `\\r\\n\\0` characters, which can be used to + bypass header matching rules. + + ```proto + message MyString { + // The field `value` must have be a valid HTTP headers, but not enforced with strict rules. + string value = 1 [(buf.validate.field).string.strict = false]; + } + ``` + + ```proto + optional bool strict = 25; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyString { + string value = 1 [ + (buf.validate.field).string.example = "hello", + (buf.validate.field).string.example = "world" + ]; + } + ``` + + ```proto + repeated string example = 34; + ``` + """ + + __slots__ = ("const", "len", "min_len", "max_len", "len_bytes", "min_bytes", "max_bytes", "pattern", "prefix", "suffix", "contains", "not_contains", "in_", "not_in", "strict", "example", "well_known") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: str | None = None, + len: int | None = None, + min_len: int | None = None, + max_len: int | None = None, + len_bytes: int | None = None, + min_bytes: int | None = None, + max_bytes: int | None = None, + pattern: str | None = None, + prefix: str | None = None, + suffix: str | None = None, + contains: str | None = None, + not_contains: str | None = None, + in_: list[str] | None = None, + not_in: list[str] | None = None, + well_known: Oneof[Literal["email"], bool] | Oneof[Literal["hostname"], bool] | Oneof[Literal["ip"], bool] | Oneof[Literal["ipv4"], bool] | Oneof[Literal["ipv6"], bool] | Oneof[Literal["uri"], bool] | Oneof[Literal["uri_ref"], bool] | Oneof[Literal["address"], bool] | Oneof[Literal["uuid"], bool] | Oneof[Literal["tuuid"], bool] | Oneof[Literal["ip_with_prefixlen"], bool] | Oneof[Literal["ipv4_with_prefixlen"], bool] | Oneof[Literal["ipv6_with_prefixlen"], bool] | Oneof[Literal["ip_prefix"], bool] | Oneof[Literal["ipv4_prefix"], bool] | Oneof[Literal["ipv6_prefix"], bool] | Oneof[Literal["host_and_port"], bool] | Oneof[Literal["ulid"], bool] | Oneof[Literal["protobuf_fqn"], bool] | Oneof[Literal["protobuf_dot_fqn"], bool] | Oneof[Literal["well_known_regex"], KnownRegex] | None = None, + strict: bool | None = None, + example: list[str] | None = None, + ) -> None: + pass + + const: str + len: int + min_len: int + max_len: int + len_bytes: int + min_bytes: int + max_bytes: int + pattern: str + prefix: str + suffix: str + contains: str + not_contains: str + in_: list[str] + not_in: list[str] + well_known: Oneof[Literal["email"], bool] | Oneof[Literal["hostname"], bool] | Oneof[Literal["ip"], bool] | Oneof[Literal["ipv4"], bool] | Oneof[Literal["ipv6"], bool] | Oneof[Literal["uri"], bool] | Oneof[Literal["uri_ref"], bool] | Oneof[Literal["address"], bool] | Oneof[Literal["uuid"], bool] | Oneof[Literal["tuuid"], bool] | Oneof[Literal["ip_with_prefixlen"], bool] | Oneof[Literal["ipv4_with_prefixlen"], bool] | Oneof[Literal["ipv6_with_prefixlen"], bool] | Oneof[Literal["ip_prefix"], bool] | Oneof[Literal["ipv4_prefix"], bool] | Oneof[Literal["ipv6_prefix"], bool] | Oneof[Literal["host_and_port"], bool] | Oneof[Literal["ulid"], bool] | Oneof[Literal["protobuf_fqn"], bool] | Oneof[Literal["protobuf_dot_fqn"], bool] | Oneof[Literal["well_known_regex"], KnownRegex] | None + strict: bool + example: list[str] + +_BytesRulesFields: TypeAlias = Literal["const", "len", "min_len", "max_len", "pattern", "prefix", "suffix", "contains", "in", "not_in", "ip", "ipv4", "ipv6", "uuid", "example"] + +class BytesRules(Message[_BytesRulesFields]): + """ + BytesRules describe the rules applied to `bytes` values. These rules + may also be applied to the `google.protobuf.BytesValue` Well-Known-Type. + + ```proto + message buf.validate.BytesRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified bytes + value. If the field value doesn't match, an error message is generated. + + ```proto + message MyBytes { + // must be "\\x01\\x02\\x03\\x04" + bytes value = 1 [(buf.validate.field).bytes.const = "\\x01\\x02\\x03\\x04"]; + } + ``` + + ```proto + optional bytes const = 1; + ``` + len: + `len` requires the field value to have the specified length in bytes. + If the field value doesn't match, an error message is generated. + + ```proto + message MyBytes { + // value length must be 4 bytes. + optional bytes value = 1 [(buf.validate.field).bytes.len = 4]; + } + ``` + + ```proto + optional uint64 len = 13; + ``` + min_len: + `min_len` requires the field value to have at least the specified minimum + length in bytes. + If the field value doesn't meet the requirement, an error message is generated. + + ```proto + message MyBytes { + // value length must be at least 2 bytes. + optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2]; + } + ``` + + ```proto + optional uint64 min_len = 2; + ``` + max_len: + `max_len` requires the field value to have at most the specified maximum + length in bytes. + If the field value exceeds the requirement, an error message is generated. + + ```proto + message MyBytes { + // must be at most 6 bytes. + optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6]; + } + ``` + + ```proto + optional uint64 max_len = 3; + ``` + pattern: + `pattern` requires the field value to match the specified regular + expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)). + The value of the field must be valid UTF-8 or validation will fail with a + runtime error. + If the field value doesn't match the pattern, an error message is generated. + + ```proto + message MyBytes { + // value must match regex pattern "^[a-zA-Z0-9]+$". + optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"]; + } + ``` + + ```proto + optional string pattern = 4; + ``` + prefix: + `prefix` requires the field value to have the specified bytes at the + beginning of the string. + If the field value doesn't meet the requirement, an error message is generated. + + ```proto + message MyBytes { + // value does not have prefix \\x01\\x02 + optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\\x01\\x02"]; + } + ``` + + ```proto + optional bytes prefix = 5; + ``` + suffix: + `suffix` requires the field value to have the specified bytes at the end + of the string. + If the field value doesn't meet the requirement, an error message is generated. + + ```proto + message MyBytes { + // value does not have suffix \\x03\\x04 + optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\\x03\\x04"]; + } + ``` + + ```proto + optional bytes suffix = 6; + ``` + contains: + `contains` requires the field value to have the specified bytes anywhere in + the string. + If the field value doesn't meet the requirement, an error message is generated. + + ```proto + message MyBytes { + // value does not contain \\x02\\x03 + optional bytes value = 1 [(buf.validate.field).bytes.contains = "\\x02\\x03"]; + } + ``` + + ```proto + optional bytes contains = 7; + ``` + in_: + `in` requires the field value to be equal to one of the specified + values. If the field value doesn't match any of the specified values, an + error message is generated. + + ```proto + message MyBytes { + // value must in ["\\x01\\x02", "\\x02\\x03", "\\x03\\x04"] + optional bytes value = 1 [(buf.validate.field).bytes = { in: ["\\x01\\x02", "\\x02\\x03", "\\x03\\x04"] }]; + } + ``` + + ```proto + repeated bytes in = 8; + ``` + not_in: + `not_in` requires the field value to be not equal to any of the specified + values. + If the field value matches any of the specified values, an error message is + generated. + + ```proto + message MyBytes { + // value must not in ["\\x01\\x02", "\\x02\\x03", "\\x03\\x04"] + optional bytes value = 1 [(buf.validate.field).bytes = { not_in: ["\\x01\\x02", "\\x02\\x03", "\\x03\\x04"] }]; + } + ``` + + ```proto + repeated bytes not_in = 9; + ``` + well_known: + WellKnown rules provide advanced rules against common byte + patterns + + ```proto + oneof well_known + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyBytes { + bytes value = 1 [ + (buf.validate.field).bytes.example = "\\x01\\x02", + (buf.validate.field).bytes.example = "\\x02\\x03" + ]; + } + ``` + + ```proto + repeated bytes example = 14; + ``` + """ + + __slots__ = ("const", "len", "min_len", "max_len", "pattern", "prefix", "suffix", "contains", "in_", "not_in", "example", "well_known") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: bytes | None = None, + len: int | None = None, + min_len: int | None = None, + max_len: int | None = None, + pattern: str | None = None, + prefix: bytes | None = None, + suffix: bytes | None = None, + contains: bytes | None = None, + in_: list[bytes] | None = None, + not_in: list[bytes] | None = None, + well_known: Oneof[Literal["ip"], bool] | Oneof[Literal["ipv4"], bool] | Oneof[Literal["ipv6"], bool] | Oneof[Literal["uuid"], bool] | None = None, + example: list[bytes] | None = None, + ) -> None: + pass + + const: bytes + len: int + min_len: int + max_len: int + pattern: str + prefix: bytes + suffix: bytes + contains: bytes + in_: list[bytes] + not_in: list[bytes] + well_known: Oneof[Literal["ip"], bool] | Oneof[Literal["ipv4"], bool] | Oneof[Literal["ipv6"], bool] | Oneof[Literal["uuid"], bool] | None + example: list[bytes] + +_EnumRulesFields: TypeAlias = Literal["const", "defined_only", "in", "not_in", "example"] + +class EnumRules(Message[_EnumRulesFields]): + """ + EnumRules describe the rules applied to `enum` values. + + ```proto + message buf.validate.EnumRules + ``` + + Attributes: + const: + `const` requires the field value to exactly match the specified enum value. + If the field value doesn't match, an error message is generated. + + ```proto + enum MyEnum { + MY_ENUM_UNSPECIFIED = 0; + MY_ENUM_VALUE1 = 1; + MY_ENUM_VALUE2 = 2; + } + + message MyMessage { + // The field `value` must be exactly MY_ENUM_VALUE1. + MyEnum value = 1 [(buf.validate.field).enum.const = 1]; + } + ``` + + ```proto + optional int32 const = 1; + ``` + defined_only: + `defined_only` requires the field value to be one of the defined values for + this enum, failing on any undefined value. + + ```proto + enum MyEnum { + MY_ENUM_UNSPECIFIED = 0; + MY_ENUM_VALUE1 = 1; + MY_ENUM_VALUE2 = 2; + } + + message MyMessage { + // The field `value` must be a defined value of MyEnum. + MyEnum value = 1 [(buf.validate.field).enum.defined_only = true]; + } + ``` + + ```proto + optional bool defined_only = 2; + ``` + in_: + `in` requires the field value to be equal to one of the + specified enum values. If the field value doesn't match any of the + specified values, an error message is generated. + + ```proto + enum MyEnum { + MY_ENUM_UNSPECIFIED = 0; + MY_ENUM_VALUE1 = 1; + MY_ENUM_VALUE2 = 2; + } + + message MyMessage { + // The field `value` must be equal to one of the specified values. + MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; + } + ``` + + ```proto + repeated int32 in = 3 [packed = false]; + ``` + not_in: + `not_in` requires the field value to be not equal to any of the + specified enum values. If the field value matches one of the specified + values, an error message is generated. + + ```proto + enum MyEnum { + MY_ENUM_UNSPECIFIED = 0; + MY_ENUM_VALUE1 = 1; + MY_ENUM_VALUE2 = 2; + } + + message MyMessage { + // The field `value` must not be equal to any of the specified values. + MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; + } + ``` + + ```proto + repeated int32 not_in = 4 [packed = false]; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + enum MyEnum { + MY_ENUM_UNSPECIFIED = 0; + MY_ENUM_VALUE1 = 1; + MY_ENUM_VALUE2 = 2; + } + + message MyMessage { + MyEnum value = 1 [ + (buf.validate.field).enum.example = 1, + (buf.validate.field).enum.example = 2 + ]; + } + ``` + + ```proto + repeated int32 example = 5 [packed = false]; + ``` + """ + + __slots__ = ("const", "defined_only", "in_", "not_in", "example") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: int | None = None, + defined_only: bool | None = None, + in_: list[int] | None = None, + not_in: list[int] | None = None, + example: list[int] | None = None, + ) -> None: + pass + + const: int + defined_only: bool + in_: list[int] + not_in: list[int] + example: list[int] + +_RepeatedRulesFields: TypeAlias = Literal["min_items", "max_items", "unique", "items"] + +class RepeatedRules(Message[_RepeatedRulesFields]): + """ + RepeatedRules describe the rules applied to `repeated` values. + + ```proto + message buf.validate.RepeatedRules + ``` + + Attributes: + min_items: + `min_items` requires that this field must contain at least the specified + minimum number of items. + + Note that `min_items = 1` is equivalent to setting a field as `required`. + + ```proto + message MyRepeated { + // value must contain at least 2 items + repeated string value = 1 [(buf.validate.field).repeated.min_items = 2]; + } + ``` + + ```proto + optional uint64 min_items = 1; + ``` + max_items: + `max_items` denotes that this field must not exceed a + certain number of items as the upper limit. If the field contains more + items than specified, an error message will be generated, requiring the + field to maintain no more than the specified number of items. + + ```proto + message MyRepeated { + // value must contain no more than 3 item(s) + repeated string value = 1 [(buf.validate.field).repeated.max_items = 3]; + } + ``` + + ```proto + optional uint64 max_items = 2; + ``` + unique: + `unique` indicates that all elements in this field must + be unique. This rule is strictly applicable to scalar and enum + types, with message types not being supported. + + ```proto + message MyRepeated { + // repeated value must contain unique items + repeated string value = 1 [(buf.validate.field).repeated.unique = true]; + } + ``` + + ```proto + optional bool unique = 3; + ``` + items: + `items` details the rules to be applied to each item + in the field. Even for repeated message fields, validation is executed + against each item unless `ignore` is specified. + + ```proto + message MyRepeated { + // The items in the field `value` must follow the specified rules. + repeated string value = 1 [(buf.validate.field).repeated.items = { + string: { + min_len: 3 + max_len: 10 + } + }]; + } + ``` + + Note that the `required` rule does not apply. Repeated items + cannot be unset. + + ```proto + optional buf.validate.FieldRules items = 4; + ``` + """ + + __slots__ = ("min_items", "max_items", "unique", "items") + + if TYPE_CHECKING: + + def __init__( + self, + *, + min_items: int | None = None, + max_items: int | None = None, + unique: bool | None = None, + items: FieldRules | None = None, + ) -> None: + pass + + min_items: int + max_items: int + unique: bool + items: FieldRules | None + +_MapRulesFields: TypeAlias = Literal["min_pairs", "max_pairs", "keys", "values"] + +class MapRules(Message[_MapRulesFields]): + """ + MapRules describe the rules applied to `map` values. + + ```proto + message buf.validate.MapRules + ``` + + Attributes: + min_pairs: + Specifies the minimum number of key-value pairs allowed. If the field has + fewer key-value pairs than specified, an error message is generated. + + ```proto + message MyMap { + // The field `value` must have at least 2 key-value pairs. + map value = 1 [(buf.validate.field).map.min_pairs = 2]; + } + ``` + + ```proto + optional uint64 min_pairs = 1; + ``` + max_pairs: + Specifies the maximum number of key-value pairs allowed. If the field has + more key-value pairs than specified, an error message is generated. + + ```proto + message MyMap { + // The field `value` must have at most 3 key-value pairs. + map value = 1 [(buf.validate.field).map.max_pairs = 3]; + } + ``` + + ```proto + optional uint64 max_pairs = 2; + ``` + keys: + Specifies the rules to be applied to each key in the field. + + ```proto + message MyMap { + // The keys in the field `value` must follow the specified rules. + map value = 1 [(buf.validate.field).map.keys = { + string: { + min_len: 3 + max_len: 10 + } + }]; + } + ``` + + Note that the `required` rule does not apply. Map keys cannot be unset. + + ```proto + optional buf.validate.FieldRules keys = 4; + ``` + values: + Specifies the rules to be applied to the value of each key in the + field. Message values will still have their validations evaluated unless + `ignore` is specified. + + ```proto + message MyMap { + // The values in the field `value` must follow the specified rules. + map value = 1 [(buf.validate.field).map.values = { + string: { + min_len: 5 + max_len: 20 + } + }]; + } + ``` + Note that the `required` rule does not apply. Map values cannot be unset. + + ```proto + optional buf.validate.FieldRules values = 5; + ``` + """ + + __slots__ = ("min_pairs", "max_pairs", "keys", "values") + + if TYPE_CHECKING: + + def __init__( + self, + *, + min_pairs: int | None = None, + max_pairs: int | None = None, + keys: FieldRules | None = None, + values: FieldRules | None = None, + ) -> None: + pass + + min_pairs: int + max_pairs: int + keys: FieldRules | None + values: FieldRules | None + +_AnyRulesFields: TypeAlias = Literal["in", "not_in"] + +class AnyRules(Message[_AnyRulesFields]): + """ + AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type. + + ```proto + message buf.validate.AnyRules + ``` + + Attributes: + in_: + `in` requires the field's `type_url` to be equal to one of the + specified values. If it doesn't match any of the specified values, an error + message is generated. + + ```proto + message MyAny { + // The `value` field must have a `type_url` equal to one of the specified values. + google.protobuf.Any value = 1 [(buf.validate.field).any = { + in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"] + }]; + } + ``` + + ```proto + repeated string in = 2; + ``` + not_in: + `not_in` requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated. + + ```proto + message MyAny { + // The `value` field must not have a `type_url` equal to any of the specified values. + google.protobuf.Any value = 1 [(buf.validate.field).any = { + not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"] + }]; + } + ``` + + ```proto + repeated string not_in = 3; + ``` + """ + + __slots__ = ("in_", "not_in") + + if TYPE_CHECKING: + + def __init__( + self, + *, + in_: list[str] | None = None, + not_in: list[str] | None = None, + ) -> None: + pass + + in_: list[str] + not_in: list[str] + +_DurationRulesFields: TypeAlias = Literal["const", "lt", "lte", "gt", "gte", "in", "not_in", "example"] + +class DurationRules(Message[_DurationRulesFields]): + """ + DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type. + + ```proto + message buf.validate.DurationRules + ``` + + Attributes: + const: + `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly. + If the field's value deviates from the specified value, an error message + will be generated. + + ```proto + message MyDuration { + // value must equal 5s + google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = { seconds: 5 }]; + } + ``` + + ```proto + optional google.protobuf.Duration const = 2; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + in_: + `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type. + If the field's value doesn't correspond to any of the specified values, + an error message will be generated. + + ```proto + message MyDuration { + // must be in list [1s, 2s, 3s] + google.protobuf.Duration value = 1 [(buf.validate.field).duration = { + in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }] + }]; + } + ``` + + ```proto + repeated google.protobuf.Duration in = 7; + ``` + not_in: + `not_in` denotes that the field must not be equal to + any of the specified values of the `google.protobuf.Duration` type. + If the field's value matches any of these values, an error message will be + generated. + + ```proto + message MyDuration { + // value must not be in list [1s, 2s, 3s] + google.protobuf.Duration value = 1 [(buf.validate.field).duration = { + not_in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }] + }]; + } + ``` + + ```proto + repeated google.protobuf.Duration not_in = 8; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyDuration { + google.protobuf.Duration value = 1 [ + (buf.validate.field).duration.example = { seconds: 1 }, + (buf.validate.field).duration.example = { seconds: 2 } + ]; + } + ``` + + ```proto + repeated google.protobuf.Duration example = 9; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: Duration | None = None, + less_than: Oneof[Literal["lt"], Duration] | Oneof[Literal["lte"], Duration] | None = None, + greater_than: Oneof[Literal["gt"], Duration] | Oneof[Literal["gte"], Duration] | None = None, + in_: list[Duration] | None = None, + not_in: list[Duration] | None = None, + example: list[Duration] | None = None, + ) -> None: + pass + + const: Duration | None + less_than: Oneof[Literal["lt"], Duration] | Oneof[Literal["lte"], Duration] | None + greater_than: Oneof[Literal["gt"], Duration] | Oneof[Literal["gte"], Duration] | None + in_: list[Duration] + not_in: list[Duration] + example: list[Duration] + +_FieldMaskRulesFields: TypeAlias = Literal["const", "in", "not_in", "example"] + +class FieldMaskRules(Message[_FieldMaskRulesFields]): + """ + FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type. + + ```proto + message buf.validate.FieldMaskRules + ``` + + Attributes: + const: + `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly. + If the field's value deviates from the specified value, an error message + will be generated. + + ```proto + message MyFieldMask { + // value must equal ["a"] + google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = { + paths: ["a"] + }]; + } + ``` + + ```proto + optional google.protobuf.FieldMask const = 1; + ``` + in_: + `in` requires the field value to only contain paths matching specified + values or their subpaths. + If any of the field value's paths doesn't match the rule, + an error message is generated. + See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + + ```proto + message MyFieldMask { + // The `value` FieldMask must only contain paths listed in `in`. + google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + in: ["a", "b", "c.a"] + }]; + } + ``` + + ```proto + repeated string in = 2; + ``` + not_in: + `not_in` requires the field value to not contain paths matching specified + values or their subpaths. + If any of the field value's paths matches the rule, + an error message is generated. + See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask + + ```proto + message MyFieldMask { + // The `value` FieldMask shall not contain paths listed in `not_in`. + google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = { + not_in: ["forbidden", "immutable", "c.a"] + }]; + } + ``` + + ```proto + repeated string not_in = 3; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyFieldMask { + google.protobuf.FieldMask value = 1 [ + (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, + (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] } + ]; + } + ``` + + ```proto + repeated google.protobuf.FieldMask example = 4; + ``` + """ + + __slots__ = ("const", "in_", "not_in", "example") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: FieldMask | None = None, + in_: list[str] | None = None, + not_in: list[str] | None = None, + example: list[FieldMask] | None = None, + ) -> None: + pass + + const: FieldMask | None + in_: list[str] + not_in: list[str] + example: list[FieldMask] + +_TimestampRulesFields: TypeAlias = Literal["const", "lt", "lte", "lt_now", "gt", "gte", "gt_now", "within", "example"] + +class TimestampRules(Message[_TimestampRulesFields]): + """ + TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type. + + ```proto + message buf.validate.TimestampRules + ``` + + Attributes: + const: + `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated. + + ```proto + message MyTimestamp { + // value must equal 2023-05-03T10:00:00Z + google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}]; + } + ``` + + ```proto + optional google.protobuf.Timestamp const = 2; + ``` + less_than: + ```proto + oneof less_than + ``` + greater_than: + ```proto + oneof greater_than + ``` + within: + `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated. + + ```proto + message MyTimestamp { + // must be within 1 hour of now + google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}]; + } + ``` + + ```proto + optional google.protobuf.Duration within = 9; + ``` + example: + `example` specifies values that the field may have. These values SHOULD + conform to other rules. `example` values will not impact validation + but may be used as helpful guidance on how to populate the given field. + + ```proto + message MyTimestamp { + google.protobuf.Timestamp value = 1 [ + (buf.validate.field).timestamp.example = { seconds: 1672444800 }, + (buf.validate.field).timestamp.example = { seconds: 1672531200 } + ]; + } + ``` + + ```proto + repeated google.protobuf.Timestamp example = 10; + ``` + """ + + __slots__ = ("const", "within", "example", "less_than", "greater_than") + + if TYPE_CHECKING: + + def __init__( + self, + *, + const: Timestamp | None = None, + less_than: Oneof[Literal["lt"], Timestamp] | Oneof[Literal["lte"], Timestamp] | Oneof[Literal["lt_now"], bool] | None = None, + greater_than: Oneof[Literal["gt"], Timestamp] | Oneof[Literal["gte"], Timestamp] | Oneof[Literal["gt_now"], bool] | None = None, + within: Duration | None = None, + example: list[Timestamp] | None = None, + ) -> None: + pass + + const: Timestamp | None + less_than: Oneof[Literal["lt"], Timestamp] | Oneof[Literal["lte"], Timestamp] | Oneof[Literal["lt_now"], bool] | None + greater_than: Oneof[Literal["gt"], Timestamp] | Oneof[Literal["gte"], Timestamp] | Oneof[Literal["gt_now"], bool] | None + within: Duration | None + example: list[Timestamp] + +_ViolationsFields: TypeAlias = Literal["violations"] + +class Violations(Message[_ViolationsFields]): + """ + `Violations` is a collection of `Violation` messages. This message type is returned by + Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules. + Each individual violation is represented by a `Violation` message. + + ```proto + message buf.validate.Violations + ``` + + Attributes: + violations: + `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. + + ```proto + repeated buf.validate.Violation violations = 1; + ``` + """ + + __slots__ = ("violations",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + violations: list[Violation] | None = None, + ) -> None: + pass + + violations: list[Violation] + +_ViolationFields: TypeAlias = Literal["field", "rule", "rule_id", "message", "for_key"] + +class Violation(Message[_ViolationFields]): + """ + `Violation` represents a single instance where a validation rule, expressed + as a `Rule`, was not met. It provides information about the field that + caused the violation, the specific rule that wasn't fulfilled, and a + human-readable error message. + + For example, consider the following message: + + ```proto + message User { + int32 age = 1 [(buf.validate.field).cel = { + id: "user.age", + expression: "this < 18 ? 'User must be at least 18 years old' : ''", + }]; + } + ``` + + It could produce the following violation: + + ```json + { + "ruleId": "user.age", + "message": "User must be at least 18 years old", + "field": { + "elements": [ + { + "fieldNumber": 1, + "fieldName": "age", + "fieldType": "TYPE_INT32" + } + ] + }, + "rule": { + "elements": [ + { + "fieldNumber": 23, + "fieldName": "cel", + "fieldType": "TYPE_MESSAGE", + "index": "0" + } + ] + } + } + ``` + + ```proto + message buf.validate.Violation + ``` + + Attributes: + field: + `field` is a machine-readable path to the field that failed validation. + This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation. + + For example, consider the following message: + + ```proto + message Message { + bool a = 1 [(buf.validate.field).required = true]; + } + ``` + + It could produce the following violation: + + ```textproto + violation { + field { element { field_number: 1, field_name: "a", field_type: 8 } } + ... + } + ``` + + ```proto + optional buf.validate.FieldPath field = 5; + ``` + rule: + `rule` is a machine-readable path that points to the specific rule that failed validation. + This will be a nested field starting from the FieldRules of the field that failed validation. + For custom rules, this will provide the path of the rule, e.g. `cel[0]`. + + For example, consider the following message: + + ```proto + message Message { + bool a = 1 [(buf.validate.field).required = true]; + bool b = 2 [(buf.validate.field).cel = { + id: "custom_rule", + expression: "!this ? 'b must be true': ''" + }]; + } + ``` + + It could produce the following violations: + + ```textproto + violation { + rule { element { field_number: 25, field_name: "required", field_type: 8 } } + ... + } + violation { + rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } } + ... + } + ``` + + ```proto + optional buf.validate.FieldPath rule = 6; + ``` + rule_id: + `rule_id` is the unique identifier of the `Rule` that was not fulfilled. + This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated. + + ```proto + optional string rule_id = 2; + ``` + message: + `message` is a human-readable error message that describes the nature of the violation. + This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation. + + ```proto + optional string message = 3; + ``` + for_key: + `for_key` indicates whether the violation was caused by a map key, rather than a value. + + ```proto + optional bool for_key = 4; + ``` + """ + + __slots__ = ("field", "rule", "rule_id", "message", "for_key") + + if TYPE_CHECKING: + + def __init__( + self, + *, + field: FieldPath | None = None, + rule: FieldPath | None = None, + rule_id: str | None = None, + message: str | None = None, + for_key: bool | None = None, + ) -> None: + pass + + field: FieldPath | None + rule: FieldPath | None + rule_id: str + message: str + for_key: bool + +_FieldPathFields: TypeAlias = Literal["elements"] + +class FieldPath(Message[_FieldPathFields]): + """ + `FieldPath` provides a path to a nested protobuf field. + + This message provides enough information to render a dotted field path even without protobuf descriptors. + It also provides enough information to resolve a nested field through unknown wire data. + + ```proto + message buf.validate.FieldPath + ``` + + Attributes: + elements: + `elements` contains each element of the path, starting from the root and recursing downward. + + ```proto + repeated buf.validate.FieldPathElement elements = 1; + ``` + """ + + __slots__ = ("elements",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + elements: list[FieldPathElement] | None = None, + ) -> None: + pass + + elements: list[FieldPathElement] + +_FieldPathElementFields: TypeAlias = Literal["field_number", "field_name", "field_type", "key_type", "value_type", "index", "bool_key", "int_key", "uint_key", "string_key"] + +class FieldPathElement(Message[_FieldPathElementFields]): + """ + `FieldPathElement` provides enough information to nest through a single protobuf field. + + If the selected field is a map or repeated field, the `subscript` value selects a specific element from it. + A path that refers to a value nested under a map key or repeated field index will have a `subscript` value. + The `field_type` field allows unambiguous resolution of a field even if descriptors are not available. + + ```proto + message buf.validate.FieldPathElement + ``` + + Attributes: + field_number: + `field_number` is the field number this path element refers to. + + ```proto + optional int32 field_number = 1; + ``` + field_name: + `field_name` contains the field name this path element refers to. + This can be used to display a human-readable path even if the field number is unknown. + + ```proto + optional string field_name = 2; + ``` + field_type: + `field_type` specifies the type of this field. When using reflection, this value is not needed. + + This value is provided to make it possible to traverse unknown fields through wire data. + When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes. + + [1]: https://protobuf.dev/programming-guides/encoding/#packed + [2]: https://protobuf.dev/programming-guides/encoding/#groups + + N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and + can be explicitly used in Protocol Buffers 2023 Edition. + + ```proto + optional google.protobuf.FieldDescriptorProto.Type field_type = 3; + ``` + key_type: + `key_type` specifies the map key type of this field. This value is useful when traversing + unknown fields through wire data: specifically, it allows handling the differences between + different integer encodings. + + ```proto + optional google.protobuf.FieldDescriptorProto.Type key_type = 4; + ``` + value_type: + `value_type` specifies map value type of this field. This is useful if you want to display a + value inside unknown fields through wire data. + + ```proto + optional google.protobuf.FieldDescriptorProto.Type value_type = 5; + ``` + subscript: + `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field. + + ```proto + oneof subscript + ``` + """ + + __slots__ = ("field_number", "field_name", "field_type", "key_type", "value_type", "subscript") + + if TYPE_CHECKING: + + def __init__( + self, + *, + field_number: int | None = None, + field_name: str | None = None, + field_type: FieldDescriptorProto.Type | None = None, + key_type: FieldDescriptorProto.Type | None = None, + value_type: FieldDescriptorProto.Type | None = None, + subscript: Oneof[Literal["index"], int] | Oneof[Literal["bool_key"], bool] | Oneof[Literal["int_key"], int] | Oneof[Literal["uint_key"], int] | Oneof[Literal["string_key"], str] | None = None, + ) -> None: + pass + + field_number: int + field_name: str + field_type: FieldDescriptorProto.Type + key_type: FieldDescriptorProto.Type + value_type: FieldDescriptorProto.Type + subscript: Oneof[Literal["index"], int] | Oneof[Literal["bool_key"], bool] | Oneof[Literal["int_key"], int] | Oneof[Literal["uint_key"], int] | Oneof[Literal["string_key"], str] | None + +class Ignore(Enum): + """ + Specifies how `FieldRules.ignore` behaves, depending on the field's value, and + whether the field tracks presence. + + ```proto + enum buf.validate.Ignore + ``` + + Attributes: + UNSPECIFIED: + Ignore rules if the field tracks presence and is unset. This is the default + behavior. + + In proto3, only message fields, members of a Protobuf `oneof`, and fields + with the `optional` label track presence. Consequently, the following fields + are always validated, whether a value is set or not: + + ```proto + syntax="proto3"; + + message RulesApply { + string email = 1 [ + (buf.validate.field).string.email = true + ]; + int32 age = 2 [ + (buf.validate.field).int32.gt = 0 + ]; + repeated string labels = 3 [ + (buf.validate.field).repeated.min_items = 1 + ]; + } + ``` + + In contrast, the following fields track presence, and are only validated if + a value is set: + + ```proto + syntax="proto3"; + + message RulesApplyIfSet { + optional string email = 1 [ + (buf.validate.field).string.email = true + ]; + oneof ref { + string reference = 2 [ + (buf.validate.field).string.uuid = true + ]; + string name = 3 [ + (buf.validate.field).string.min_len = 4 + ]; + } + SomeMessage msg = 4 [ + (buf.validate.field).cel = {/* ... */} + ]; + } + ``` + + To ensure that such a field is set, add the `required` rule. + + To learn which fields track presence, see the + [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat). + + ```proto + IGNORE_UNSPECIFIED = 0 + ``` + IF_ZERO_VALUE: + Ignore rules if the field is unset, or set to the zero value. + + The zero value depends on the field type: + - For strings, the zero value is the empty string. + - For bytes, the zero value is empty bytes. + - For bool, the zero value is false. + - For numeric types, the zero value is zero. + - For enums, the zero value is the first defined enum value. + - For repeated fields, the zero is an empty list. + - For map fields, the zero is an empty map. + - For message fields, absence of the message (typically a null-value) is considered zero value. + + For fields that track presence (e.g. adding the `optional` label in proto3), + this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`. + + ```proto + IGNORE_IF_ZERO_VALUE = 1 + ``` + ALWAYS: + Always ignore rules, including the `required` rule. + + This is useful for ignoring the rules of a referenced message, or to + temporarily ignore rules during development. + + ```proto + message MyMessage { + // The field's rules will always be ignored, including any validations + // on value's fields. + MyOtherMessage value = 1 [ + (buf.validate.field).ignore = IGNORE_ALWAYS + ]; + } + ``` + + ```proto + IGNORE_ALWAYS = 3 + ``` + """ + + UNSPECIFIED = 0 + IF_ZERO_VALUE = 1 + ALWAYS = 3 + +class KnownRegex(Enum): + """ + KnownRegex contains some well-known patterns. + + ```proto + enum buf.validate.KnownRegex + ``` + + Attributes: + UNSPECIFIED: + ```proto + KNOWN_REGEX_UNSPECIFIED = 0 + ``` + HTTP_HEADER_NAME: + HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). + + ```proto + KNOWN_REGEX_HTTP_HEADER_NAME = 1 + ``` + HTTP_HEADER_VALUE: + HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). + + ```proto + KNOWN_REGEX_HTTP_HEADER_VALUE = 2 + ``` + """ + + UNSPECIFIED = 0 + HTTP_HEADER_NAME = 1 + HTTP_HEADER_VALUE = 2 + +ext_message: Final[Extension[MessageOptions, MessageRules]] = Extension() +""" +Rules specify the validations to be performed on this message. By default, +no validation is performed against a message. + +```proto +extend google.protobuf.MessageOptions { optional buf.validate.MessageRules message = 1159 [json_name = "[buf.validate.message]"] } +``` +""" + +ext_oneof: Final[Extension[OneofOptions, OneofRules]] = Extension() +""" +Rules specify the validations to be performed on this oneof. By default, +no validation is performed against a oneof. + +```proto +extend google.protobuf.OneofOptions { optional buf.validate.OneofRules oneof = 1159 [json_name = "[buf.validate.oneof]"] } +``` +""" + +ext_field: Final[Extension[FieldOptions, FieldRules]] = Extension() +""" +Rules specify the validations to be performed on this field. By default, +no validation is performed against a field. + +```proto +extend google.protobuf.FieldOptions { optional buf.validate.FieldRules field = 1159 [json_name = "[buf.validate.field]"] } +``` +""" + +ext_predefined: Final[Extension[FieldOptions, PredefinedRules]] = Extension() +""" +Specifies predefined rules. When extending a standard rule message, +this adds additional CEL expressions that apply when the extension is used. + +```proto +extend buf.validate.Int32Rules { + bool is_zero = 1001 [(buf.validate.predefined).cel = { + id: "int32.is_zero", + message: "must be zero", + expression: "!rule || this == 0", + }]; +} + +message Foo { + int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true]; +} +``` + +```proto +extend google.protobuf.FieldOptions { optional buf.validate.PredefinedRules predefined = 1160 [json_name = "[buf.validate.predefined]"] } +``` +""" + + +_DESC = file_desc( + b'\n\x1bbuf/validate/validate.proto\x12\x0cbuf.validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"P\n\x04Rule\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\x12\x1e\n\nexpression\x18\x03 \x01(\tR\nexpression"\xa1\x01\n\x0cMessageRules\x12%\n\x0ecel_expression\x18\x05 \x03(\tR\rcelExpression\x12$\n\x03cel\x18\x03 \x03(\x0b2\x12.buf.validate.RuleR\x03cel\x124\n\x05oneof\x18\x04 \x03(\x0b2\x1e.buf.validate.MessageOneofRuleR\x05oneofJ\x04\x08\x01\x10\x02R\x08disabled"F\n\x10MessageOneofRule\x12\x16\n\x06fields\x18\x01 \x03(\tR\x06fields\x12\x1a\n\x08required\x18\x02 \x01(\x08R\x08required"(\n\nOneofRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required"\xe3\n\n\nFieldRules\x12%\n\x0ecel_expression\x18\x1d \x03(\tR\rcelExpression\x12$\n\x03cel\x18\x17 \x03(\x0b2\x12.buf.validate.RuleR\x03cel\x12\x1a\n\x08required\x18\x19 \x01(\x08R\x08required\x12,\n\x06ignore\x18\x1b \x01(\x0e2\x14.buf.validate.IgnoreR\x06ignore\x120\n\x05float\x18\x01 \x01(\x0b2\x18.buf.validate.FloatRulesH\x00R\x05float\x123\n\x06double\x18\x02 \x01(\x0b2\x19.buf.validate.DoubleRulesH\x00R\x06double\x120\n\x05int32\x18\x03 \x01(\x0b2\x18.buf.validate.Int32RulesH\x00R\x05int32\x120\n\x05int64\x18\x04 \x01(\x0b2\x18.buf.validate.Int64RulesH\x00R\x05int64\x123\n\x06uint32\x18\x05 \x01(\x0b2\x19.buf.validate.UInt32RulesH\x00R\x06uint32\x123\n\x06uint64\x18\x06 \x01(\x0b2\x19.buf.validate.UInt64RulesH\x00R\x06uint64\x123\n\x06sint32\x18\x07 \x01(\x0b2\x19.buf.validate.SInt32RulesH\x00R\x06sint32\x123\n\x06sint64\x18\x08 \x01(\x0b2\x19.buf.validate.SInt64RulesH\x00R\x06sint64\x126\n\x07fixed32\x18\t \x01(\x0b2\x1a.buf.validate.Fixed32RulesH\x00R\x07fixed32\x126\n\x07fixed64\x18\n \x01(\x0b2\x1a.buf.validate.Fixed64RulesH\x00R\x07fixed64\x129\n\x08sfixed32\x18\x0b \x01(\x0b2\x1b.buf.validate.SFixed32RulesH\x00R\x08sfixed32\x129\n\x08sfixed64\x18\x0c \x01(\x0b2\x1b.buf.validate.SFixed64RulesH\x00R\x08sfixed64\x12-\n\x04bool\x18\r \x01(\x0b2\x17.buf.validate.BoolRulesH\x00R\x04bool\x123\n\x06string\x18\x0e \x01(\x0b2\x19.buf.validate.StringRulesH\x00R\x06string\x120\n\x05bytes\x18\x0f \x01(\x0b2\x18.buf.validate.BytesRulesH\x00R\x05bytes\x12-\n\x04enum\x18\x10 \x01(\x0b2\x17.buf.validate.EnumRulesH\x00R\x04enum\x129\n\x08repeated\x18\x12 \x01(\x0b2\x1b.buf.validate.RepeatedRulesH\x00R\x08repeated\x12*\n\x03map\x18\x13 \x01(\x0b2\x16.buf.validate.MapRulesH\x00R\x03map\x12*\n\x03any\x18\x14 \x01(\x0b2\x16.buf.validate.AnyRulesH\x00R\x03any\x129\n\x08duration\x18\x15 \x01(\x0b2\x1b.buf.validate.DurationRulesH\x00R\x08duration\x12=\n\nfield_mask\x18\x1c \x01(\x0b2\x1c.buf.validate.FieldMaskRulesH\x00R\tfieldMask\x12<\n\ttimestamp\x18\x16 \x01(\x0b2\x1c.buf.validate.TimestampRulesH\x00R\ttimestampB\x06\n\x04typeJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty"Z\n\x0fPredefinedRules\x12$\n\x03cel\x18\x01 \x03(\x0b2\x12.buf.validate.RuleR\x03celJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty"\xae\x17\n\nFloatRules\x12\x84\x01\n\x05const\x18\x01 \x01(\x02R\x05constBn\xc2Hk\ni\n\x0bfloat.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x9d\x01\n\x02lt\x18\x02 \x01(\x02H\x00R\x02ltB\x8a\x01\xc2H\x86\x01\n\x83\x01\n\x08float.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\xae\x01\n\x03lte\x18\x03 \x01(\x02H\x00R\x03lteB\x99\x01\xc2H\x95\x01\n\x92\x01\n\tfloat.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\xd4\x07\n\x02gt\x18\x04 \x01(\x02H\x01R\x02gtB\xc1\x07\xc2H\xbd\x07\n\x86\x01\n\x08float.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xbd\x01\n\x0bfloat.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc7\x01\n\x15float.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xcd\x01\n\x0cfloat.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xd7\x01\n\x16float.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xa1\x08\n\x03gte\x18\x05 \x01(\x02H\x01R\x03gteB\x8c\x08\xc2H\x88\x08\n\x95\x01\n\tfloat.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xcc\x01\n\x0cfloat.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd6\x01\n\x16float.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdc\x01\n\rfloat.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xe6\x01\n\x17float.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12}\n\x02in\x18\x06 \x03(\x02R\x02inBm\xc2Hj\nh\n\x08float.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12w\n\x06not_in\x18\x07 \x03(\x02R\x05notInB`\xc2H]\n[\n\x0cfloat.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x12w\n\x06finite\x18\x08 \x01(\x08R\x06finiteB_\xc2H\\\nZ\n\x0cfloat.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'\x124\n\x07example\x18\t \x03(\x02R\x07exampleB\x1a\xc2H\x17\n\x15\n\rfloat.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xc0\x17\n\x0bDoubleRules\x12\x85\x01\n\x05const\x18\x01 \x01(\x01R\x05constBo\xc2Hl\nj\n\x0cdouble.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x9e\x01\n\x02lt\x18\x02 \x01(\x01H\x00R\x02ltB\x8b\x01\xc2H\x87\x01\n\x84\x01\n\tdouble.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\xaf\x01\n\x03lte\x18\x03 \x01(\x01H\x00R\x03lteB\x9a\x01\xc2H\x96\x01\n\x93\x01\n\ndouble.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\xd9\x07\n\x02gt\x18\x04 \x01(\x01H\x01R\x02gtB\xc6\x07\xc2H\xc2\x07\n\x87\x01\n\tdouble.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xbe\x01\n\x0cdouble.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc8\x01\n\x16double.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xce\x01\n\rdouble.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xd8\x01\n\x17double.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xa6\x08\n\x03gte\x18\x05 \x01(\x01H\x01R\x03gteB\x91\x08\xc2H\x8d\x08\n\x96\x01\n\ndouble.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xcd\x01\n\rdouble.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd7\x01\n\x17double.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdd\x01\n\x0edouble.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xe7\x01\n\x18double.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12~\n\x02in\x18\x06 \x03(\x01R\x02inBn\xc2Hk\ni\n\tdouble.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x07 \x03(\x01R\x05notInBa\xc2H^\n\\\n\rdouble.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x12x\n\x06finite\x18\x08 \x01(\x08R\x06finiteB`\xc2H]\n[\n\rdouble.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'\x125\n\x07example\x18\t \x03(\x01R\x07exampleB\x1b\xc2H\x18\n\x16\n\x0edouble.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xde\x14\n\nInt32Rules\x12\x84\x01\n\x05const\x18\x01 \x01(\x05R\x05constBn\xc2Hk\ni\n\x0bint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x88\x01\n\x02lt\x18\x02 \x01(\x05H\x00R\x02ltBv\xc2Hs\nq\n\x08int32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9a\x01\n\x03lte\x18\x03 \x01(\x05H\x00R\x03lteB\x85\x01\xc2H\x81\x01\n\x7f\n\tint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\xfd\x06\n\x02gt\x18\x04 \x01(\x05H\x01R\x02gtB\xea\x06\xc2H\xe6\x06\nt\n\x08int32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xad\x01\n\x0bint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb5\x01\n\x15int32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x0cint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc5\x01\n\x16int32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xca\x07\n\x03gte\x18\x05 \x01(\x05H\x01R\x03gteB\xb5\x07\xc2H\xb1\x07\n\x82\x01\n\tint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbc\x01\n\x0cint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc4\x01\n\x16int32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\rint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd4\x01\n\x17int32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12}\n\x02in\x18\x06 \x03(\x05R\x02inBm\xc2Hj\nh\n\x08int32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12w\n\x06not_in\x18\x07 \x03(\x05R\x05notInB`\xc2H]\n[\n\x0cint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x124\n\x07example\x18\x08 \x03(\x05R\x07exampleB\x1a\xc2H\x17\n\x15\n\rint32.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xde\x14\n\nInt64Rules\x12\x84\x01\n\x05const\x18\x01 \x01(\x03R\x05constBn\xc2Hk\ni\n\x0bint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x88\x01\n\x02lt\x18\x02 \x01(\x03H\x00R\x02ltBv\xc2Hs\nq\n\x08int64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9a\x01\n\x03lte\x18\x03 \x01(\x03H\x00R\x03lteB\x85\x01\xc2H\x81\x01\n\x7f\n\tint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\xfd\x06\n\x02gt\x18\x04 \x01(\x03H\x01R\x02gtB\xea\x06\xc2H\xe6\x06\nt\n\x08int64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xad\x01\n\x0bint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb5\x01\n\x15int64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x0cint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc5\x01\n\x16int64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xca\x07\n\x03gte\x18\x05 \x01(\x03H\x01R\x03gteB\xb5\x07\xc2H\xb1\x07\n\x82\x01\n\tint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbc\x01\n\x0cint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc4\x01\n\x16int64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\rint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd4\x01\n\x17int64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12}\n\x02in\x18\x06 \x03(\x03R\x02inBm\xc2Hj\nh\n\x08int64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12w\n\x06not_in\x18\x07 \x03(\x03R\x05notInB`\xc2H]\n[\n\x0cint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x124\n\x07example\x18\t \x03(\x03R\x07exampleB\x1a\xc2H\x17\n\x15\n\rint64.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xf0\x14\n\x0bUInt32Rules\x12\x85\x01\n\x05const\x18\x01 \x01(\rR\x05constBo\xc2Hl\nj\n\x0cuint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x89\x01\n\x02lt\x18\x02 \x01(\rH\x00R\x02ltBw\xc2Ht\nr\n\tuint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9c\x01\n\x03lte\x18\x03 \x01(\rH\x00R\x03lteB\x87\x01\xc2H\x83\x01\n\x80\x01\n\nuint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x82\x07\n\x02gt\x18\x04 \x01(\rH\x01R\x02gtB\xef\x06\xc2H\xeb\x06\nu\n\tuint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0cuint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16uint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\ruint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17uint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xcf\x07\n\x03gte\x18\x05 \x01(\rH\x01R\x03gteB\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nuint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\ruint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17uint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0euint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18uint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12~\n\x02in\x18\x06 \x03(\rR\x02inBn\xc2Hk\ni\n\tuint32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x07 \x03(\rR\x05notInBa\xc2H^\n\\\n\ruint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x125\n\x07example\x18\x08 \x03(\rR\x07exampleB\x1b\xc2H\x18\n\x16\n\x0euint32.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xf0\x14\n\x0bUInt64Rules\x12\x85\x01\n\x05const\x18\x01 \x01(\x04R\x05constBo\xc2Hl\nj\n\x0cuint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x89\x01\n\x02lt\x18\x02 \x01(\x04H\x00R\x02ltBw\xc2Ht\nr\n\tuint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x04H\x00R\x03lteB\x87\x01\xc2H\x83\x01\n\x80\x01\n\nuint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x82\x07\n\x02gt\x18\x04 \x01(\x04H\x01R\x02gtB\xef\x06\xc2H\xeb\x06\nu\n\tuint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0cuint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16uint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\ruint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17uint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x04H\x01R\x03gteB\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nuint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\ruint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17uint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0euint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18uint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12~\n\x02in\x18\x06 \x03(\x04R\x02inBn\xc2Hk\ni\n\tuint64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x07 \x03(\x04R\x05notInBa\xc2H^\n\\\n\ruint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x125\n\x07example\x18\x08 \x03(\x04R\x07exampleB\x1b\xc2H\x18\n\x16\n\x0euint64.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xf0\x14\n\x0bSInt32Rules\x12\x85\x01\n\x05const\x18\x01 \x01(\x11R\x05constBo\xc2Hl\nj\n\x0csint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x89\x01\n\x02lt\x18\x02 \x01(\x11H\x00R\x02ltBw\xc2Ht\nr\n\tsint32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x11H\x00R\x03lteB\x87\x01\xc2H\x83\x01\n\x80\x01\n\nsint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x82\x07\n\x02gt\x18\x04 \x01(\x11H\x01R\x02gtB\xef\x06\xc2H\xeb\x06\nu\n\tsint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0csint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16sint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\rsint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17sint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x11H\x01R\x03gteB\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nsint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\rsint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17sint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0esint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18sint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12~\n\x02in\x18\x06 \x03(\x11R\x02inBn\xc2Hk\ni\n\tsint32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x07 \x03(\x11R\x05notInBa\xc2H^\n\\\n\rsint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x125\n\x07example\x18\x08 \x03(\x11R\x07exampleB\x1b\xc2H\x18\n\x16\n\x0esint32.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xf0\x14\n\x0bSInt64Rules\x12\x85\x01\n\x05const\x18\x01 \x01(\x12R\x05constBo\xc2Hl\nj\n\x0csint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x89\x01\n\x02lt\x18\x02 \x01(\x12H\x00R\x02ltBw\xc2Ht\nr\n\tsint64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x12H\x00R\x03lteB\x87\x01\xc2H\x83\x01\n\x80\x01\n\nsint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x82\x07\n\x02gt\x18\x04 \x01(\x12H\x01R\x02gtB\xef\x06\xc2H\xeb\x06\nu\n\tsint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0csint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16sint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\rsint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17sint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x12H\x01R\x03gteB\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nsint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\rsint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17sint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0esint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18sint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12~\n\x02in\x18\x06 \x03(\x12R\x02inBn\xc2Hk\ni\n\tsint64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x07 \x03(\x12R\x05notInBa\xc2H^\n\\\n\rsint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x125\n\x07example\x18\x08 \x03(\x12R\x07exampleB\x1b\xc2H\x18\n\x16\n\x0esint64.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\x81\x15\n\x0cFixed32Rules\x12\x86\x01\n\x05const\x18\x01 \x01(\x07R\x05constBp\xc2Hm\nk\n\rfixed32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x8a\x01\n\x02lt\x18\x02 \x01(\x07H\x00R\x02ltBx\xc2Hu\ns\n\nfixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9d\x01\n\x03lte\x18\x03 \x01(\x07H\x00R\x03lteB\x88\x01\xc2H\x84\x01\n\x81\x01\n\x0bfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x87\x07\n\x02gt\x18\x04 \x01(\x07H\x01R\x02gtB\xf4\x06\xc2H\xf0\x06\nv\n\nfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xaf\x01\n\rfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb7\x01\n\x17fixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbf\x01\n\x0efixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc7\x01\n\x18fixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xd4\x07\n\x03gte\x18\x05 \x01(\x07H\x01R\x03gteB\xbf\x07\xc2H\xbb\x07\n\x84\x01\n\x0bfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbe\x01\n\x0efixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc6\x01\n\x18fixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xce\x01\n\x0ffixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd6\x01\n\x19fixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12\x7f\n\x02in\x18\x06 \x03(\x07R\x02inBo\xc2Hl\nj\n\nfixed32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12y\n\x06not_in\x18\x07 \x03(\x07R\x05notInBb\xc2H_\n]\n\x0efixed32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x126\n\x07example\x18\x08 \x03(\x07R\x07exampleB\x1c\xc2H\x19\n\x17\n\x0ffixed32.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\x81\x15\n\x0cFixed64Rules\x12\x86\x01\n\x05const\x18\x01 \x01(\x06R\x05constBp\xc2Hm\nk\n\rfixed64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x8a\x01\n\x02lt\x18\x02 \x01(\x06H\x00R\x02ltBx\xc2Hu\ns\n\nfixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9d\x01\n\x03lte\x18\x03 \x01(\x06H\x00R\x03lteB\x88\x01\xc2H\x84\x01\n\x81\x01\n\x0bfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x87\x07\n\x02gt\x18\x04 \x01(\x06H\x01R\x02gtB\xf4\x06\xc2H\xf0\x06\nv\n\nfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xaf\x01\n\rfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb7\x01\n\x17fixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbf\x01\n\x0efixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc7\x01\n\x18fixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xd4\x07\n\x03gte\x18\x05 \x01(\x06H\x01R\x03gteB\xbf\x07\xc2H\xbb\x07\n\x84\x01\n\x0bfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbe\x01\n\x0efixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc6\x01\n\x18fixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xce\x01\n\x0ffixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd6\x01\n\x19fixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12\x7f\n\x02in\x18\x06 \x03(\x06R\x02inBo\xc2Hl\nj\n\nfixed64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12y\n\x06not_in\x18\x07 \x03(\x06R\x05notInBb\xc2H_\n]\n\x0efixed64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x126\n\x07example\x18\x08 \x03(\x06R\x07exampleB\x1c\xc2H\x19\n\x17\n\x0ffixed64.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\x93\x15\n\rSFixed32Rules\x12\x87\x01\n\x05const\x18\x01 \x01(\x0fR\x05constBq\xc2Hn\nl\n\x0esfixed32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x8b\x01\n\x02lt\x18\x02 \x01(\x0fH\x00R\x02ltBy\xc2Hv\nt\n\x0bsfixed32.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9e\x01\n\x03lte\x18\x03 \x01(\x0fH\x00R\x03lteB\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0csfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x8c\x07\n\x02gt\x18\x04 \x01(\x0fH\x01R\x02gtB\xf9\x06\xc2H\xf5\x06\nw\n\x0bsfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0esfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18sfixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0fsfixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19sfixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xd9\x07\n\x03gte\x18\x05 \x01(\x0fH\x01R\x03gteB\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0csfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0fsfixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19sfixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10sfixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1asfixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12\x80\x01\n\x02in\x18\x06 \x03(\x0fR\x02inBp\xc2Hm\nk\n\x0bsfixed32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12z\n\x06not_in\x18\x07 \x03(\x0fR\x05notInBc\xc2H`\n^\n\x0fsfixed32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x127\n\x07example\x18\x08 \x03(\x0fR\x07exampleB\x1d\xc2H\x1a\n\x18\n\x10sfixed32.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\x93\x15\n\rSFixed64Rules\x12\x87\x01\n\x05const\x18\x01 \x01(\x10R\x05constBq\xc2Hn\nl\n\x0esfixed64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\x8b\x01\n\x02lt\x18\x02 \x01(\x10H\x00R\x02ltBy\xc2Hv\nt\n\x0bsfixed64.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\x9e\x01\n\x03lte\x18\x03 \x01(\x10H\x00R\x03lteB\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0csfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\x8c\x07\n\x02gt\x18\x04 \x01(\x10H\x01R\x02gtB\xf9\x06\xc2H\xf5\x06\nw\n\x0bsfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0esfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18sfixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0fsfixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19sfixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xd9\x07\n\x03gte\x18\x05 \x01(\x10H\x01R\x03gteB\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0csfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0fsfixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19sfixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10sfixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1asfixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12\x80\x01\n\x02in\x18\x06 \x03(\x10R\x02inBp\xc2Hm\nk\n\x0bsfixed64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12z\n\x06not_in\x18\x07 \x03(\x10R\x05notInBc\xc2H`\n^\n\x0fsfixed64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x127\n\x07example\x18\x08 \x03(\x10R\x07exampleB\x1d\xc2H\x1a\n\x18\n\x10sfixed64.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\xd1\x01\n\tBoolRules\x12\x83\x01\n\x05const\x18\x01 \x01(\x08R\x05constBm\xc2Hj\nh\n\nbool.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x123\n\x07example\x18\x02 \x03(\x08R\x07exampleB\x19\xc2H\x16\n\x14\n\x0cbool.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02"\xcf?\n\x0bStringRules\x12\x87\x01\n\x05const\x18\x01 \x01(\tR\x05constBq\xc2Hn\nl\n\x0cstring.const\x1a\\this != getField(rules, \'const\') ? \'must equal `%s`\'.format([getField(rules, \'const\')]) : \'\'\x12v\n\x03len\x18\x13 \x01(\x04R\x03lenBd\xc2Ha\n_\n\nstring.len\x1aQuint(this.size()) != rules.len ? \'must be %s characters\'.format([rules.len]) : \'\'\x12\x91\x01\n\x07min_len\x18\x02 \x01(\x04R\x06minLenBx\xc2Hu\ns\n\x0estring.min_len\x1aauint(this.size()) < rules.min_len ? \'must be at least %s characters\'.format([rules.min_len]) : \'\'\x12\x90\x01\n\x07max_len\x18\x03 \x01(\x04R\x06maxLenBw\xc2Ht\nr\n\x0estring.max_len\x1a`uint(this.size()) > rules.max_len ? \'must be at most %s characters\'.format([rules.max_len]) : \'\'\x12\x95\x01\n\tlen_bytes\x18\x14 \x01(\x04R\x08lenBytesBx\xc2Hu\ns\n\x10string.len_bytes\x1a_uint(bytes(this).size()) != rules.len_bytes ? \'must be %s bytes\'.format([rules.len_bytes]) : \'\'\x12\x9e\x01\n\tmin_bytes\x18\x04 \x01(\x04R\x08minBytesB\x80\x01\xc2H}\n{\n\x10string.min_bytes\x1aguint(bytes(this).size()) < rules.min_bytes ? \'must be at least %s bytes\'.format([rules.min_bytes]) : \'\'\x12\x9c\x01\n\tmax_bytes\x18\x05 \x01(\x04R\x08maxBytesB\x7f\xc2H|\nz\n\x10string.max_bytes\x1afuint(bytes(this).size()) > rules.max_bytes ? \'must be at most %s bytes\'.format([rules.max_bytes]) : \'\'\x12\x90\x01\n\x07pattern\x18\x06 \x01(\tR\x07patternBv\xc2Hs\nq\n\x0estring.pattern\x1a_!this.matches(rules.pattern) ? \'does not match regex pattern `%s`\'.format([rules.pattern]) : \'\'\x12\x86\x01\n\x06prefix\x18\x07 \x01(\tR\x06prefixBn\xc2Hk\ni\n\rstring.prefix\x1aX!this.startsWith(rules.prefix) ? \'does not have prefix `%s`\'.format([rules.prefix]) : \'\'\x12\x84\x01\n\x06suffix\x18\x08 \x01(\tR\x06suffixBl\xc2Hi\ng\n\rstring.suffix\x1aV!this.endsWith(rules.suffix) ? \'does not have suffix `%s`\'.format([rules.suffix]) : \'\'\x12\x94\x01\n\x08contains\x18\t \x01(\tR\x08containsBx\xc2Hu\ns\n\x0fstring.contains\x1a`!this.contains(rules.contains) ? \'does not contain substring `%s`\'.format([rules.contains]) : \'\'\x12\x9e\x01\n\x0cnot_contains\x18\x17 \x01(\tR\x0bnotContainsB{\xc2Hx\nv\n\x13string.not_contains\x1a_this.contains(rules.not_contains) ? \'contains substring `%s`\'.format([rules.not_contains]) : \'\'\x12~\n\x02in\x18\n \x03(\tR\x02inBn\xc2Hk\ni\n\tstring.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12x\n\x06not_in\x18\x0b \x03(\tR\x05notInBa\xc2H^\n\\\n\rstring.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x12\xe0\x01\n\x05email\x18\x0c \x01(\x08H\x00R\x05emailB\xc7\x01\xc2H\xc3\x01\n[\n\x0cstring.email\x12\x1dmust be a valid email address\x1a,!rules.email || this == \'\' || this.isEmail()\nd\n\x12string.email_empty\x122value is empty, which is not a valid email address\x1a\x1a!rules.email || this != \'\'\x12\xeb\x01\n\x08hostname\x18\r \x01(\x08H\x00R\x08hostnameB\xcc\x01\xc2H\xc8\x01\n_\n\x0fstring.hostname\x12\x18must be a valid hostname\x1a2!rules.hostname || this == \'\' || this.isHostname()\ne\n\x15string.hostname_empty\x12-value is empty, which is not a valid hostname\x1a\x1d!rules.hostname || this != \'\'\x12\xc5\x01\n\x02ip\x18\x0e \x01(\x08H\x00R\x02ipB\xb2\x01\xc2H\xae\x01\nO\n\tstring.ip\x12\x1amust be a valid IP address\x1a&!rules.ip || this == \'\' || this.isIp()\n[\n\x0fstring.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x17!rules.ip || this != \'\'\x12\xd6\x01\n\x04ipv4\x18\x0f \x01(\x08H\x00R\x04ipv4B\xbf\x01\xc2H\xbb\x01\nV\n\x0bstring.ipv4\x12\x1cmust be a valid IPv4 address\x1a)!rules.ipv4 || this == \'\' || this.isIp(4)\na\n\x11string.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x19!rules.ipv4 || this != \'\'\x12\xd6\x01\n\x04ipv6\x18\x10 \x01(\x08H\x00R\x04ipv6B\xbf\x01\xc2H\xbb\x01\nV\n\x0bstring.ipv6\x12\x1cmust be a valid IPv6 address\x1a)!rules.ipv6 || this == \'\' || this.isIp(6)\na\n\x11string.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x19!rules.ipv6 || this != \'\'\x12\xbe\x01\n\x03uri\x18\x11 \x01(\x08H\x00R\x03uriB\xa9\x01\xc2H\xa5\x01\nK\n\nstring.uri\x12\x13must be a valid URI\x1a(!rules.uri || this == \'\' || this.isUri()\nV\n\x10string.uri_empty\x12(value is empty, which is not a valid URI\x1a\x18!rules.uri || this != \'\'\x12r\n\x07uri_ref\x18\x12 \x01(\x08H\x00R\x06uriRefBW\xc2HT\nR\n\x0estring.uri_ref\x12\x1dmust be a valid URI Reference\x1a!!rules.uri_ref || this.isUriRef()\x12\x92\x02\n\x07address\x18\x15 \x01(\x08H\x00R\x07addressB\xf5\x01\xc2H\xf1\x01\n{\n\x0estring.address\x12\'must be a valid hostname, or ip address\x1a@!rules.address || this == \'\' || this.isHostname() || this.isIp()\nr\n\x14string.address_empty\x12!rules.ipv4_with_prefixlen || this == \'\' || this.isIpPrefix(4)\n\x92\x01\n string.ipv4_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv4 address with prefix length\x1a(!rules.ipv4_with_prefixlen || this != \'\'\x12\xdc\x02\n\x13ipv6_with_prefixlen\x18\x1c \x01(\x08H\x00R\x11ipv6WithPrefixlenB\xa9\x02\xc2H\xa5\x02\n\x8d\x01\n\x1astring.ipv6_with_prefixlen\x12/must be a valid IPv6 address with prefix length\x1a>!rules.ipv6_with_prefixlen || this == \'\' || this.isIpPrefix(6)\n\x92\x01\n string.ipv6_with_prefixlen_empty\x12Dvalue is empty, which is not a valid IPv6 address with prefix length\x1a(!rules.ipv6_with_prefixlen || this != \'\'\x12\xf6\x01\n\tip_prefix\x18\x1d \x01(\x08H\x00R\x08ipPrefixB\xd6\x01\xc2H\xd2\x01\nf\n\x10string.ip_prefix\x12\x19must be a valid IP prefix\x1a7!rules.ip_prefix || this == \'\' || this.isIpPrefix(true)\nh\n\x16string.ip_prefix_empty\x12.value is empty, which is not a valid IP prefix\x1a\x1e!rules.ip_prefix || this != \'\'\x12\x89\x02\n\x0bipv4_prefix\x18\x1e \x01(\x08H\x00R\nipv4PrefixB\xe5\x01\xc2H\xe1\x01\no\n\x12string.ipv4_prefix\x12\x1bmust be a valid IPv4 prefix\x1a!rules.host_and_port || this == \'\' || this.isHostAndPort(true)\ny\n\x1astring.host_and_port_empty\x127value is empty, which is not a valid host and port pair\x1a"!rules.host_and_port || this != \'\'\x12\xf4\x01\n\x04ulid\x18# \x01(\x08H\x00R\x04ulidB\xdd\x01\xc2H\xd9\x01\n|\n\x0bstring.ulid\x12\x14must be a valid ULID\x1aW!rules.ulid || this == \'\' || this.matches(\'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$\')\nY\n\x11string.ulid_empty\x12)value is empty, which is not a valid ULID\x1a\x19!rules.ulid || this != \'\'\x12\xe1\x02\n\x0cprotobuf_fqn\x18% \x01(\x08H\x00R\x0bprotobufFqnB\xbb\x02\xc2H\xb7\x02\n\xaf\x01\n\x13string.protobuf_fqn\x12-must be a valid fully-qualified Protobuf name\x1ai!rules.protobuf_fqn || this == \'\' || this.matches(\'^[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\x82\x01\n\x19string.protobuf_fqn_empty\x12Bvalue is empty, which is not a valid fully-qualified Protobuf name\x1a!!rules.protobuf_fqn || this != \'\'\x12\xa1\x03\n\x10protobuf_dot_fqn\x18& \x01(\x08H\x00R\x0eprotobufDotFqnB\xf4\x02\xc2H\xf0\x02\n\xcd\x01\n\x17string.protobuf_dot_fqn\x12@must be a valid fully-qualified Protobuf name with a leading dot\x1ap!rules.protobuf_dot_fqn || this == \'\' || this.matches(\'^\\\\.[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\x9d\x01\n\x1dstring.protobuf_dot_fqn_empty\x12Uvalue is empty, which is not a valid fully-qualified Protobuf name with a leading dot\x1a%!rules.protobuf_dot_fqn || this != \'\'\x12\xac\x05\n\x10well_known_regex\x18\x18 \x01(\x0e2\x18.buf.validate.KnownRegexH\x00R\x0ewellKnownRegexB\xe5\x04\xc2H\xe1\x04\n\xea\x01\n#string.well_known_regex.header_name\x12 must be a valid HTTP header name\x1a\xa0\x01rules.well_known_regex != 1 || this == \'\' || this.matches(!has(rules.strict) || rules.strict ?\'^:?[0-9a-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[^\\u0000\\u000A\\u000D]+$\')\n\x8d\x01\n)string.well_known_regex.header_name_empty\x125value is empty, which is not a valid HTTP header name\x1a)rules.well_known_regex != 1 || this != \'\'\n\xe1\x01\n$string.well_known_regex.header_value\x12!must be a valid HTTP header value\x1a\x95\x01rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$\' :\'^[^\\u0000\\u000A\\u000D]*$\')\x12\x16\n\x06strict\x18\x19 \x01(\x08R\x06strict\x125\n\x07example\x18" \x03(\tR\x07exampleB\x1b\xc2H\x18\n\x16\n\x0estring.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0c\n\nwell_known"\xca\x12\n\nBytesRules\x12\x81\x01\n\x05const\x18\x01 \x01(\x0cR\x05constBk\xc2Hh\nf\n\x0bbytes.const\x1aWthis != getField(rules, \'const\') ? \'must be %x\'.format([getField(rules, \'const\')]) : \'\'\x12p\n\x03len\x18\r \x01(\x04R\x03lenB^\xc2H[\nY\n\tbytes.len\x1aLuint(this.size()) != rules.len ? \'must be %s bytes\'.format([rules.len]) : \'\'\x12\x8b\x01\n\x07min_len\x18\x02 \x01(\x04R\x06minLenBr\xc2Ho\nm\n\rbytes.min_len\x1a\\uint(this.size()) < rules.min_len ? \'must be at least %s bytes\'.format([rules.min_len]) : \'\'\x12\x8a\x01\n\x07max_len\x18\x03 \x01(\x04R\x06maxLenBq\xc2Hn\nl\n\rbytes.max_len\x1a[uint(this.size()) > rules.max_len ? \'must be at most %s bytes\'.format([rules.max_len]) : \'\'\x12\x93\x01\n\x07pattern\x18\x04 \x01(\tR\x07patternBy\xc2Hv\nt\n\rbytes.pattern\x1ac!string(this).matches(rules.pattern) ? \'must match regex pattern `%s`\'.format([rules.pattern]) : \'\'\x12\x83\x01\n\x06prefix\x18\x05 \x01(\x0cR\x06prefixBk\xc2Hh\nf\n\x0cbytes.prefix\x1aV!this.startsWith(rules.prefix) ? \'does not have prefix %x\'.format([rules.prefix]) : \'\'\x12\x81\x01\n\x06suffix\x18\x06 \x01(\x0cR\x06suffixBi\xc2Hf\nd\n\x0cbytes.suffix\x1aT!this.endsWith(rules.suffix) ? \'does not have suffix %x\'.format([rules.suffix]) : \'\'\x12\x87\x01\n\x08contains\x18\x07 \x01(\x0cR\x08containsBk\xc2Hh\nf\n\x0ebytes.contains\x1aT!this.contains(rules.contains) ? \'does not contain %x\'.format([rules.contains]) : \'\'\x12\xa5\x01\n\x02in\x18\x08 \x03(\x0cR\x02inB\x94\x01\xc2H\x90\x01\n\x8d\x01\n\x08bytes.in\x1a\x80\x01getField(rules, \'in\').size() > 0 && !(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12w\n\x06not_in\x18\t \x03(\x0cR\x05notInB`\xc2H]\n[\n\x0cbytes.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x12\xe9\x01\n\x02ip\x18\n \x01(\x08H\x00R\x02ipB\xd6\x01\xc2H\xd2\x01\nn\n\x08bytes.ip\x12\x1amust be a valid IP address\x1aF!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n`\n\x0ebytes.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x1d!rules.ip || this.size() != 0\x12\xe4\x01\n\x04ipv4\x18\x0b \x01(\x08H\x00R\x04ipv4B\xcd\x01\xc2H\xc9\x01\n_\n\nbytes.ipv4\x12\x1cmust be a valid IPv4 address\x1a3!rules.ipv4 || this.size() == 0 || this.size() == 4\nf\n\x10bytes.ipv4_empty\x121value is empty, which is not a valid IPv4 address\x1a\x1f!rules.ipv4 || this.size() != 0\x12\xe5\x01\n\x04ipv6\x18\x0c \x01(\x08H\x00R\x04ipv6B\xce\x01\xc2H\xca\x01\n`\n\nbytes.ipv6\x12\x1cmust be a valid IPv6 address\x1a4!rules.ipv6 || this.size() == 0 || this.size() == 16\nf\n\x10bytes.ipv6_empty\x121value is empty, which is not a valid IPv6 address\x1a\x1f!rules.ipv6 || this.size() != 0\x12\xd5\x01\n\x04uuid\x18\x0f \x01(\x08H\x00R\x04uuidB\xbe\x01\xc2H\xba\x01\nX\n\nbytes.uuid\x12\x14must be a valid UUID\x1a4!rules.uuid || this.size() == 0 || this.size() == 16\n^\n\x10bytes.uuid_empty\x12)value is empty, which is not a valid UUID\x1a\x1f!rules.uuid || this.size() != 0\x124\n\x07example\x18\x0e \x03(\x0cR\x07exampleB\x1a\xc2H\x17\n\x15\n\rbytes.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0c\n\nwell_known"\xea\x03\n\tEnumRules\x12\x83\x01\n\x05const\x18\x01 \x01(\x05R\x05constBm\xc2Hj\nh\n\nenum.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12!\n\x0cdefined_only\x18\x02 \x01(\x08R\x0bdefinedOnly\x12|\n\x02in\x18\x03 \x03(\x05R\x02inBl\xc2Hi\ng\n\x07enum.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12v\n\x06not_in\x18\x04 \x03(\x05R\x05notInB_\xc2H\\\nZ\n\x0benum.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x123\n\x07example\x18\x05 \x03(\x05R\x07exampleB\x19\xc2H\x16\n\x14\n\x0cenum.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02"\x90\x04\n\rRepeatedRules\x12\xa0\x01\n\tmin_items\x18\x01 \x01(\x04R\x08minItemsB\x82\x01\xc2H\x7f\n}\n\x12repeated.min_items\x1aguint(this.size()) < rules.min_items ? \'must contain at least %d item(s)\'.format([rules.min_items]) : \'\'\x12\xa6\x01\n\tmax_items\x18\x02 \x01(\x04R\x08maxItemsB\x88\x01\xc2H\x84\x01\n\x81\x01\n\x12repeated.max_items\x1akuint(this.size()) > rules.max_items ? \'must contain no more than %s item(s)\'.format([rules.max_items]) : \'\'\x12x\n\x06unique\x18\x03 \x01(\x08R\x06uniqueB`\xc2H]\n[\n\x0frepeated.unique\x12(repeated value must contain unique items\x1a\x1e!rules.unique || this.unique()\x12.\n\x05items\x18\x04 \x01(\x0b2\x18.buf.validate.FieldRulesR\x05items*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02"\xac\x03\n\x08MapRules\x12\x99\x01\n\tmin_pairs\x18\x01 \x01(\x04R\x08minPairsB|\xc2Hy\nw\n\rmap.min_pairs\x1afuint(this.size()) < rules.min_pairs ? \'map must be at least %d entries\'.format([rules.min_pairs]) : \'\'\x12\x98\x01\n\tmax_pairs\x18\x02 \x01(\x04R\x08maxPairsB{\xc2Hx\nv\n\rmap.max_pairs\x1aeuint(this.size()) > rules.max_pairs ? \'map must be at most %d entries\'.format([rules.max_pairs]) : \'\'\x12,\n\x04keys\x18\x04 \x01(\x0b2\x18.buf.validate.FieldRulesR\x04keys\x120\n\x06values\x18\x05 \x01(\x0b2\x18.buf.validate.FieldRulesR\x06values*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02"1\n\x08AnyRules\x12\x0e\n\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x03 \x03(\tR\x05notIn"\xec\x16\n\rDurationRules\x12\xa2\x01\n\x05const\x18\x02 \x01(\x0b2\x19.google.protobuf.DurationR\x05constBq\xc2Hn\nl\n\x0eduration.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\xa6\x01\n\x02lt\x18\x03 \x01(\x0b2\x19.google.protobuf.DurationH\x00R\x02ltBy\xc2Hv\nt\n\x0bduration.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\xb9\x01\n\x03lte\x18\x04 \x01(\x0b2\x19.google.protobuf.DurationH\x00R\x03lteB\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0cduration.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12\xa7\x07\n\x02gt\x18\x05 \x01(\x0b2\x19.google.protobuf.DurationH\x01R\x02gtB\xf9\x06\xc2H\xf5\x06\nw\n\x0bduration.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0eduration.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18duration.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0fduration.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19duration.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xf4\x07\n\x03gte\x18\x06 \x01(\x0b2\x19.google.protobuf.DurationH\x01R\x03gteB\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0cduration.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0fduration.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19duration.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10duration.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1aduration.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12\x9b\x01\n\x02in\x18\x07 \x03(\x0b2\x19.google.protobuf.DurationR\x02inBp\xc2Hm\nk\n\x0bduration.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'\x12\x95\x01\n\x06not_in\x18\x08 \x03(\x0b2\x19.google.protobuf.DurationR\x05notInBc\xc2H`\n^\n\x0fduration.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'\x12R\n\x07example\x18\t \x03(\x0b2\x19.google.protobuf.DurationR\x07exampleB\x1d\xc2H\x1a\n\x18\n\x10duration.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"\x86\x06\n\x0eFieldMaskRules\x12\xc0\x01\n\x05const\x18\x01 \x01(\x0b2\x1a.google.protobuf.FieldMaskR\x05constB\x8d\x01\xc2H\x89\x01\n\x86\x01\n\x10field_mask.const\x1arthis.paths != getField(rules, \'const\').paths ? \'must equal paths %s\'.format([getField(rules, \'const\').paths]) : \'\'\x12\xd7\x01\n\x02in\x18\x02 \x03(\tR\x02inB\xc6\x01\xc2H\xc2\x01\n\xbf\x01\n\rfield_mask.in\x1a\xad\x01!this.paths.all(p, p in getField(rules, \'in\') || getField(rules, \'in\').exists(f, p.startsWith(f+\'.\'))) ? \'must only contain paths in %s\'.format([getField(rules, \'in\')]) : \'\'\x12\xf4\x01\n\x06not_in\x18\x03 \x03(\tR\x05notInB\xdc\x01\xc2H\xd8\x01\n\xd5\x01\n\x11field_mask.not_in\x1a\xbf\x01!this.paths.all(p, !(p in getField(rules, \'not_in\') || getField(rules, \'not_in\').exists(f, p.startsWith(f+\'.\')))) ? \'must not contain any paths in %s\'.format([getField(rules, \'not_in\')]) : \'\'\x12U\n\x07example\x18\x04 \x03(\x0b2\x1a.google.protobuf.FieldMaskR\x07exampleB\x1f\xc2H\x1c\n\x1a\n\x12field_mask.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02"\xe8\x17\n\x0eTimestampRules\x12\xa4\x01\n\x05const\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampR\x05constBr\xc2Ho\nm\n\x0ftimestamp.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'\x12\xa8\x01\n\x02lt\x18\x03 \x01(\x0b2\x1a.google.protobuf.TimestampH\x00R\x02ltBz\xc2Hw\nu\n\x0ctimestamp.lt\x1ae!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'\x12\xbb\x01\n\x03lte\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampH\x00R\x03lteB\x8a\x01\xc2H\x86\x01\n\x83\x01\n\rtimestamp.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'\x12m\n\x06lt_now\x18\x07 \x01(\x08H\x00R\x05ltNowBT\xc2HQ\nO\n\x10timestamp.lt_now\x1a;(rules.lt_now && this > now) ? \'must be less than now\' : \'\'\x12\xad\x07\n\x02gt\x18\x05 \x01(\x0b2\x1a.google.protobuf.TimestampH\x01R\x02gtB\xfe\x06\xc2H\xfa\x06\nx\n\x0ctimestamp.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb1\x01\n\x0ftimestamp.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb9\x01\n\x19timestamp.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc1\x01\n\x10timestamp.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc9\x01\n\x1atimestamp.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\x12\xfa\x07\n\x03gte\x18\x06 \x01(\x0b2\x1a.google.protobuf.TimestampH\x01R\x03gteB\xc9\x07\xc2H\xc5\x07\n\x86\x01\n\rtimestamp.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc0\x01\n\x10timestamp.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc8\x01\n\x1atimestamp.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd0\x01\n\x11timestamp.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd8\x01\n\x1btimestamp.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\x12p\n\x06gt_now\x18\x08 \x01(\x08H\x01R\x05gtNowBW\xc2HT\nR\n\x10timestamp.gt_now\x1a>(rules.gt_now && this < now) ? \'must be greater than now\' : \'\'\x12\xb9\x01\n\x06within\x18\t \x01(\x0b2\x19.google.protobuf.DurationR\x06withinB\x85\x01\xc2H\x81\x01\n\x7f\n\x10timestamp.within\x1akthis < now-rules.within || this > now+rules.within ? \'must be within %s of now\'.format([rules.within]) : \'\'\x12T\n\x07example\x18\n \x03(\x0b2\x1a.google.protobuf.TimestampR\x07exampleB\x1e\xc2H\x1b\n\x19\n\x11timestamp.example\x1a\x04true*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02B\x0b\n\tless_thanB\x0e\n\x0cgreater_than"E\n\nViolations\x127\n\nviolations\x18\x01 \x03(\x0b2\x17.buf.validate.ViolationR\nviolations"\xc5\x01\n\tViolation\x12-\n\x05field\x18\x05 \x01(\x0b2\x17.buf.validate.FieldPathR\x05field\x12+\n\x04rule\x18\x06 \x01(\x0b2\x17.buf.validate.FieldPathR\x04rule\x12\x17\n\x07rule_id\x18\x02 \x01(\tR\x06ruleId\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12\x17\n\x07for_key\x18\x04 \x01(\x08R\x06forKeyJ\x04\x08\x01\x10\x02R\nfield_path"G\n\tFieldPath\x12:\n\x08elements\x18\x01 \x03(\x0b2\x1e.buf.validate.FieldPathElementR\x08elements"\xcc\x03\n\x10FieldPathElement\x12!\n\x0cfield_number\x18\x01 \x01(\x05R\x0bfieldNumber\x12\x1d\n\nfield_name\x18\x02 \x01(\tR\tfieldName\x12I\n\nfield_type\x18\x03 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tfieldType\x12E\n\x08key_type\x18\x04 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\x07keyType\x12I\n\nvalue_type\x18\x05 \x01(\x0e2*.google.protobuf.FieldDescriptorProto.TypeR\tvalueType\x12\x16\n\x05index\x18\x06 \x01(\x04H\x00R\x05index\x12\x1b\n\x08bool_key\x18\x07 \x01(\x08H\x00R\x07boolKey\x12\x19\n\x07int_key\x18\x08 \x01(\x03H\x00R\x06intKey\x12\x1b\n\x08uint_key\x18\t \x01(\x04H\x00R\x07uintKey\x12\x1f\n\nstring_key\x18\n \x01(\tH\x00R\tstringKeyB\x0b\n\tsubscript*\xa1\x01\n\x06Ignore\x12\x16\n\x12IGNORE_UNSPECIFIED\x10\x00\x12\x18\n\x14IGNORE_IF_ZERO_VALUE\x10\x01\x12\x11\n\rIGNORE_ALWAYS\x10\x03"\x04\x08\x02\x10\x02*\x0cIGNORE_EMPTY*\x0eIGNORE_DEFAULT*\x17IGNORE_IF_DEFAULT_VALUE*\x15IGNORE_IF_UNPOPULATED*n\n\nKnownRegex\x12\x1b\n\x17KNOWN_REGEX_UNSPECIFIED\x10\x00\x12 \n\x1cKNOWN_REGEX_HTTP_HEADER_NAME\x10\x01\x12!\n\x1dKNOWN_REGEX_HTTP_HEADER_VALUE\x10\x02:V\n\x07message\x18\x87\t \x01(\x0b2\x1a.buf.validate.MessageRules\x12\x1f.google.protobuf.MessageOptionsR\x07message:N\n\x05oneof\x18\x87\t \x01(\x0b2\x18.buf.validate.OneofRules\x12\x1d.google.protobuf.OneofOptionsR\x05oneof:N\n\x05field\x18\x87\t \x01(\x0b2\x18.buf.validate.FieldRules\x12\x1d.google.protobuf.FieldOptionsR\x05field:]\n\npredefined\x18\x88\t \x01(\x0b2\x1d.buf.validate.PredefinedRules\x12\x1d.google.protobuf.FieldOptionsR\npredefinedB\xbb\x01\n\x10com.buf.validateB\rValidateProtoP\x01ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\xa2\x02\x03BVX\xaa\x02\x0cBuf.Validate\xca\x02\x0cBuf\\Validate\xe2\x02\x18Buf\\Validate\\GPBMetadata\xea\x02\rBuf::Validate', + [ + descriptor_pb.desc(), + duration_pb.desc(), + field_mask_pb.desc(), + timestamp_pb.desc(), + ], + { + "Rule": Rule, + "MessageRules": MessageRules, + "MessageOneofRule": MessageOneofRule, + "OneofRules": OneofRules, + "FieldRules": FieldRules, + "PredefinedRules": PredefinedRules, + "FloatRules": FloatRules, + "DoubleRules": DoubleRules, + "Int32Rules": Int32Rules, + "Int64Rules": Int64Rules, + "UInt32Rules": UInt32Rules, + "UInt64Rules": UInt64Rules, + "SInt32Rules": SInt32Rules, + "SInt64Rules": SInt64Rules, + "Fixed32Rules": Fixed32Rules, + "Fixed64Rules": Fixed64Rules, + "SFixed32Rules": SFixed32Rules, + "SFixed64Rules": SFixed64Rules, + "BoolRules": BoolRules, + "StringRules": StringRules, + "BytesRules": BytesRules, + "EnumRules": EnumRules, + "RepeatedRules": RepeatedRules, + "MapRules": MapRules, + "AnyRules": AnyRules, + "DurationRules": DurationRules, + "FieldMaskRules": FieldMaskRules, + "TimestampRules": TimestampRules, + "Violations": Violations, + "Violation": Violation, + "FieldPath": FieldPath, + "FieldPathElement": FieldPathElement, + "Ignore": Ignore, + "KnownRegex": KnownRegex, + "message": ext_message, + "oneof": ext_oneof, + "field": ext_field, + "predefined": ext_predefined, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `buf/validate/validate.proto`.""" + return _DESC diff --git a/python/buf/validate/validate_pb2.py b/python/buf/validate/validate_pb2.py deleted file mode 100644 index fd490a5a..00000000 --- a/python/buf/validate/validate_pb2.py +++ /dev/null @@ -1,469 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: buf/validate/validate.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'buf/validate/validate.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1b\x62uf/validate/validate.proto\x12\x0c\x62uf.validate\x1a google/protobuf/descriptor.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"P\n\x04Rule\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\x12\x1e\n\nexpression\x18\x03 \x01(\tR\nexpression\"\xa1\x01\n\x0cMessageRules\x12%\n\x0e\x63\x65l_expression\x18\x05 \x03(\tR\rcelExpression\x12$\n\x03\x63\x65l\x18\x03 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65l\x12\x34\n\x05oneof\x18\x04 \x03(\x0b\x32\x1e.buf.validate.MessageOneofRuleR\x05oneofJ\x04\x08\x01\x10\x02R\x08\x64isabled\"F\n\x10MessageOneofRule\x12\x16\n\x06\x66ields\x18\x01 \x03(\tR\x06\x66ields\x12\x1a\n\x08required\x18\x02 \x01(\x08R\x08required\"(\n\nOneofRules\x12\x1a\n\x08required\x18\x01 \x01(\x08R\x08required\"\xe3\n\n\nFieldRules\x12%\n\x0e\x63\x65l_expression\x18\x1d \x03(\tR\rcelExpression\x12$\n\x03\x63\x65l\x18\x17 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65l\x12\x1a\n\x08required\x18\x19 \x01(\x08R\x08required\x12,\n\x06ignore\x18\x1b \x01(\x0e\x32\x14.buf.validate.IgnoreR\x06ignore\x12\x30\n\x05\x66loat\x18\x01 \x01(\x0b\x32\x18.buf.validate.FloatRulesH\x00R\x05\x66loat\x12\x33\n\x06\x64ouble\x18\x02 \x01(\x0b\x32\x19.buf.validate.DoubleRulesH\x00R\x06\x64ouble\x12\x30\n\x05int32\x18\x03 \x01(\x0b\x32\x18.buf.validate.Int32RulesH\x00R\x05int32\x12\x30\n\x05int64\x18\x04 \x01(\x0b\x32\x18.buf.validate.Int64RulesH\x00R\x05int64\x12\x33\n\x06uint32\x18\x05 \x01(\x0b\x32\x19.buf.validate.UInt32RulesH\x00R\x06uint32\x12\x33\n\x06uint64\x18\x06 \x01(\x0b\x32\x19.buf.validate.UInt64RulesH\x00R\x06uint64\x12\x33\n\x06sint32\x18\x07 \x01(\x0b\x32\x19.buf.validate.SInt32RulesH\x00R\x06sint32\x12\x33\n\x06sint64\x18\x08 \x01(\x0b\x32\x19.buf.validate.SInt64RulesH\x00R\x06sint64\x12\x36\n\x07\x66ixed32\x18\t \x01(\x0b\x32\x1a.buf.validate.Fixed32RulesH\x00R\x07\x66ixed32\x12\x36\n\x07\x66ixed64\x18\n \x01(\x0b\x32\x1a.buf.validate.Fixed64RulesH\x00R\x07\x66ixed64\x12\x39\n\x08sfixed32\x18\x0b \x01(\x0b\x32\x1b.buf.validate.SFixed32RulesH\x00R\x08sfixed32\x12\x39\n\x08sfixed64\x18\x0c \x01(\x0b\x32\x1b.buf.validate.SFixed64RulesH\x00R\x08sfixed64\x12-\n\x04\x62ool\x18\r \x01(\x0b\x32\x17.buf.validate.BoolRulesH\x00R\x04\x62ool\x12\x33\n\x06string\x18\x0e \x01(\x0b\x32\x19.buf.validate.StringRulesH\x00R\x06string\x12\x30\n\x05\x62ytes\x18\x0f \x01(\x0b\x32\x18.buf.validate.BytesRulesH\x00R\x05\x62ytes\x12-\n\x04\x65num\x18\x10 \x01(\x0b\x32\x17.buf.validate.EnumRulesH\x00R\x04\x65num\x12\x39\n\x08repeated\x18\x12 \x01(\x0b\x32\x1b.buf.validate.RepeatedRulesH\x00R\x08repeated\x12*\n\x03map\x18\x13 \x01(\x0b\x32\x16.buf.validate.MapRulesH\x00R\x03map\x12*\n\x03\x61ny\x18\x14 \x01(\x0b\x32\x16.buf.validate.AnyRulesH\x00R\x03\x61ny\x12\x39\n\x08\x64uration\x18\x15 \x01(\x0b\x32\x1b.buf.validate.DurationRulesH\x00R\x08\x64uration\x12=\n\nfield_mask\x18\x1c \x01(\x0b\x32\x1c.buf.validate.FieldMaskRulesH\x00R\tfieldMask\x12<\n\ttimestamp\x18\x16 \x01(\x0b\x32\x1c.buf.validate.TimestampRulesH\x00R\ttimestampB\x06\n\x04typeJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty\"Z\n\x0fPredefinedRules\x12$\n\x03\x63\x65l\x18\x01 \x03(\x0b\x32\x12.buf.validate.RuleR\x03\x63\x65lJ\x04\x08\x18\x10\x19J\x04\x08\x1a\x10\x1bR\x07skippedR\x0cignore_empty\"\xae\x17\n\nFloatRules\x12\x84\x01\n\x05\x63onst\x18\x01 \x01(\x02\x42n\xc2Hk\ni\n\x0b\x66loat.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x9d\x01\n\x02lt\x18\x02 \x01(\x02\x42\x8a\x01\xc2H\x86\x01\n\x83\x01\n\x08\x66loat.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xae\x01\n\x03lte\x18\x03 \x01(\x02\x42\x99\x01\xc2H\x95\x01\n\x92\x01\n\tfloat.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xd4\x07\n\x02gt\x18\x04 \x01(\x02\x42\xc1\x07\xc2H\xbd\x07\n\x86\x01\n\x08\x66loat.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xbd\x01\n\x0b\x66loat.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc7\x01\n\x15\x66loat.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xcd\x01\n\x0c\x66loat.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xd7\x01\n\x16\x66loat.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xa1\x08\n\x03gte\x18\x05 \x01(\x02\x42\x8c\x08\xc2H\x88\x08\n\x95\x01\n\tfloat.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xcc\x01\n\x0c\x66loat.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd6\x01\n\x16\x66loat.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdc\x01\n\rfloat.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xe6\x01\n\x17\x66loat.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12}\n\x02in\x18\x06 \x03(\x02\x42m\xc2Hj\nh\n\x08\x66loat.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12w\n\x06not_in\x18\x07 \x03(\x02\x42`\xc2H]\n[\n\x0c\x66loat.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12w\n\x06\x66inite\x18\x08 \x01(\x08\x42_\xc2H\\\nZ\n\x0c\x66loat.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'R\x06\x66inite\x12\x34\n\x07\x65xample\x18\t \x03(\x02\x42\x1a\xc2H\x17\n\x15\n\rfloat.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xc0\x17\n\x0b\x44oubleRules\x12\x85\x01\n\x05\x63onst\x18\x01 \x01(\x01\x42o\xc2Hl\nj\n\x0c\x64ouble.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x9e\x01\n\x02lt\x18\x02 \x01(\x01\x42\x8b\x01\xc2H\x87\x01\n\x84\x01\n\tdouble.lt\x1aw!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xaf\x01\n\x03lte\x18\x03 \x01(\x01\x42\x9a\x01\xc2H\x96\x01\n\x93\x01\n\ndouble.lte\x1a\x84\x01!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xd9\x07\n\x02gt\x18\x04 \x01(\x01\x42\xc6\x07\xc2H\xc2\x07\n\x87\x01\n\tdouble.gt\x1az!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xbe\x01\n\x0c\x64ouble.gt_lt\x1a\xad\x01has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc8\x01\n\x16\x64ouble.gt_lt_exclusive\x1a\xad\x01has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xce\x01\n\rdouble.gt_lte\x1a\xbc\x01has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xd8\x01\n\x17\x64ouble.gt_lte_exclusive\x1a\xbc\x01has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xa6\x08\n\x03gte\x18\x05 \x01(\x01\x42\x91\x08\xc2H\x8d\x08\n\x96\x01\n\ndouble.gte\x1a\x87\x01!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xcd\x01\n\rdouble.gte_lt\x1a\xbb\x01has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd7\x01\n\x17\x64ouble.gte_lt_exclusive\x1a\xbb\x01has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xdd\x01\n\x0e\x64ouble.gte_lte\x1a\xca\x01has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xe7\x01\n\x18\x64ouble.gte_lte_exclusive\x1a\xca\x01has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12~\n\x02in\x18\x06 \x03(\x01\x42n\xc2Hk\ni\n\tdouble.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x07 \x03(\x01\x42\x61\xc2H^\n\\\n\rdouble.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12x\n\x06\x66inite\x18\x08 \x01(\x08\x42`\xc2H]\n[\n\rdouble.finite\x1aJrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'R\x06\x66inite\x12\x35\n\x07\x65xample\x18\t \x03(\x01\x42\x1b\xc2H\x18\n\x16\n\x0e\x64ouble.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xde\x14\n\nInt32Rules\x12\x84\x01\n\x05\x63onst\x18\x01 \x01(\x05\x42n\xc2Hk\ni\n\x0bint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x88\x01\n\x02lt\x18\x02 \x01(\x05\x42v\xc2Hs\nq\n\x08int32.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9a\x01\n\x03lte\x18\x03 \x01(\x05\x42\x85\x01\xc2H\x81\x01\n\x7f\n\tint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xfd\x06\n\x02gt\x18\x04 \x01(\x05\x42\xea\x06\xc2H\xe6\x06\nt\n\x08int32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xad\x01\n\x0bint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb5\x01\n\x15int32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x0cint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc5\x01\n\x16int32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xca\x07\n\x03gte\x18\x05 \x01(\x05\x42\xb5\x07\xc2H\xb1\x07\n\x82\x01\n\tint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbc\x01\n\x0cint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc4\x01\n\x16int32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\rint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd4\x01\n\x17int32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12}\n\x02in\x18\x06 \x03(\x05\x42m\xc2Hj\nh\n\x08int32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12w\n\x06not_in\x18\x07 \x03(\x05\x42`\xc2H]\n[\n\x0cint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x34\n\x07\x65xample\x18\x08 \x03(\x05\x42\x1a\xc2H\x17\n\x15\n\rint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xde\x14\n\nInt64Rules\x12\x84\x01\n\x05\x63onst\x18\x01 \x01(\x03\x42n\xc2Hk\ni\n\x0bint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x88\x01\n\x02lt\x18\x02 \x01(\x03\x42v\xc2Hs\nq\n\x08int64.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9a\x01\n\x03lte\x18\x03 \x01(\x03\x42\x85\x01\xc2H\x81\x01\n\x7f\n\tint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xfd\x06\n\x02gt\x18\x04 \x01(\x03\x42\xea\x06\xc2H\xe6\x06\nt\n\x08int64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xad\x01\n\x0bint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb5\x01\n\x15int64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbd\x01\n\x0cint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc5\x01\n\x16int64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xca\x07\n\x03gte\x18\x05 \x01(\x03\x42\xb5\x07\xc2H\xb1\x07\n\x82\x01\n\tint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbc\x01\n\x0cint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc4\x01\n\x16int64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcc\x01\n\rint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd4\x01\n\x17int64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12}\n\x02in\x18\x06 \x03(\x03\x42m\xc2Hj\nh\n\x08int64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12w\n\x06not_in\x18\x07 \x03(\x03\x42`\xc2H]\n[\n\x0cint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x34\n\x07\x65xample\x18\t \x03(\x03\x42\x1a\xc2H\x17\n\x15\n\rint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xf0\x14\n\x0bUInt32Rules\x12\x85\x01\n\x05\x63onst\x18\x01 \x01(\rBo\xc2Hl\nj\n\x0cuint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x89\x01\n\x02lt\x18\x02 \x01(\rBw\xc2Ht\nr\n\tuint32.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9c\x01\n\x03lte\x18\x03 \x01(\rB\x87\x01\xc2H\x83\x01\n\x80\x01\n\nuint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x82\x07\n\x02gt\x18\x04 \x01(\rB\xef\x06\xc2H\xeb\x06\nu\n\tuint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0cuint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16uint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\ruint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17uint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xcf\x07\n\x03gte\x18\x05 \x01(\rB\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nuint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\ruint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17uint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0euint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18uint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12~\n\x02in\x18\x06 \x03(\rBn\xc2Hk\ni\n\tuint32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x07 \x03(\rBa\xc2H^\n\\\n\ruint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\rB\x1b\xc2H\x18\n\x16\n\x0euint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xf0\x14\n\x0bUInt64Rules\x12\x85\x01\n\x05\x63onst\x18\x01 \x01(\x04\x42o\xc2Hl\nj\n\x0cuint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x89\x01\n\x02lt\x18\x02 \x01(\x04\x42w\xc2Ht\nr\n\tuint64.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x04\x42\x87\x01\xc2H\x83\x01\n\x80\x01\n\nuint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x82\x07\n\x02gt\x18\x04 \x01(\x04\x42\xef\x06\xc2H\xeb\x06\nu\n\tuint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0cuint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16uint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\ruint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17uint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x04\x42\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nuint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\ruint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17uint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0euint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18uint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12~\n\x02in\x18\x06 \x03(\x04\x42n\xc2Hk\ni\n\tuint64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x07 \x03(\x04\x42\x61\xc2H^\n\\\n\ruint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x04\x42\x1b\xc2H\x18\n\x16\n\x0euint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xf0\x14\n\x0bSInt32Rules\x12\x85\x01\n\x05\x63onst\x18\x01 \x01(\x11\x42o\xc2Hl\nj\n\x0csint32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x89\x01\n\x02lt\x18\x02 \x01(\x11\x42w\xc2Ht\nr\n\tsint32.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x11\x42\x87\x01\xc2H\x83\x01\n\x80\x01\n\nsint32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x82\x07\n\x02gt\x18\x04 \x01(\x11\x42\xef\x06\xc2H\xeb\x06\nu\n\tsint32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0csint32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16sint32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\rsint32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17sint32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x11\x42\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nsint32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\rsint32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17sint32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0esint32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18sint32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12~\n\x02in\x18\x06 \x03(\x11\x42n\xc2Hk\ni\n\tsint32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x07 \x03(\x11\x42\x61\xc2H^\n\\\n\rsint32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x11\x42\x1b\xc2H\x18\n\x16\n\x0esint32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xf0\x14\n\x0bSInt64Rules\x12\x85\x01\n\x05\x63onst\x18\x01 \x01(\x12\x42o\xc2Hl\nj\n\x0csint64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x89\x01\n\x02lt\x18\x02 \x01(\x12\x42w\xc2Ht\nr\n\tsint64.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9c\x01\n\x03lte\x18\x03 \x01(\x12\x42\x87\x01\xc2H\x83\x01\n\x80\x01\n\nsint64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x82\x07\n\x02gt\x18\x04 \x01(\x12\x42\xef\x06\xc2H\xeb\x06\nu\n\tsint64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xae\x01\n\x0csint64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb6\x01\n\x16sint64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbe\x01\n\rsint64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc6\x01\n\x17sint64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xcf\x07\n\x03gte\x18\x05 \x01(\x12\x42\xba\x07\xc2H\xb6\x07\n\x83\x01\n\nsint64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbd\x01\n\rsint64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc5\x01\n\x17sint64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcd\x01\n\x0esint64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd5\x01\n\x18sint64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12~\n\x02in\x18\x06 \x03(\x12\x42n\xc2Hk\ni\n\tsint64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x07 \x03(\x12\x42\x61\xc2H^\n\\\n\rsint64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x35\n\x07\x65xample\x18\x08 \x03(\x12\x42\x1b\xc2H\x18\n\x16\n\x0esint64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x81\x15\n\x0c\x46ixed32Rules\x12\x86\x01\n\x05\x63onst\x18\x01 \x01(\x07\x42p\xc2Hm\nk\n\rfixed32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8a\x01\n\x02lt\x18\x02 \x01(\x07\x42x\xc2Hu\ns\n\nfixed32.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9d\x01\n\x03lte\x18\x03 \x01(\x07\x42\x88\x01\xc2H\x84\x01\n\x81\x01\n\x0b\x66ixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x87\x07\n\x02gt\x18\x04 \x01(\x07\x42\xf4\x06\xc2H\xf0\x06\nv\n\nfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xaf\x01\n\rfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb7\x01\n\x17\x66ixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbf\x01\n\x0e\x66ixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc7\x01\n\x18\x66ixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xd4\x07\n\x03gte\x18\x05 \x01(\x07\x42\xbf\x07\xc2H\xbb\x07\n\x84\x01\n\x0b\x66ixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbe\x01\n\x0e\x66ixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc6\x01\n\x18\x66ixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xce\x01\n\x0f\x66ixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd6\x01\n\x19\x66ixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x7f\n\x02in\x18\x06 \x03(\x07\x42o\xc2Hl\nj\n\nfixed32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12y\n\x06not_in\x18\x07 \x03(\x07\x42\x62\xc2H_\n]\n\x0e\x66ixed32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x36\n\x07\x65xample\x18\x08 \x03(\x07\x42\x1c\xc2H\x19\n\x17\n\x0f\x66ixed32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x81\x15\n\x0c\x46ixed64Rules\x12\x86\x01\n\x05\x63onst\x18\x01 \x01(\x06\x42p\xc2Hm\nk\n\rfixed64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8a\x01\n\x02lt\x18\x02 \x01(\x06\x42x\xc2Hu\ns\n\nfixed64.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9d\x01\n\x03lte\x18\x03 \x01(\x06\x42\x88\x01\xc2H\x84\x01\n\x81\x01\n\x0b\x66ixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x87\x07\n\x02gt\x18\x04 \x01(\x06\x42\xf4\x06\xc2H\xf0\x06\nv\n\nfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xaf\x01\n\rfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb7\x01\n\x17\x66ixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xbf\x01\n\x0e\x66ixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc7\x01\n\x18\x66ixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xd4\x07\n\x03gte\x18\x05 \x01(\x06\x42\xbf\x07\xc2H\xbb\x07\n\x84\x01\n\x0b\x66ixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbe\x01\n\x0e\x66ixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc6\x01\n\x18\x66ixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xce\x01\n\x0f\x66ixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd6\x01\n\x19\x66ixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x7f\n\x02in\x18\x06 \x03(\x06\x42o\xc2Hl\nj\n\nfixed64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12y\n\x06not_in\x18\x07 \x03(\x06\x42\x62\xc2H_\n]\n\x0e\x66ixed64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x36\n\x07\x65xample\x18\x08 \x03(\x06\x42\x1c\xc2H\x19\n\x17\n\x0f\x66ixed64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x93\x15\n\rSFixed32Rules\x12\x87\x01\n\x05\x63onst\x18\x01 \x01(\x0f\x42q\xc2Hn\nl\n\x0esfixed32.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8b\x01\n\x02lt\x18\x02 \x01(\x0f\x42y\xc2Hv\nt\n\x0bsfixed32.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9e\x01\n\x03lte\x18\x03 \x01(\x0f\x42\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0csfixed32.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x8c\x07\n\x02gt\x18\x04 \x01(\x0f\x42\xf9\x06\xc2H\xf5\x06\nw\n\x0bsfixed32.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0esfixed32.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18sfixed32.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0fsfixed32.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19sfixed32.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xd9\x07\n\x03gte\x18\x05 \x01(\x0f\x42\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0csfixed32.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0fsfixed32.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19sfixed32.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10sfixed32.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1asfixed32.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x80\x01\n\x02in\x18\x06 \x03(\x0f\x42p\xc2Hm\nk\n\x0bsfixed32.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12z\n\x06not_in\x18\x07 \x03(\x0f\x42\x63\xc2H`\n^\n\x0fsfixed32.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x37\n\x07\x65xample\x18\x08 \x03(\x0f\x42\x1d\xc2H\x1a\n\x18\n\x10sfixed32.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x93\x15\n\rSFixed64Rules\x12\x87\x01\n\x05\x63onst\x18\x01 \x01(\x10\x42q\xc2Hn\nl\n\x0esfixed64.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x8b\x01\n\x02lt\x18\x02 \x01(\x10\x42y\xc2Hv\nt\n\x0bsfixed64.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\x9e\x01\n\x03lte\x18\x03 \x01(\x10\x42\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0csfixed64.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\x8c\x07\n\x02gt\x18\x04 \x01(\x10\x42\xf9\x06\xc2H\xf5\x06\nw\n\x0bsfixed64.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0esfixed64.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18sfixed64.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0fsfixed64.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19sfixed64.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xd9\x07\n\x03gte\x18\x05 \x01(\x10\x42\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0csfixed64.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0fsfixed64.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19sfixed64.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10sfixed64.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1asfixed64.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x80\x01\n\x02in\x18\x06 \x03(\x10\x42p\xc2Hm\nk\n\x0bsfixed64.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12z\n\x06not_in\x18\x07 \x03(\x10\x42\x63\xc2H`\n^\n\x0fsfixed64.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x37\n\x07\x65xample\x18\x08 \x03(\x10\x42\x1d\xc2H\x1a\n\x18\n\x10sfixed64.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\xd1\x01\n\tBoolRules\x12\x83\x01\n\x05\x63onst\x18\x01 \x01(\x08\x42m\xc2Hj\nh\n\nbool.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\x33\n\x07\x65xample\x18\x02 \x03(\x08\x42\x19\xc2H\x16\n\x14\n\x0c\x62ool.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xcf?\n\x0bStringRules\x12\x87\x01\n\x05\x63onst\x18\x01 \x01(\tBq\xc2Hn\nl\n\x0cstring.const\x1a\\this != getField(rules, \'const\') ? \'must equal `%s`\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12v\n\x03len\x18\x13 \x01(\x04\x42\x64\xc2Ha\n_\n\nstring.len\x1aQuint(this.size()) != rules.len ? \'must be %s characters\'.format([rules.len]) : \'\'R\x03len\x12\x91\x01\n\x07min_len\x18\x02 \x01(\x04\x42x\xc2Hu\ns\n\x0estring.min_len\x1a\x61uint(this.size()) < rules.min_len ? \'must be at least %s characters\'.format([rules.min_len]) : \'\'R\x06minLen\x12\x90\x01\n\x07max_len\x18\x03 \x01(\x04\x42w\xc2Ht\nr\n\x0estring.max_len\x1a`uint(this.size()) > rules.max_len ? \'must be at most %s characters\'.format([rules.max_len]) : \'\'R\x06maxLen\x12\x95\x01\n\tlen_bytes\x18\x14 \x01(\x04\x42x\xc2Hu\ns\n\x10string.len_bytes\x1a_uint(bytes(this).size()) != rules.len_bytes ? \'must be %s bytes\'.format([rules.len_bytes]) : \'\'R\x08lenBytes\x12\x9e\x01\n\tmin_bytes\x18\x04 \x01(\x04\x42\x80\x01\xc2H}\n{\n\x10string.min_bytes\x1aguint(bytes(this).size()) < rules.min_bytes ? \'must be at least %s bytes\'.format([rules.min_bytes]) : \'\'R\x08minBytes\x12\x9c\x01\n\tmax_bytes\x18\x05 \x01(\x04\x42\x7f\xc2H|\nz\n\x10string.max_bytes\x1a\x66uint(bytes(this).size()) > rules.max_bytes ? \'must be at most %s bytes\'.format([rules.max_bytes]) : \'\'R\x08maxBytes\x12\x90\x01\n\x07pattern\x18\x06 \x01(\tBv\xc2Hs\nq\n\x0estring.pattern\x1a_!this.matches(rules.pattern) ? \'does not match regex pattern `%s`\'.format([rules.pattern]) : \'\'R\x07pattern\x12\x86\x01\n\x06prefix\x18\x07 \x01(\tBn\xc2Hk\ni\n\rstring.prefix\x1aX!this.startsWith(rules.prefix) ? \'does not have prefix `%s`\'.format([rules.prefix]) : \'\'R\x06prefix\x12\x84\x01\n\x06suffix\x18\x08 \x01(\tBl\xc2Hi\ng\n\rstring.suffix\x1aV!this.endsWith(rules.suffix) ? \'does not have suffix `%s`\'.format([rules.suffix]) : \'\'R\x06suffix\x12\x94\x01\n\x08\x63ontains\x18\t \x01(\tBx\xc2Hu\ns\n\x0fstring.contains\x1a`!this.contains(rules.contains) ? \'does not contain substring `%s`\'.format([rules.contains]) : \'\'R\x08\x63ontains\x12\x9e\x01\n\x0cnot_contains\x18\x17 \x01(\tB{\xc2Hx\nv\n\x13string.not_contains\x1a_this.contains(rules.not_contains) ? \'contains substring `%s`\'.format([rules.not_contains]) : \'\'R\x0bnotContains\x12~\n\x02in\x18\n \x03(\tBn\xc2Hk\ni\n\tstring.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12x\n\x06not_in\x18\x0b \x03(\tBa\xc2H^\n\\\n\rstring.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\xe0\x01\n\x05\x65mail\x18\x0c \x01(\x08\x42\xc7\x01\xc2H\xc3\x01\n[\n\x0cstring.email\x12\x1dmust be a valid email address\x1a,!rules.email || this == \'\' || this.isEmail()\nd\n\x12string.email_empty\x12\x32value is empty, which is not a valid email address\x1a\x1a!rules.email || this != \'\'H\x00R\x05\x65mail\x12\xeb\x01\n\x08hostname\x18\r \x01(\x08\x42\xcc\x01\xc2H\xc8\x01\n_\n\x0fstring.hostname\x12\x18must be a valid hostname\x1a\x32!rules.hostname || this == \'\' || this.isHostname()\ne\n\x15string.hostname_empty\x12-value is empty, which is not a valid hostname\x1a\x1d!rules.hostname || this != \'\'H\x00R\x08hostname\x12\xc5\x01\n\x02ip\x18\x0e \x01(\x08\x42\xb2\x01\xc2H\xae\x01\nO\n\tstring.ip\x12\x1amust be a valid IP address\x1a&!rules.ip || this == \'\' || this.isIp()\n[\n\x0fstring.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x17!rules.ip || this != \'\'H\x00R\x02ip\x12\xd6\x01\n\x04ipv4\x18\x0f \x01(\x08\x42\xbf\x01\xc2H\xbb\x01\nV\n\x0bstring.ipv4\x12\x1cmust be a valid IPv4 address\x1a)!rules.ipv4 || this == \'\' || this.isIp(4)\na\n\x11string.ipv4_empty\x12\x31value is empty, which is not a valid IPv4 address\x1a\x19!rules.ipv4 || this != \'\'H\x00R\x04ipv4\x12\xd6\x01\n\x04ipv6\x18\x10 \x01(\x08\x42\xbf\x01\xc2H\xbb\x01\nV\n\x0bstring.ipv6\x12\x1cmust be a valid IPv6 address\x1a)!rules.ipv6 || this == \'\' || this.isIp(6)\na\n\x11string.ipv6_empty\x12\x31value is empty, which is not a valid IPv6 address\x1a\x19!rules.ipv6 || this != \'\'H\x00R\x04ipv6\x12\xbe\x01\n\x03uri\x18\x11 \x01(\x08\x42\xa9\x01\xc2H\xa5\x01\nK\n\nstring.uri\x12\x13must be a valid URI\x1a(!rules.uri || this == \'\' || this.isUri()\nV\n\x10string.uri_empty\x12(value is empty, which is not a valid URI\x1a\x18!rules.uri || this != \'\'H\x00R\x03uri\x12r\n\x07uri_ref\x18\x12 \x01(\x08\x42W\xc2HT\nR\n\x0estring.uri_ref\x12\x1dmust be a valid URI Reference\x1a!!rules.uri_ref || this.isUriRef()H\x00R\x06uriRef\x12\x92\x02\n\x07\x61\x64\x64ress\x18\x15 \x01(\x08\x42\xf5\x01\xc2H\xf1\x01\n{\n\x0estring.address\x12\'must be a valid hostname, or ip address\x1a@!rules.address || this == \'\' || this.isHostname() || this.isIp()\nr\n\x14string.address_empty\x12!rules.ipv4_with_prefixlen || this == \'\' || this.isIpPrefix(4)\n\x92\x01\n string.ipv4_with_prefixlen_empty\x12\x44value is empty, which is not a valid IPv4 address with prefix length\x1a(!rules.ipv4_with_prefixlen || this != \'\'H\x00R\x11ipv4WithPrefixlen\x12\xdc\x02\n\x13ipv6_with_prefixlen\x18\x1c \x01(\x08\x42\xa9\x02\xc2H\xa5\x02\n\x8d\x01\n\x1astring.ipv6_with_prefixlen\x12/must be a valid IPv6 address with prefix length\x1a>!rules.ipv6_with_prefixlen || this == \'\' || this.isIpPrefix(6)\n\x92\x01\n string.ipv6_with_prefixlen_empty\x12\x44value is empty, which is not a valid IPv6 address with prefix length\x1a(!rules.ipv6_with_prefixlen || this != \'\'H\x00R\x11ipv6WithPrefixlen\x12\xf6\x01\n\tip_prefix\x18\x1d \x01(\x08\x42\xd6\x01\xc2H\xd2\x01\nf\n\x10string.ip_prefix\x12\x19must be a valid IP prefix\x1a\x37!rules.ip_prefix || this == \'\' || this.isIpPrefix(true)\nh\n\x16string.ip_prefix_empty\x12.value is empty, which is not a valid IP prefix\x1a\x1e!rules.ip_prefix || this != \'\'H\x00R\x08ipPrefix\x12\x89\x02\n\x0bipv4_prefix\x18\x1e \x01(\x08\x42\xe5\x01\xc2H\xe1\x01\no\n\x12string.ipv4_prefix\x12\x1bmust be a valid IPv4 prefix\x1a!rules.host_and_port || this == \'\' || this.isHostAndPort(true)\ny\n\x1astring.host_and_port_empty\x12\x37value is empty, which is not a valid host and port pair\x1a\"!rules.host_and_port || this != \'\'H\x00R\x0bhostAndPort\x12\xf4\x01\n\x04ulid\x18# \x01(\x08\x42\xdd\x01\xc2H\xd9\x01\n|\n\x0bstring.ulid\x12\x14must be a valid ULID\x1aW!rules.ulid || this == \'\' || this.matches(\'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$\')\nY\n\x11string.ulid_empty\x12)value is empty, which is not a valid ULID\x1a\x19!rules.ulid || this != \'\'H\x00R\x04ulid\x12\xe1\x02\n\x0cprotobuf_fqn\x18% \x01(\x08\x42\xbb\x02\xc2H\xb7\x02\n\xaf\x01\n\x13string.protobuf_fqn\x12-must be a valid fully-qualified Protobuf name\x1ai!rules.protobuf_fqn || this == \'\' || this.matches(\'^[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\x82\x01\n\x19string.protobuf_fqn_empty\x12\x42value is empty, which is not a valid fully-qualified Protobuf name\x1a!!rules.protobuf_fqn || this != \'\'H\x00R\x0bprotobufFqn\x12\xa1\x03\n\x10protobuf_dot_fqn\x18& \x01(\x08\x42\xf4\x02\xc2H\xf0\x02\n\xcd\x01\n\x17string.protobuf_dot_fqn\x12@must be a valid fully-qualified Protobuf name with a leading dot\x1ap!rules.protobuf_dot_fqn || this == \'\' || this.matches(\'^\\\\.[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\x9d\x01\n\x1dstring.protobuf_dot_fqn_empty\x12Uvalue is empty, which is not a valid fully-qualified Protobuf name with a leading dot\x1a%!rules.protobuf_dot_fqn || this != \'\'H\x00R\x0eprotobufDotFqn\x12\xac\x05\n\x10well_known_regex\x18\x18 \x01(\x0e\x32\x18.buf.validate.KnownRegexB\xe5\x04\xc2H\xe1\x04\n\xea\x01\n#string.well_known_regex.header_name\x12 must be a valid HTTP header name\x1a\xa0\x01rules.well_known_regex != 1 || this == \'\' || this.matches(!has(rules.strict) || rules.strict ?\'^:?[0-9a-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[^\\u0000\\u000A\\u000D]+$\')\n\x8d\x01\n)string.well_known_regex.header_name_empty\x12\x35value is empty, which is not a valid HTTP header name\x1a)rules.well_known_regex != 1 || this != \'\'\n\xe1\x01\n$string.well_known_regex.header_value\x12!must be a valid HTTP header value\x1a\x95\x01rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$\' :\'^[^\\u0000\\u000A\\u000D]*$\')H\x00R\x0ewellKnownRegex\x12\x16\n\x06strict\x18\x19 \x01(\x08R\x06strict\x12\x35\n\x07\x65xample\x18\" \x03(\tB\x1b\xc2H\x18\n\x16\n\x0estring.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0c\n\nwell_known\"\xca\x12\n\nBytesRules\x12\x81\x01\n\x05\x63onst\x18\x01 \x01(\x0c\x42k\xc2Hh\nf\n\x0b\x62ytes.const\x1aWthis != getField(rules, \'const\') ? \'must be %x\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12p\n\x03len\x18\r \x01(\x04\x42^\xc2H[\nY\n\tbytes.len\x1aLuint(this.size()) != rules.len ? \'must be %s bytes\'.format([rules.len]) : \'\'R\x03len\x12\x8b\x01\n\x07min_len\x18\x02 \x01(\x04\x42r\xc2Ho\nm\n\rbytes.min_len\x1a\\uint(this.size()) < rules.min_len ? \'must be at least %s bytes\'.format([rules.min_len]) : \'\'R\x06minLen\x12\x8a\x01\n\x07max_len\x18\x03 \x01(\x04\x42q\xc2Hn\nl\n\rbytes.max_len\x1a[uint(this.size()) > rules.max_len ? \'must be at most %s bytes\'.format([rules.max_len]) : \'\'R\x06maxLen\x12\x93\x01\n\x07pattern\x18\x04 \x01(\tBy\xc2Hv\nt\n\rbytes.pattern\x1a\x63!string(this).matches(rules.pattern) ? \'must match regex pattern `%s`\'.format([rules.pattern]) : \'\'R\x07pattern\x12\x83\x01\n\x06prefix\x18\x05 \x01(\x0c\x42k\xc2Hh\nf\n\x0c\x62ytes.prefix\x1aV!this.startsWith(rules.prefix) ? \'does not have prefix %x\'.format([rules.prefix]) : \'\'R\x06prefix\x12\x81\x01\n\x06suffix\x18\x06 \x01(\x0c\x42i\xc2Hf\nd\n\x0c\x62ytes.suffix\x1aT!this.endsWith(rules.suffix) ? \'does not have suffix %x\'.format([rules.suffix]) : \'\'R\x06suffix\x12\x87\x01\n\x08\x63ontains\x18\x07 \x01(\x0c\x42k\xc2Hh\nf\n\x0e\x62ytes.contains\x1aT!this.contains(rules.contains) ? \'does not contain %x\'.format([rules.contains]) : \'\'R\x08\x63ontains\x12\xa5\x01\n\x02in\x18\x08 \x03(\x0c\x42\x94\x01\xc2H\x90\x01\n\x8d\x01\n\x08\x62ytes.in\x1a\x80\x01getField(rules, \'in\').size() > 0 && !(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12w\n\x06not_in\x18\t \x03(\x0c\x42`\xc2H]\n[\n\x0c\x62ytes.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\xe9\x01\n\x02ip\x18\n \x01(\x08\x42\xd6\x01\xc2H\xd2\x01\nn\n\x08\x62ytes.ip\x12\x1amust be a valid IP address\x1a\x46!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n`\n\x0e\x62ytes.ip_empty\x12/value is empty, which is not a valid IP address\x1a\x1d!rules.ip || this.size() != 0H\x00R\x02ip\x12\xe4\x01\n\x04ipv4\x18\x0b \x01(\x08\x42\xcd\x01\xc2H\xc9\x01\n_\n\nbytes.ipv4\x12\x1cmust be a valid IPv4 address\x1a\x33!rules.ipv4 || this.size() == 0 || this.size() == 4\nf\n\x10\x62ytes.ipv4_empty\x12\x31value is empty, which is not a valid IPv4 address\x1a\x1f!rules.ipv4 || this.size() != 0H\x00R\x04ipv4\x12\xe5\x01\n\x04ipv6\x18\x0c \x01(\x08\x42\xce\x01\xc2H\xca\x01\n`\n\nbytes.ipv6\x12\x1cmust be a valid IPv6 address\x1a\x34!rules.ipv6 || this.size() == 0 || this.size() == 16\nf\n\x10\x62ytes.ipv6_empty\x12\x31value is empty, which is not a valid IPv6 address\x1a\x1f!rules.ipv6 || this.size() != 0H\x00R\x04ipv6\x12\xd5\x01\n\x04uuid\x18\x0f \x01(\x08\x42\xbe\x01\xc2H\xba\x01\nX\n\nbytes.uuid\x12\x14must be a valid UUID\x1a\x34!rules.uuid || this.size() == 0 || this.size() == 16\n^\n\x10\x62ytes.uuid_empty\x12)value is empty, which is not a valid UUID\x1a\x1f!rules.uuid || this.size() != 0H\x00R\x04uuid\x12\x34\n\x07\x65xample\x18\x0e \x03(\x0c\x42\x1a\xc2H\x17\n\x15\n\rbytes.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0c\n\nwell_known\"\xea\x03\n\tEnumRules\x12\x83\x01\n\x05\x63onst\x18\x01 \x01(\x05\x42m\xc2Hj\nh\n\nenum.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12!\n\x0c\x64\x65\x66ined_only\x18\x02 \x01(\x08R\x0b\x64\x65\x66inedOnly\x12|\n\x02in\x18\x03 \x03(\x05\x42l\xc2Hi\ng\n\x07\x65num.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12v\n\x06not_in\x18\x04 \x03(\x05\x42_\xc2H\\\nZ\n\x0b\x65num.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12\x33\n\x07\x65xample\x18\x05 \x03(\x05\x42\x19\xc2H\x16\n\x14\n\x0c\x65num.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\x90\x04\n\rRepeatedRules\x12\xa0\x01\n\tmin_items\x18\x01 \x01(\x04\x42\x82\x01\xc2H\x7f\n}\n\x12repeated.min_items\x1aguint(this.size()) < rules.min_items ? \'must contain at least %d item(s)\'.format([rules.min_items]) : \'\'R\x08minItems\x12\xa6\x01\n\tmax_items\x18\x02 \x01(\x04\x42\x88\x01\xc2H\x84\x01\n\x81\x01\n\x12repeated.max_items\x1akuint(this.size()) > rules.max_items ? \'must contain no more than %s item(s)\'.format([rules.max_items]) : \'\'R\x08maxItems\x12x\n\x06unique\x18\x03 \x01(\x08\x42`\xc2H]\n[\n\x0frepeated.unique\x12(repeated value must contain unique items\x1a\x1e!rules.unique || this.unique()R\x06unique\x12.\n\x05items\x18\x04 \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x05items*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xac\x03\n\x08MapRules\x12\x99\x01\n\tmin_pairs\x18\x01 \x01(\x04\x42|\xc2Hy\nw\n\rmap.min_pairs\x1a\x66uint(this.size()) < rules.min_pairs ? \'map must be at least %d entries\'.format([rules.min_pairs]) : \'\'R\x08minPairs\x12\x98\x01\n\tmax_pairs\x18\x02 \x01(\x04\x42{\xc2Hx\nv\n\rmap.max_pairs\x1a\x65uint(this.size()) > rules.max_pairs ? \'map must be at most %d entries\'.format([rules.max_pairs]) : \'\'R\x08maxPairs\x12,\n\x04keys\x18\x04 \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x04keys\x12\x30\n\x06values\x18\x05 \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x06values*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"1\n\x08\x41nyRules\x12\x0e\n\x02in\x18\x02 \x03(\tR\x02in\x12\x15\n\x06not_in\x18\x03 \x03(\tR\x05notIn\"\xec\x16\n\rDurationRules\x12\xa2\x01\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationBq\xc2Hn\nl\n\x0e\x64uration.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xa6\x01\n\x02lt\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationBy\xc2Hv\nt\n\x0b\x64uration.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xb9\x01\n\x03lte\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x89\x01\xc2H\x85\x01\n\x82\x01\n\x0c\x64uration.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12\xa7\x07\n\x02gt\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\xf9\x06\xc2H\xf5\x06\nw\n\x0b\x64uration.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb0\x01\n\x0e\x64uration.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb8\x01\n\x18\x64uration.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc0\x01\n\x0f\x64uration.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc8\x01\n\x19\x64uration.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xf4\x07\n\x03gte\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationB\xc4\x07\xc2H\xc0\x07\n\x85\x01\n\x0c\x64uration.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xbf\x01\n\x0f\x64uration.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc7\x01\n\x19\x64uration.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xcf\x01\n\x10\x64uration.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd7\x01\n\x1a\x64uration.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12\x9b\x01\n\x02in\x18\x07 \x03(\x0b\x32\x19.google.protobuf.DurationBp\xc2Hm\nk\n\x0b\x64uration.in\x1a\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\x95\x01\n\x06not_in\x18\x08 \x03(\x0b\x32\x19.google.protobuf.DurationBc\xc2H`\n^\n\x0f\x64uration.not_in\x1aKthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'R\x05notIn\x12R\n\x07\x65xample\x18\t \x03(\x0b\x32\x19.google.protobuf.DurationB\x1d\xc2H\x1a\n\x18\n\x10\x64uration.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"\x86\x06\n\x0e\x46ieldMaskRules\x12\xc0\x01\n\x05\x63onst\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x8d\x01\xc2H\x89\x01\n\x86\x01\n\x10\x66ield_mask.const\x1arthis.paths != getField(rules, \'const\').paths ? \'must equal paths %s\'.format([getField(rules, \'const\').paths]) : \'\'R\x05\x63onst\x12\xd7\x01\n\x02in\x18\x02 \x03(\tB\xc6\x01\xc2H\xc2\x01\n\xbf\x01\n\rfield_mask.in\x1a\xad\x01!this.paths.all(p, p in getField(rules, \'in\') || getField(rules, \'in\').exists(f, p.startsWith(f+\'.\'))) ? \'must only contain paths in %s\'.format([getField(rules, \'in\')]) : \'\'R\x02in\x12\xf4\x01\n\x06not_in\x18\x03 \x03(\tB\xdc\x01\xc2H\xd8\x01\n\xd5\x01\n\x11\x66ield_mask.not_in\x1a\xbf\x01!this.paths.all(p, !(p in getField(rules, \'not_in\') || getField(rules, \'not_in\').exists(f, p.startsWith(f+\'.\')))) ? \'must not contain any paths in %s\'.format([getField(rules, \'not_in\')]) : \'\'R\x05notIn\x12U\n\x07\x65xample\x18\x04 \x03(\x0b\x32\x1a.google.protobuf.FieldMaskB\x1f\xc2H\x1c\n\x1a\n\x12\x66ield_mask.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\"\xe8\x17\n\x0eTimestampRules\x12\xa4\x01\n\x05\x63onst\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampBr\xc2Ho\nm\n\x0ftimestamp.const\x1aZthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'R\x05\x63onst\x12\xa8\x01\n\x02lt\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampBz\xc2Hw\nu\n\x0ctimestamp.lt\x1a\x65!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'H\x00R\x02lt\x12\xbb\x01\n\x03lte\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x8a\x01\xc2H\x86\x01\n\x83\x01\n\rtimestamp.lte\x1ar!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'H\x00R\x03lte\x12m\n\x06lt_now\x18\x07 \x01(\x08\x42T\xc2HQ\nO\n\x10timestamp.lt_now\x1a;(rules.lt_now && this > now) ? \'must be less than now\' : \'\'H\x00R\x05ltNow\x12\xad\x07\n\x02gt\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xfe\x06\xc2H\xfa\x06\nx\n\x0ctimestamp.gt\x1ah!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\xb1\x01\n\x0ftimestamp.gt_lt\x1a\x9d\x01has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xb9\x01\n\x19timestamp.gt_lt_exclusive\x1a\x9b\x01has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\xc1\x01\n\x10timestamp.gt_lte\x1a\xac\x01has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\xc9\x01\n\x1atimestamp.gt_lte_exclusive\x1a\xaa\x01has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'H\x01R\x02gt\x12\xfa\x07\n\x03gte\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\xc9\x07\xc2H\xc5\x07\n\x86\x01\n\rtimestamp.gte\x1au!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\xc0\x01\n\x10timestamp.gte_lt\x1a\xab\x01has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xc8\x01\n\x1atimestamp.gte_lt_exclusive\x1a\xa9\x01has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\xd0\x01\n\x11timestamp.gte_lte\x1a\xba\x01has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\xd8\x01\n\x1btimestamp.gte_lte_exclusive\x1a\xb8\x01has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'H\x01R\x03gte\x12p\n\x06gt_now\x18\x08 \x01(\x08\x42W\xc2HT\nR\n\x10timestamp.gt_now\x1a>(rules.gt_now && this < now) ? \'must be greater than now\' : \'\'H\x01R\x05gtNow\x12\xb9\x01\n\x06within\x18\t \x01(\x0b\x32\x19.google.protobuf.DurationB\x85\x01\xc2H\x81\x01\n\x7f\n\x10timestamp.within\x1akthis < now-rules.within || this > now+rules.within ? \'must be within %s of now\'.format([rules.within]) : \'\'R\x06within\x12T\n\x07\x65xample\x18\n \x03(\x0b\x32\x1a.google.protobuf.TimestampB\x1e\xc2H\x1b\n\x19\n\x11timestamp.example\x1a\x04trueR\x07\x65xample*\t\x08\xe8\x07\x10\x80\x80\x80\x80\x02\x42\x0b\n\tless_thanB\x0e\n\x0cgreater_than\"E\n\nViolations\x12\x37\n\nviolations\x18\x01 \x03(\x0b\x32\x17.buf.validate.ViolationR\nviolations\"\xc5\x01\n\tViolation\x12-\n\x05\x66ield\x18\x05 \x01(\x0b\x32\x17.buf.validate.FieldPathR\x05\x66ield\x12+\n\x04rule\x18\x06 \x01(\x0b\x32\x17.buf.validate.FieldPathR\x04rule\x12\x17\n\x07rule_id\x18\x02 \x01(\tR\x06ruleId\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12\x17\n\x07\x66or_key\x18\x04 \x01(\x08R\x06\x66orKeyJ\x04\x08\x01\x10\x02R\nfield_path\"G\n\tFieldPath\x12:\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x1e.buf.validate.FieldPathElementR\x08\x65lements\"\xcc\x03\n\x10\x46ieldPathElement\x12!\n\x0c\x66ield_number\x18\x01 \x01(\x05R\x0b\x66ieldNumber\x12\x1d\n\nfield_name\x18\x02 \x01(\tR\tfieldName\x12I\n\nfield_type\x18\x03 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\tfieldType\x12\x45\n\x08key_type\x18\x04 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\x07keyType\x12I\n\nvalue_type\x18\x05 \x01(\x0e\x32*.google.protobuf.FieldDescriptorProto.TypeR\tvalueType\x12\x16\n\x05index\x18\x06 \x01(\x04H\x00R\x05index\x12\x1b\n\x08\x62ool_key\x18\x07 \x01(\x08H\x00R\x07\x62oolKey\x12\x19\n\x07int_key\x18\x08 \x01(\x03H\x00R\x06intKey\x12\x1b\n\x08uint_key\x18\t \x01(\x04H\x00R\x07uintKey\x12\x1f\n\nstring_key\x18\n \x01(\tH\x00R\tstringKeyB\x0b\n\tsubscript*\xa1\x01\n\x06Ignore\x12\x16\n\x12IGNORE_UNSPECIFIED\x10\x00\x12\x18\n\x14IGNORE_IF_ZERO_VALUE\x10\x01\x12\x11\n\rIGNORE_ALWAYS\x10\x03\"\x04\x08\x02\x10\x02*\x0cIGNORE_EMPTY*\x0eIGNORE_DEFAULT*\x17IGNORE_IF_DEFAULT_VALUE*\x15IGNORE_IF_UNPOPULATED*n\n\nKnownRegex\x12\x1b\n\x17KNOWN_REGEX_UNSPECIFIED\x10\x00\x12 \n\x1cKNOWN_REGEX_HTTP_HEADER_NAME\x10\x01\x12!\n\x1dKNOWN_REGEX_HTTP_HEADER_VALUE\x10\x02:V\n\x07message\x12\x1f.google.protobuf.MessageOptions\x18\x87\t \x01(\x0b\x32\x1a.buf.validate.MessageRulesR\x07message:N\n\x05oneof\x12\x1d.google.protobuf.OneofOptions\x18\x87\t \x01(\x0b\x32\x18.buf.validate.OneofRulesR\x05oneof:N\n\x05\x66ield\x12\x1d.google.protobuf.FieldOptions\x18\x87\t \x01(\x0b\x32\x18.buf.validate.FieldRulesR\x05\x66ield:]\n\npredefined\x12\x1d.google.protobuf.FieldOptions\x18\x88\t \x01(\x0b\x32\x1d.buf.validate.PredefinedRulesR\npredefinedB\xbb\x01\n\x10\x63om.buf.validateB\rValidateProtoP\x01ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\xa2\x02\x03\x42VX\xaa\x02\x0c\x42uf.Validate\xca\x02\x0c\x42uf\\Validate\xe2\x02\x18\x42uf\\Validate\\GPBMetadata\xea\x02\rBuf::Validate') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'buf.validate.validate_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\020com.buf.validateB\rValidateProtoP\001ZGbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\242\002\003BVX\252\002\014Buf.Validate\312\002\014Buf\\Validate\342\002\030Buf\\Validate\\GPBMetadata\352\002\rBuf::Validate' - _globals['_FLOATRULES'].fields_by_name['const']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['const']._serialized_options = b'\302Hk\ni\n\013float.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['lt']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['lt']._serialized_options = b'\302H\206\001\n\203\001\n\010float.lt\032w!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['lte']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['lte']._serialized_options = b'\302H\225\001\n\222\001\n\tfloat.lte\032\204\001!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['gt']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['gt']._serialized_options = b'\302H\275\007\n\206\001\n\010float.gt\032z!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\275\001\n\013float.gt_lt\032\255\001has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\307\001\n\025float.gt_lt_exclusive\032\255\001has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\315\001\n\014float.gt_lte\032\274\001has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\327\001\n\026float.gt_lte_exclusive\032\274\001has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['gte']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['gte']._serialized_options = b'\302H\210\010\n\225\001\n\tfloat.gte\032\207\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\314\001\n\014float.gte_lt\032\273\001has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\326\001\n\026float.gte_lt_exclusive\032\273\001has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\334\001\n\rfloat.gte_lte\032\312\001has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\346\001\n\027float.gte_lte_exclusive\032\312\001has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['in']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['in']._serialized_options = b'\302Hj\nh\n\010float.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['not_in']._serialized_options = b'\302H]\n[\n\014float.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_FLOATRULES'].fields_by_name['finite']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['finite']._serialized_options = b'\302H\\\nZ\n\014float.finite\032Jrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'' - _globals['_FLOATRULES'].fields_by_name['example']._loaded_options = None - _globals['_FLOATRULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rfloat.example\032\004true' - _globals['_DOUBLERULES'].fields_by_name['const']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['const']._serialized_options = b'\302Hl\nj\n\014double.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['lt']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['lt']._serialized_options = b'\302H\207\001\n\204\001\n\tdouble.lt\032w!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['lte']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['lte']._serialized_options = b'\302H\226\001\n\223\001\n\ndouble.lte\032\204\001!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['gt']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['gt']._serialized_options = b'\302H\302\007\n\207\001\n\tdouble.gt\032z!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\276\001\n\014double.gt_lt\032\255\001has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\310\001\n\026double.gt_lt_exclusive\032\255\001has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\316\001\n\rdouble.gt_lte\032\274\001has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\330\001\n\027double.gt_lte_exclusive\032\274\001has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['gte']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['gte']._serialized_options = b'\302H\215\010\n\226\001\n\ndouble.gte\032\207\001!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\315\001\n\rdouble.gte_lt\032\273\001has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\327\001\n\027double.gte_lt_exclusive\032\273\001has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\335\001\n\016double.gte_lte\032\312\001has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\347\001\n\030double.gte_lte_exclusive\032\312\001has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['in']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tdouble.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['not_in']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\rdouble.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_DOUBLERULES'].fields_by_name['finite']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['finite']._serialized_options = b'\302H]\n[\n\rdouble.finite\032Jrules.finite ? (this.isNan() || this.isInf() ? \'must be finite\' : \'\') : \'\'' - _globals['_DOUBLERULES'].fields_by_name['example']._loaded_options = None - _globals['_DOUBLERULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016double.example\032\004true' - _globals['_INT32RULES'].fields_by_name['const']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['const']._serialized_options = b'\302Hk\ni\n\013int32.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_INT32RULES'].fields_by_name['lt']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['lt']._serialized_options = b'\302Hs\nq\n\010int32.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_INT32RULES'].fields_by_name['lte']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\201\001\n\177\n\tint32.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_INT32RULES'].fields_by_name['gt']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\346\006\nt\n\010int32.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\255\001\n\013int32.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\265\001\n\025int32.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\275\001\n\014int32.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\305\001\n\026int32.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_INT32RULES'].fields_by_name['gte']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\261\007\n\202\001\n\tint32.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\274\001\n\014int32.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\304\001\n\026int32.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\314\001\n\rint32.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\324\001\n\027int32.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_INT32RULES'].fields_by_name['in']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['in']._serialized_options = b'\302Hj\nh\n\010int32.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_INT32RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['not_in']._serialized_options = b'\302H]\n[\n\014int32.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_INT32RULES'].fields_by_name['example']._loaded_options = None - _globals['_INT32RULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rint32.example\032\004true' - _globals['_INT64RULES'].fields_by_name['const']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['const']._serialized_options = b'\302Hk\ni\n\013int64.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_INT64RULES'].fields_by_name['lt']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['lt']._serialized_options = b'\302Hs\nq\n\010int64.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_INT64RULES'].fields_by_name['lte']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\201\001\n\177\n\tint64.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_INT64RULES'].fields_by_name['gt']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\346\006\nt\n\010int64.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\255\001\n\013int64.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\265\001\n\025int64.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\275\001\n\014int64.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\305\001\n\026int64.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_INT64RULES'].fields_by_name['gte']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\261\007\n\202\001\n\tint64.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\274\001\n\014int64.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\304\001\n\026int64.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\314\001\n\rint64.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\324\001\n\027int64.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_INT64RULES'].fields_by_name['in']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['in']._serialized_options = b'\302Hj\nh\n\010int64.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_INT64RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['not_in']._serialized_options = b'\302H]\n[\n\014int64.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_INT64RULES'].fields_by_name['example']._loaded_options = None - _globals['_INT64RULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rint64.example\032\004true' - _globals['_UINT32RULES'].fields_by_name['const']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['const']._serialized_options = b'\302Hl\nj\n\014uint32.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['lt']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['lt']._serialized_options = b'\302Ht\nr\n\tuint32.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['lte']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\203\001\n\200\001\n\nuint32.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['gt']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\353\006\nu\n\tuint32.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\256\001\n\014uint32.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\266\001\n\026uint32.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\ruint32.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\306\001\n\027uint32.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['gte']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\266\007\n\203\001\n\nuint32.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\275\001\n\ruint32.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\305\001\n\027uint32.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\016uint32.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\325\001\n\030uint32.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['in']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tuint32.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\ruint32.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_UINT32RULES'].fields_by_name['example']._loaded_options = None - _globals['_UINT32RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016uint32.example\032\004true' - _globals['_UINT64RULES'].fields_by_name['const']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['const']._serialized_options = b'\302Hl\nj\n\014uint64.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['lt']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['lt']._serialized_options = b'\302Ht\nr\n\tuint64.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['lte']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\203\001\n\200\001\n\nuint64.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['gt']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\353\006\nu\n\tuint64.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\256\001\n\014uint64.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\266\001\n\026uint64.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\ruint64.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\306\001\n\027uint64.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['gte']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\266\007\n\203\001\n\nuint64.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\275\001\n\ruint64.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\305\001\n\027uint64.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\016uint64.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\325\001\n\030uint64.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['in']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tuint64.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\ruint64.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_UINT64RULES'].fields_by_name['example']._loaded_options = None - _globals['_UINT64RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016uint64.example\032\004true' - _globals['_SINT32RULES'].fields_by_name['const']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['const']._serialized_options = b'\302Hl\nj\n\014sint32.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['lt']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['lt']._serialized_options = b'\302Ht\nr\n\tsint32.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['lte']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['lte']._serialized_options = b'\302H\203\001\n\200\001\n\nsint32.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['gt']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['gt']._serialized_options = b'\302H\353\006\nu\n\tsint32.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\256\001\n\014sint32.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\266\001\n\026sint32.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\rsint32.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\306\001\n\027sint32.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['gte']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['gte']._serialized_options = b'\302H\266\007\n\203\001\n\nsint32.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\275\001\n\rsint32.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\305\001\n\027sint32.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\016sint32.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\325\001\n\030sint32.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['in']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tsint32.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\rsint32.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_SINT32RULES'].fields_by_name['example']._loaded_options = None - _globals['_SINT32RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016sint32.example\032\004true' - _globals['_SINT64RULES'].fields_by_name['const']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['const']._serialized_options = b'\302Hl\nj\n\014sint64.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['lt']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['lt']._serialized_options = b'\302Ht\nr\n\tsint64.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['lte']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['lte']._serialized_options = b'\302H\203\001\n\200\001\n\nsint64.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['gt']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['gt']._serialized_options = b'\302H\353\006\nu\n\tsint64.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\256\001\n\014sint64.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\266\001\n\026sint64.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\276\001\n\rsint64.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\306\001\n\027sint64.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['gte']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['gte']._serialized_options = b'\302H\266\007\n\203\001\n\nsint64.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\275\001\n\rsint64.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\305\001\n\027sint64.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\315\001\n\016sint64.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\325\001\n\030sint64.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['in']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tsint64.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\rsint64.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_SINT64RULES'].fields_by_name['example']._loaded_options = None - _globals['_SINT64RULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016sint64.example\032\004true' - _globals['_FIXED32RULES'].fields_by_name['const']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['const']._serialized_options = b'\302Hm\nk\n\rfixed32.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['lt']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['lt']._serialized_options = b'\302Hu\ns\n\nfixed32.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['lte']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['lte']._serialized_options = b'\302H\204\001\n\201\001\n\013fixed32.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['gt']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['gt']._serialized_options = b'\302H\360\006\nv\n\nfixed32.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\257\001\n\rfixed32.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\267\001\n\027fixed32.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\277\001\n\016fixed32.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\307\001\n\030fixed32.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['gte']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['gte']._serialized_options = b'\302H\273\007\n\204\001\n\013fixed32.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\276\001\n\016fixed32.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\306\001\n\030fixed32.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\316\001\n\017fixed32.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\326\001\n\031fixed32.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['in']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['in']._serialized_options = b'\302Hl\nj\n\nfixed32.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['not_in']._serialized_options = b'\302H_\n]\n\016fixed32.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_FIXED32RULES'].fields_by_name['example']._loaded_options = None - _globals['_FIXED32RULES'].fields_by_name['example']._serialized_options = b'\302H\031\n\027\n\017fixed32.example\032\004true' - _globals['_FIXED64RULES'].fields_by_name['const']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['const']._serialized_options = b'\302Hm\nk\n\rfixed64.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['lt']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['lt']._serialized_options = b'\302Hu\ns\n\nfixed64.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['lte']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['lte']._serialized_options = b'\302H\204\001\n\201\001\n\013fixed64.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['gt']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['gt']._serialized_options = b'\302H\360\006\nv\n\nfixed64.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\257\001\n\rfixed64.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\267\001\n\027fixed64.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\277\001\n\016fixed64.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\307\001\n\030fixed64.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['gte']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['gte']._serialized_options = b'\302H\273\007\n\204\001\n\013fixed64.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\276\001\n\016fixed64.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\306\001\n\030fixed64.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\316\001\n\017fixed64.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\326\001\n\031fixed64.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['in']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['in']._serialized_options = b'\302Hl\nj\n\nfixed64.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['not_in']._serialized_options = b'\302H_\n]\n\016fixed64.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_FIXED64RULES'].fields_by_name['example']._loaded_options = None - _globals['_FIXED64RULES'].fields_by_name['example']._serialized_options = b'\302H\031\n\027\n\017fixed64.example\032\004true' - _globals['_SFIXED32RULES'].fields_by_name['const']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['const']._serialized_options = b'\302Hn\nl\n\016sfixed32.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['lt']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['lt']._serialized_options = b'\302Hv\nt\n\013sfixed32.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['lte']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['lte']._serialized_options = b'\302H\205\001\n\202\001\n\014sfixed32.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['gt']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['gt']._serialized_options = b'\302H\365\006\nw\n\013sfixed32.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\260\001\n\016sfixed32.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\270\001\n\030sfixed32.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\300\001\n\017sfixed32.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\310\001\n\031sfixed32.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['gte']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['gte']._serialized_options = b'\302H\300\007\n\205\001\n\014sfixed32.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\277\001\n\017sfixed32.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\307\001\n\031sfixed32.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\317\001\n\020sfixed32.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\327\001\n\032sfixed32.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['in']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['in']._serialized_options = b'\302Hm\nk\n\013sfixed32.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['not_in']._serialized_options = b'\302H`\n^\n\017sfixed32.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_SFIXED32RULES'].fields_by_name['example']._loaded_options = None - _globals['_SFIXED32RULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020sfixed32.example\032\004true' - _globals['_SFIXED64RULES'].fields_by_name['const']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['const']._serialized_options = b'\302Hn\nl\n\016sfixed64.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['lt']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['lt']._serialized_options = b'\302Hv\nt\n\013sfixed64.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['lte']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['lte']._serialized_options = b'\302H\205\001\n\202\001\n\014sfixed64.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['gt']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['gt']._serialized_options = b'\302H\365\006\nw\n\013sfixed64.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\260\001\n\016sfixed64.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\270\001\n\030sfixed64.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\300\001\n\017sfixed64.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\310\001\n\031sfixed64.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['gte']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['gte']._serialized_options = b'\302H\300\007\n\205\001\n\014sfixed64.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\277\001\n\017sfixed64.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\307\001\n\031sfixed64.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\317\001\n\020sfixed64.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\327\001\n\032sfixed64.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['in']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['in']._serialized_options = b'\302Hm\nk\n\013sfixed64.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['not_in']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['not_in']._serialized_options = b'\302H`\n^\n\017sfixed64.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_SFIXED64RULES'].fields_by_name['example']._loaded_options = None - _globals['_SFIXED64RULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020sfixed64.example\032\004true' - _globals['_BOOLRULES'].fields_by_name['const']._loaded_options = None - _globals['_BOOLRULES'].fields_by_name['const']._serialized_options = b'\302Hj\nh\n\nbool.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_BOOLRULES'].fields_by_name['example']._loaded_options = None - _globals['_BOOLRULES'].fields_by_name['example']._serialized_options = b'\302H\026\n\024\n\014bool.example\032\004true' - _globals['_STRINGRULES'].fields_by_name['const']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['const']._serialized_options = b'\302Hn\nl\n\014string.const\032\\this != getField(rules, \'const\') ? \'must equal `%s`\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['len']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['len']._serialized_options = b'\302Ha\n_\n\nstring.len\032Quint(this.size()) != rules.len ? \'must be %s characters\'.format([rules.len]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['min_len']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['min_len']._serialized_options = b'\302Hu\ns\n\016string.min_len\032auint(this.size()) < rules.min_len ? \'must be at least %s characters\'.format([rules.min_len]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['max_len']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['max_len']._serialized_options = b'\302Ht\nr\n\016string.max_len\032`uint(this.size()) > rules.max_len ? \'must be at most %s characters\'.format([rules.max_len]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['len_bytes']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['len_bytes']._serialized_options = b'\302Hu\ns\n\020string.len_bytes\032_uint(bytes(this).size()) != rules.len_bytes ? \'must be %s bytes\'.format([rules.len_bytes]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['min_bytes']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['min_bytes']._serialized_options = b'\302H}\n{\n\020string.min_bytes\032guint(bytes(this).size()) < rules.min_bytes ? \'must be at least %s bytes\'.format([rules.min_bytes]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['max_bytes']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['max_bytes']._serialized_options = b'\302H|\nz\n\020string.max_bytes\032fuint(bytes(this).size()) > rules.max_bytes ? \'must be at most %s bytes\'.format([rules.max_bytes]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['pattern']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['pattern']._serialized_options = b'\302Hs\nq\n\016string.pattern\032_!this.matches(rules.pattern) ? \'does not match regex pattern `%s`\'.format([rules.pattern]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['prefix']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['prefix']._serialized_options = b'\302Hk\ni\n\rstring.prefix\032X!this.startsWith(rules.prefix) ? \'does not have prefix `%s`\'.format([rules.prefix]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['suffix']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['suffix']._serialized_options = b'\302Hi\ng\n\rstring.suffix\032V!this.endsWith(rules.suffix) ? \'does not have suffix `%s`\'.format([rules.suffix]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['contains']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['contains']._serialized_options = b'\302Hu\ns\n\017string.contains\032`!this.contains(rules.contains) ? \'does not contain substring `%s`\'.format([rules.contains]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['not_contains']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['not_contains']._serialized_options = b'\302Hx\nv\n\023string.not_contains\032_this.contains(rules.not_contains) ? \'contains substring `%s`\'.format([rules.not_contains]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['in']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['in']._serialized_options = b'\302Hk\ni\n\tstring.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['not_in']._serialized_options = b'\302H^\n\\\n\rstring.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_STRINGRULES'].fields_by_name['email']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['email']._serialized_options = b'\302H\303\001\n[\n\014string.email\022\035must be a valid email address\032,!rules.email || this == \'\' || this.isEmail()\nd\n\022string.email_empty\0222value is empty, which is not a valid email address\032\032!rules.email || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['hostname']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['hostname']._serialized_options = b'\302H\310\001\n_\n\017string.hostname\022\030must be a valid hostname\0322!rules.hostname || this == \'\' || this.isHostname()\ne\n\025string.hostname_empty\022-value is empty, which is not a valid hostname\032\035!rules.hostname || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ip']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ip']._serialized_options = b'\302H\256\001\nO\n\tstring.ip\022\032must be a valid IP address\032&!rules.ip || this == \'\' || this.isIp()\n[\n\017string.ip_empty\022/value is empty, which is not a valid IP address\032\027!rules.ip || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ipv4']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ipv4']._serialized_options = b'\302H\273\001\nV\n\013string.ipv4\022\034must be a valid IPv4 address\032)!rules.ipv4 || this == \'\' || this.isIp(4)\na\n\021string.ipv4_empty\0221value is empty, which is not a valid IPv4 address\032\031!rules.ipv4 || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ipv6']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ipv6']._serialized_options = b'\302H\273\001\nV\n\013string.ipv6\022\034must be a valid IPv6 address\032)!rules.ipv6 || this == \'\' || this.isIp(6)\na\n\021string.ipv6_empty\0221value is empty, which is not a valid IPv6 address\032\031!rules.ipv6 || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['uri']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['uri']._serialized_options = b'\302H\245\001\nK\n\nstring.uri\022\023must be a valid URI\032(!rules.uri || this == \'\' || this.isUri()\nV\n\020string.uri_empty\022(value is empty, which is not a valid URI\032\030!rules.uri || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['uri_ref']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['uri_ref']._serialized_options = b'\302HT\nR\n\016string.uri_ref\022\035must be a valid URI Reference\032!!rules.uri_ref || this.isUriRef()' - _globals['_STRINGRULES'].fields_by_name['address']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['address']._serialized_options = b'\302H\361\001\n{\n\016string.address\022\'must be a valid hostname, or ip address\032@!rules.address || this == \'\' || this.isHostname() || this.isIp()\nr\n\024string.address_empty\022!rules.ipv4_with_prefixlen || this == \'\' || this.isIpPrefix(4)\n\222\001\n string.ipv4_with_prefixlen_empty\022Dvalue is empty, which is not a valid IPv4 address with prefix length\032(!rules.ipv4_with_prefixlen || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ipv6_with_prefixlen']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ipv6_with_prefixlen']._serialized_options = b'\302H\245\002\n\215\001\n\032string.ipv6_with_prefixlen\022/must be a valid IPv6 address with prefix length\032>!rules.ipv6_with_prefixlen || this == \'\' || this.isIpPrefix(6)\n\222\001\n string.ipv6_with_prefixlen_empty\022Dvalue is empty, which is not a valid IPv6 address with prefix length\032(!rules.ipv6_with_prefixlen || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ip_prefix']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ip_prefix']._serialized_options = b'\302H\322\001\nf\n\020string.ip_prefix\022\031must be a valid IP prefix\0327!rules.ip_prefix || this == \'\' || this.isIpPrefix(true)\nh\n\026string.ip_prefix_empty\022.value is empty, which is not a valid IP prefix\032\036!rules.ip_prefix || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ipv4_prefix']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ipv4_prefix']._serialized_options = b'\302H\341\001\no\n\022string.ipv4_prefix\022\033must be a valid IPv4 prefix\032!rules.host_and_port || this == \'\' || this.isHostAndPort(true)\ny\n\032string.host_and_port_empty\0227value is empty, which is not a valid host and port pair\032\"!rules.host_and_port || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['ulid']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['ulid']._serialized_options = b'\302H\331\001\n|\n\013string.ulid\022\024must be a valid ULID\032W!rules.ulid || this == \'\' || this.matches(\'^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$\')\nY\n\021string.ulid_empty\022)value is empty, which is not a valid ULID\032\031!rules.ulid || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['protobuf_fqn']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['protobuf_fqn']._serialized_options = b'\302H\267\002\n\257\001\n\023string.protobuf_fqn\022-must be a valid fully-qualified Protobuf name\032i!rules.protobuf_fqn || this == \'\' || this.matches(\'^[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\202\001\n\031string.protobuf_fqn_empty\022Bvalue is empty, which is not a valid fully-qualified Protobuf name\032!!rules.protobuf_fqn || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['protobuf_dot_fqn']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['protobuf_dot_fqn']._serialized_options = b'\302H\360\002\n\315\001\n\027string.protobuf_dot_fqn\022@must be a valid fully-qualified Protobuf name with a leading dot\032p!rules.protobuf_dot_fqn || this == \'\' || this.matches(\'^\\\\.[A-Za-z_][A-Za-z_0-9]*(\\\\.[A-Za-z_][A-Za-z_0-9]*)*$\')\n\235\001\n\035string.protobuf_dot_fqn_empty\022Uvalue is empty, which is not a valid fully-qualified Protobuf name with a leading dot\032%!rules.protobuf_dot_fqn || this != \'\'' - _globals['_STRINGRULES'].fields_by_name['well_known_regex']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['well_known_regex']._serialized_options = b'\302H\341\004\n\352\001\n#string.well_known_regex.header_name\022 must be a valid HTTP header name\032\240\001rules.well_known_regex != 1 || this == \'\' || this.matches(!has(rules.strict) || rules.strict ?\'^:?[0-9a-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[^\\u0000\\u000A\\u000D]+$\')\n\215\001\n)string.well_known_regex.header_name_empty\0225value is empty, which is not a valid HTTP header name\032)rules.well_known_regex != 1 || this != \'\'\n\341\001\n$string.well_known_regex.header_value\022!must be a valid HTTP header value\032\225\001rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$\' :\'^[^\\u0000\\u000A\\u000D]*$\')' - _globals['_STRINGRULES'].fields_by_name['example']._loaded_options = None - _globals['_STRINGRULES'].fields_by_name['example']._serialized_options = b'\302H\030\n\026\n\016string.example\032\004true' - _globals['_BYTESRULES'].fields_by_name['const']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['const']._serialized_options = b'\302Hh\nf\n\013bytes.const\032Wthis != getField(rules, \'const\') ? \'must be %x\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['len']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['len']._serialized_options = b'\302H[\nY\n\tbytes.len\032Luint(this.size()) != rules.len ? \'must be %s bytes\'.format([rules.len]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['min_len']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['min_len']._serialized_options = b'\302Ho\nm\n\rbytes.min_len\032\\uint(this.size()) < rules.min_len ? \'must be at least %s bytes\'.format([rules.min_len]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['max_len']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['max_len']._serialized_options = b'\302Hn\nl\n\rbytes.max_len\032[uint(this.size()) > rules.max_len ? \'must be at most %s bytes\'.format([rules.max_len]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['pattern']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['pattern']._serialized_options = b'\302Hv\nt\n\rbytes.pattern\032c!string(this).matches(rules.pattern) ? \'must match regex pattern `%s`\'.format([rules.pattern]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['prefix']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['prefix']._serialized_options = b'\302Hh\nf\n\014bytes.prefix\032V!this.startsWith(rules.prefix) ? \'does not have prefix %x\'.format([rules.prefix]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['suffix']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['suffix']._serialized_options = b'\302Hf\nd\n\014bytes.suffix\032T!this.endsWith(rules.suffix) ? \'does not have suffix %x\'.format([rules.suffix]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['contains']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['contains']._serialized_options = b'\302Hh\nf\n\016bytes.contains\032T!this.contains(rules.contains) ? \'does not contain %x\'.format([rules.contains]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['in']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['in']._serialized_options = b'\302H\220\001\n\215\001\n\010bytes.in\032\200\001getField(rules, \'in\').size() > 0 && !(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['not_in']._serialized_options = b'\302H]\n[\n\014bytes.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_BYTESRULES'].fields_by_name['ip']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['ip']._serialized_options = b'\302H\322\001\nn\n\010bytes.ip\022\032must be a valid IP address\032F!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\n`\n\016bytes.ip_empty\022/value is empty, which is not a valid IP address\032\035!rules.ip || this.size() != 0' - _globals['_BYTESRULES'].fields_by_name['ipv4']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['ipv4']._serialized_options = b'\302H\311\001\n_\n\nbytes.ipv4\022\034must be a valid IPv4 address\0323!rules.ipv4 || this.size() == 0 || this.size() == 4\nf\n\020bytes.ipv4_empty\0221value is empty, which is not a valid IPv4 address\032\037!rules.ipv4 || this.size() != 0' - _globals['_BYTESRULES'].fields_by_name['ipv6']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['ipv6']._serialized_options = b'\302H\312\001\n`\n\nbytes.ipv6\022\034must be a valid IPv6 address\0324!rules.ipv6 || this.size() == 0 || this.size() == 16\nf\n\020bytes.ipv6_empty\0221value is empty, which is not a valid IPv6 address\032\037!rules.ipv6 || this.size() != 0' - _globals['_BYTESRULES'].fields_by_name['uuid']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['uuid']._serialized_options = b'\302H\272\001\nX\n\nbytes.uuid\022\024must be a valid UUID\0324!rules.uuid || this.size() == 0 || this.size() == 16\n^\n\020bytes.uuid_empty\022)value is empty, which is not a valid UUID\032\037!rules.uuid || this.size() != 0' - _globals['_BYTESRULES'].fields_by_name['example']._loaded_options = None - _globals['_BYTESRULES'].fields_by_name['example']._serialized_options = b'\302H\027\n\025\n\rbytes.example\032\004true' - _globals['_ENUMRULES'].fields_by_name['const']._loaded_options = None - _globals['_ENUMRULES'].fields_by_name['const']._serialized_options = b'\302Hj\nh\n\nenum.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_ENUMRULES'].fields_by_name['in']._loaded_options = None - _globals['_ENUMRULES'].fields_by_name['in']._serialized_options = b'\302Hi\ng\n\007enum.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_ENUMRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_ENUMRULES'].fields_by_name['not_in']._serialized_options = b'\302H\\\nZ\n\013enum.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_ENUMRULES'].fields_by_name['example']._loaded_options = None - _globals['_ENUMRULES'].fields_by_name['example']._serialized_options = b'\302H\026\n\024\n\014enum.example\032\004true' - _globals['_REPEATEDRULES'].fields_by_name['min_items']._loaded_options = None - _globals['_REPEATEDRULES'].fields_by_name['min_items']._serialized_options = b'\302H\177\n}\n\022repeated.min_items\032guint(this.size()) < rules.min_items ? \'must contain at least %d item(s)\'.format([rules.min_items]) : \'\'' - _globals['_REPEATEDRULES'].fields_by_name['max_items']._loaded_options = None - _globals['_REPEATEDRULES'].fields_by_name['max_items']._serialized_options = b'\302H\204\001\n\201\001\n\022repeated.max_items\032kuint(this.size()) > rules.max_items ? \'must contain no more than %s item(s)\'.format([rules.max_items]) : \'\'' - _globals['_REPEATEDRULES'].fields_by_name['unique']._loaded_options = None - _globals['_REPEATEDRULES'].fields_by_name['unique']._serialized_options = b'\302H]\n[\n\017repeated.unique\022(repeated value must contain unique items\032\036!rules.unique || this.unique()' - _globals['_MAPRULES'].fields_by_name['min_pairs']._loaded_options = None - _globals['_MAPRULES'].fields_by_name['min_pairs']._serialized_options = b'\302Hy\nw\n\rmap.min_pairs\032fuint(this.size()) < rules.min_pairs ? \'map must be at least %d entries\'.format([rules.min_pairs]) : \'\'' - _globals['_MAPRULES'].fields_by_name['max_pairs']._loaded_options = None - _globals['_MAPRULES'].fields_by_name['max_pairs']._serialized_options = b'\302Hx\nv\n\rmap.max_pairs\032euint(this.size()) > rules.max_pairs ? \'map must be at most %d entries\'.format([rules.max_pairs]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['const']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['const']._serialized_options = b'\302Hn\nl\n\016duration.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['lt']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['lt']._serialized_options = b'\302Hv\nt\n\013duration.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['lte']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['lte']._serialized_options = b'\302H\205\001\n\202\001\n\014duration.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['gt']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['gt']._serialized_options = b'\302H\365\006\nw\n\013duration.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\260\001\n\016duration.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\270\001\n\030duration.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\300\001\n\017duration.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\310\001\n\031duration.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['gte']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['gte']._serialized_options = b'\302H\300\007\n\205\001\n\014duration.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\277\001\n\017duration.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\307\001\n\031duration.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\317\001\n\020duration.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\327\001\n\032duration.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['in']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['in']._serialized_options = b'\302Hm\nk\n\013duration.in\032\\!(this in getField(rules, \'in\')) ? \'must be in list %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['not_in']._serialized_options = b'\302H`\n^\n\017duration.not_in\032Kthis in rules.not_in ? \'must not be in list %s\'.format([rules.not_in]) : \'\'' - _globals['_DURATIONRULES'].fields_by_name['example']._loaded_options = None - _globals['_DURATIONRULES'].fields_by_name['example']._serialized_options = b'\302H\032\n\030\n\020duration.example\032\004true' - _globals['_FIELDMASKRULES'].fields_by_name['const']._loaded_options = None - _globals['_FIELDMASKRULES'].fields_by_name['const']._serialized_options = b'\302H\211\001\n\206\001\n\020field_mask.const\032rthis.paths != getField(rules, \'const\').paths ? \'must equal paths %s\'.format([getField(rules, \'const\').paths]) : \'\'' - _globals['_FIELDMASKRULES'].fields_by_name['in']._loaded_options = None - _globals['_FIELDMASKRULES'].fields_by_name['in']._serialized_options = b'\302H\302\001\n\277\001\n\rfield_mask.in\032\255\001!this.paths.all(p, p in getField(rules, \'in\') || getField(rules, \'in\').exists(f, p.startsWith(f+\'.\'))) ? \'must only contain paths in %s\'.format([getField(rules, \'in\')]) : \'\'' - _globals['_FIELDMASKRULES'].fields_by_name['not_in']._loaded_options = None - _globals['_FIELDMASKRULES'].fields_by_name['not_in']._serialized_options = b'\302H\330\001\n\325\001\n\021field_mask.not_in\032\277\001!this.paths.all(p, !(p in getField(rules, \'not_in\') || getField(rules, \'not_in\').exists(f, p.startsWith(f+\'.\')))) ? \'must not contain any paths in %s\'.format([getField(rules, \'not_in\')]) : \'\'' - _globals['_FIELDMASKRULES'].fields_by_name['example']._loaded_options = None - _globals['_FIELDMASKRULES'].fields_by_name['example']._serialized_options = b'\302H\034\n\032\n\022field_mask.example\032\004true' - _globals['_TIMESTAMPRULES'].fields_by_name['const']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['const']._serialized_options = b'\302Ho\nm\n\017timestamp.const\032Zthis != getField(rules, \'const\') ? \'must equal %s\'.format([getField(rules, \'const\')]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['lt']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['lt']._serialized_options = b'\302Hw\nu\n\014timestamp.lt\032e!has(rules.gte) && !has(rules.gt) && this >= rules.lt? \'must be less than %s\'.format([rules.lt]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['lte']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['lte']._serialized_options = b'\302H\206\001\n\203\001\n\rtimestamp.lte\032r!has(rules.gte) && !has(rules.gt) && this > rules.lte? \'must be less than or equal to %s\'.format([rules.lte]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['lt_now']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['lt_now']._serialized_options = b'\302HQ\nO\n\020timestamp.lt_now\032;(rules.lt_now && this > now) ? \'must be less than now\' : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['gt']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['gt']._serialized_options = b'\302H\372\006\nx\n\014timestamp.gt\032h!has(rules.lt) && !has(rules.lte) && this <= rules.gt? \'must be greater than %s\'.format([rules.gt]) : \'\'\n\261\001\n\017timestamp.gt_lt\032\235\001has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)? \'must be greater than %s and less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\271\001\n\031timestamp.gt_lt_exclusive\032\233\001has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)? \'must be greater than %s or less than %s\'.format([rules.gt, rules.lt]) : \'\'\n\301\001\n\020timestamp.gt_lte\032\254\001has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)? \'must be greater than %s and less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'\n\311\001\n\032timestamp.gt_lte_exclusive\032\252\001has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)? \'must be greater than %s or less than or equal to %s\'.format([rules.gt, rules.lte]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['gte']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['gte']._serialized_options = b'\302H\305\007\n\206\001\n\rtimestamp.gte\032u!has(rules.lt) && !has(rules.lte) && this < rules.gte? \'must be greater than or equal to %s\'.format([rules.gte]) : \'\'\n\300\001\n\020timestamp.gte_lt\032\253\001has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)? \'must be greater than or equal to %s and less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\310\001\n\032timestamp.gte_lt_exclusive\032\251\001has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)? \'must be greater than or equal to %s or less than %s\'.format([rules.gte, rules.lt]) : \'\'\n\320\001\n\021timestamp.gte_lte\032\272\001has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)? \'must be greater than or equal to %s and less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'\n\330\001\n\033timestamp.gte_lte_exclusive\032\270\001has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)? \'must be greater than or equal to %s or less than or equal to %s\'.format([rules.gte, rules.lte]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['gt_now']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['gt_now']._serialized_options = b'\302HT\nR\n\020timestamp.gt_now\032>(rules.gt_now && this < now) ? \'must be greater than now\' : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['within']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['within']._serialized_options = b'\302H\201\001\n\177\n\020timestamp.within\032kthis < now-rules.within || this > now+rules.within ? \'must be within %s of now\'.format([rules.within]) : \'\'' - _globals['_TIMESTAMPRULES'].fields_by_name['example']._loaded_options = None - _globals['_TIMESTAMPRULES'].fields_by_name['example']._serialized_options = b'\302H\033\n\031\n\021timestamp.example\032\004true' - _globals['_IGNORE']._serialized_start=54642 - _globals['_IGNORE']._serialized_end=54803 - _globals['_KNOWNREGEX']._serialized_start=54805 - _globals['_KNOWNREGEX']._serialized_end=54915 - _globals['_RULE']._serialized_start=178 - _globals['_RULE']._serialized_end=258 - _globals['_MESSAGERULES']._serialized_start=261 - _globals['_MESSAGERULES']._serialized_end=422 - _globals['_MESSAGEONEOFRULE']._serialized_start=424 - _globals['_MESSAGEONEOFRULE']._serialized_end=494 - _globals['_ONEOFRULES']._serialized_start=496 - _globals['_ONEOFRULES']._serialized_end=536 - _globals['_FIELDRULES']._serialized_start=539 - _globals['_FIELDRULES']._serialized_end=1918 - _globals['_PREDEFINEDRULES']._serialized_start=1920 - _globals['_PREDEFINEDRULES']._serialized_end=2010 - _globals['_FLOATRULES']._serialized_start=2013 - _globals['_FLOATRULES']._serialized_end=5003 - _globals['_DOUBLERULES']._serialized_start=5006 - _globals['_DOUBLERULES']._serialized_end=8014 - _globals['_INT32RULES']._serialized_start=8017 - _globals['_INT32RULES']._serialized_end=10671 - _globals['_INT64RULES']._serialized_start=10674 - _globals['_INT64RULES']._serialized_end=13328 - _globals['_UINT32RULES']._serialized_start=13331 - _globals['_UINT32RULES']._serialized_end=16003 - _globals['_UINT64RULES']._serialized_start=16006 - _globals['_UINT64RULES']._serialized_end=18678 - _globals['_SINT32RULES']._serialized_start=18681 - _globals['_SINT32RULES']._serialized_end=21353 - _globals['_SINT64RULES']._serialized_start=21356 - _globals['_SINT64RULES']._serialized_end=24028 - _globals['_FIXED32RULES']._serialized_start=24031 - _globals['_FIXED32RULES']._serialized_end=26720 - _globals['_FIXED64RULES']._serialized_start=26723 - _globals['_FIXED64RULES']._serialized_end=29412 - _globals['_SFIXED32RULES']._serialized_start=29415 - _globals['_SFIXED32RULES']._serialized_end=32122 - _globals['_SFIXED64RULES']._serialized_start=32125 - _globals['_SFIXED64RULES']._serialized_end=34832 - _globals['_BOOLRULES']._serialized_start=34835 - _globals['_BOOLRULES']._serialized_end=35044 - _globals['_STRINGRULES']._serialized_start=35047 - _globals['_STRINGRULES']._serialized_end=43190 - _globals['_BYTESRULES']._serialized_start=43193 - _globals['_BYTESRULES']._serialized_end=45571 - _globals['_ENUMRULES']._serialized_start=45574 - _globals['_ENUMRULES']._serialized_end=46064 - _globals['_REPEATEDRULES']._serialized_start=46067 - _globals['_REPEATEDRULES']._serialized_end=46595 - _globals['_MAPRULES']._serialized_start=46598 - _globals['_MAPRULES']._serialized_end=47026 - _globals['_ANYRULES']._serialized_start=47028 - _globals['_ANYRULES']._serialized_end=47077 - _globals['_DURATIONRULES']._serialized_start=47080 - _globals['_DURATIONRULES']._serialized_end=50004 - _globals['_FIELDMASKRULES']._serialized_start=50007 - _globals['_FIELDMASKRULES']._serialized_end=50781 - _globals['_TIMESTAMPRULES']._serialized_start=50784 - _globals['_TIMESTAMPRULES']._serialized_end=53832 - _globals['_VIOLATIONS']._serialized_start=53834 - _globals['_VIOLATIONS']._serialized_end=53903 - _globals['_VIOLATION']._serialized_start=53906 - _globals['_VIOLATION']._serialized_end=54103 - _globals['_FIELDPATH']._serialized_start=54105 - _globals['_FIELDPATH']._serialized_end=54176 - _globals['_FIELDPATHELEMENT']._serialized_start=54179 - _globals['_FIELDPATHELEMENT']._serialized_end=54639 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/__init__.py b/python/metalstack/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/__init__.py +++ b/python/metalstack/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/admin/__init__.py b/python/metalstack/admin/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/admin/__init__.py +++ b/python/metalstack/admin/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/admin/v2/__init__.py b/python/metalstack/admin/v2/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/admin/v2/__init__.py +++ b/python/metalstack/admin/v2/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/admin/v2/audit_connect.py b/python/metalstack/admin/v2/audit_connect.py index c9a4cc70..2152362b 100644 --- a/python/metalstack/admin/v2/audit_connect.py +++ b/python/metalstack/admin/v2/audit_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/audit.proto +# Generated from metalstack/admin/v2/audit.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.audit_pb2 as metalstack_dot_admin_dot_v2_dot_audit__pb2 + +from .audit_pb import AuditServiceGetRequest, AuditServiceGetResponse, AuditServiceListRequest, AuditServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class AuditService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: AuditServiceGetRequest, ctx: RequestContext[AuditServiceGetRequest, AuditServiceGetResponse]) -> AuditServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: AuditServiceListRequest, ctx: RequestContext[AuditServiceListRequest, AuditServiceListResponse]) -> AuditServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class AuditServiceASGIApplication(ConnectASGIApplication[AuditService]): - def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: AuditService | AsyncGenerator[AuditService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, inte method=MethodInfo( name="Get", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, inte method=MethodInfo( name="List", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class AuditServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, + request: AuditServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse: + ) -> AuditServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, + request: AuditServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse: + ) -> AuditServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class AuditServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: AuditServiceGetRequest, ctx: RequestContext[AuditServiceGetRequest, AuditServiceGetResponse]) -> AuditServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: AuditServiceListRequest, ctx: RequestContext[AuditServiceListRequest, AuditServiceListResponse]) -> AuditServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class AuditServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: AuditServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: AuditServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.AuditService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: AuditServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="List", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class AuditServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, + request: AuditServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse: + ) -> AuditServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, + request: AuditServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse: + ) -> AuditServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.AuditService", - input=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/audit_pb.py b/python/metalstack/admin/v2/audit_pb.py new file mode 100644 index 00000000..d9319ef7 --- /dev/null +++ b/python/metalstack/admin/v2/audit_pb.py @@ -0,0 +1,178 @@ +# Generated from metalstack/admin/v2/audit.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import audit_pb, common_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.audit_pb import AuditPhase, AuditQuery, AuditTrace + + +_AuditServiceListRequestFields: TypeAlias = Literal["query"] + +class AuditServiceListRequest(Message[_AuditServiceListRequestFields]): + """ + AuditServiceListRequest is the request payload for listing audit traces. + + ```proto + message metalstack.admin.v2.AuditServiceListRequest + ``` + + Attributes: + query: + Query for audit traces + + ```proto + optional metalstack.api.v2.AuditQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: AuditQuery | None = None, + ) -> None: + pass + + query: AuditQuery | None + +_AuditServiceListResponseFields: TypeAlias = Literal["traces"] + +class AuditServiceListResponse(Message[_AuditServiceListResponseFields]): + """ + AuditServiceListResponse is the response payload for listing audit traces. + + ```proto + message metalstack.admin.v2.AuditServiceListResponse + ``` + + Attributes: + traces: + Traces contains the list of audit traces + + ```proto + repeated metalstack.api.v2.AuditTrace traces = 1; + ``` + """ + + __slots__ = ("traces",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + traces: list[AuditTrace] | None = None, + ) -> None: + pass + + traces: list[AuditTrace] + +_AuditServiceGetRequestFields: TypeAlias = Literal["uuid", "phase"] + +class AuditServiceGetRequest(Message[_AuditServiceGetRequestFields]): + """ + AuditServiceGetRequest is the request payload for getting an audit trace. + + ```proto + message metalstack.admin.v2.AuditServiceGetRequest + ``` + + Attributes: + uuid: + Uuid of the audit trace + + ```proto + string uuid = 1; + ``` + phase: + Phase specifies the audit phase. Defaults to request + + ```proto + optional metalstack.api.v2.AuditPhase phase = 2; + ``` + """ + + __slots__ = ("uuid", "phase") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + phase: AuditPhase | None = None, + ) -> None: + pass + + uuid: str + phase: AuditPhase + +_AuditServiceGetResponseFields: TypeAlias = Literal["trace"] + +class AuditServiceGetResponse(Message[_AuditServiceGetResponseFields]): + """ + AuditServiceGetResponse is the response payload for getting an audit trace. + + ```proto + message metalstack.admin.v2.AuditServiceGetResponse + ``` + + Attributes: + trace: + Trace is the audit trace + + ```proto + optional metalstack.api.v2.AuditTrace trace = 1; + ``` + """ + + __slots__ = ("trace",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + trace: AuditTrace | None = None, + ) -> None: + pass + + trace: AuditTrace | None + + +_DESC = file_desc( + b'\n\x1fmetalstack/admin/v2/audit.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1dmetalstack/api/v2/audit.proto\x1a\x1emetalstack/api/v2/common.proto"N\n\x17AuditServiceListRequest\x123\n\x05query\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.AuditQueryR\x05query"Q\n\x18AuditServiceListResponse\x125\n\x06traces\x18\x01 \x03(\x0b2\x1d.metalstack.api.v2.AuditTraceR\x06traces"\x84\x01\n\x16AuditServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12B\n\x05phase\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.AuditPhaseH\x00R\x05phaseB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x08\n\x06_phase"N\n\x17AuditServiceGetResponse\x123\n\x05trace\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.AuditTraceR\x05trace2\xed\x01\n\x0cAuditService\x12l\n\x03Get\x12+.metalstack.admin.v2.AuditServiceGetRequest\x1a,.metalstack.admin.v2.AuditServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12o\n\x04List\x12,.metalstack.admin.v2.AuditServiceListRequest\x1a-.metalstack.admin.v2.AuditServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xce\x01\n\x17com.metalstack.admin.v2B\nAuditProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + audit_pb.desc(), + common_pb.desc(), + ], + { + "AuditServiceListRequest": AuditServiceListRequest, + "AuditServiceListResponse": AuditServiceListResponse, + "AuditServiceGetRequest": AuditServiceGetRequest, + "AuditServiceGetResponse": AuditServiceGetResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/audit.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/audit_pb2.py b/python/metalstack/admin/v2/audit_pb2.py deleted file mode 100644 index 59b72983..00000000 --- a/python/metalstack/admin/v2/audit_pb2.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/audit.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/audit.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import audit_pb2 as metalstack_dot_api_dot_v2_dot_audit__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/admin/v2/audit.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1dmetalstack/api/v2/audit.proto\x1a\x1emetalstack/api/v2/common.proto\"N\n\x17\x41uditServiceListRequest\x12\x33\n\x05query\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.AuditQueryR\x05query\"Q\n\x18\x41uditServiceListResponse\x12\x35\n\x06traces\x18\x01 \x03(\x0b\x32\x1d.metalstack.api.v2.AuditTraceR\x06traces\"\x84\x01\n\x16\x41uditServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x42\n\x05phase\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.AuditPhaseB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x05phase\x88\x01\x01\x42\x08\n\x06_phase\"N\n\x17\x41uditServiceGetResponse\x12\x33\n\x05trace\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.AuditTraceR\x05trace2\xed\x01\n\x0c\x41uditService\x12l\n\x03Get\x12+.metalstack.admin.v2.AuditServiceGetRequest\x1a,.metalstack.admin.v2.AuditServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12o\n\x04List\x12,.metalstack.admin.v2.AuditServiceListRequest\x1a-.metalstack.admin.v2.AuditServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xce\x01\n\x17\x63om.metalstack.admin.v2B\nAuditProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.audit_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\nAuditProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['phase']._loaded_options = None - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['phase']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_AUDITSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_AUDITSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_AUDITSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_AUDITSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_AUDITSERVICELISTREQUEST']._serialized_start=148 - _globals['_AUDITSERVICELISTREQUEST']._serialized_end=226 - _globals['_AUDITSERVICELISTRESPONSE']._serialized_start=228 - _globals['_AUDITSERVICELISTRESPONSE']._serialized_end=309 - _globals['_AUDITSERVICEGETREQUEST']._serialized_start=312 - _globals['_AUDITSERVICEGETREQUEST']._serialized_end=444 - _globals['_AUDITSERVICEGETRESPONSE']._serialized_start=446 - _globals['_AUDITSERVICEGETRESPONSE']._serialized_end=524 - _globals['_AUDITSERVICE']._serialized_start=527 - _globals['_AUDITSERVICE']._serialized_end=764 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/audit_pb2.pyi b/python/metalstack/admin/v2/audit_pb2.pyi deleted file mode 100644 index 85932c7a..00000000 --- a/python/metalstack/admin/v2/audit_pb2.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import audit_pb2 as _audit_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class AuditServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _audit_pb2.AuditQuery - def __init__(self, query: _Optional[_Union[_audit_pb2.AuditQuery, _Mapping]] = ...) -> None: ... - -class AuditServiceListResponse(_message.Message): - __slots__ = ("traces",) - TRACES_FIELD_NUMBER: _ClassVar[int] - traces: _containers.RepeatedCompositeFieldContainer[_audit_pb2.AuditTrace] - def __init__(self, traces: _Optional[_Iterable[_Union[_audit_pb2.AuditTrace, _Mapping]]] = ...) -> None: ... - -class AuditServiceGetRequest(_message.Message): - __slots__ = ("uuid", "phase") - UUID_FIELD_NUMBER: _ClassVar[int] - PHASE_FIELD_NUMBER: _ClassVar[int] - uuid: str - phase: _audit_pb2.AuditPhase - def __init__(self, uuid: _Optional[str] = ..., phase: _Optional[_Union[_audit_pb2.AuditPhase, str]] = ...) -> None: ... - -class AuditServiceGetResponse(_message.Message): - __slots__ = ("trace",) - TRACE_FIELD_NUMBER: _ClassVar[int] - trace: _audit_pb2.AuditTrace - def __init__(self, trace: _Optional[_Union[_audit_pb2.AuditTrace, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/component_connect.py b/python/metalstack/admin/v2/component_connect.py index af2734c1..3734ed8d 100644 --- a/python/metalstack/admin/v2/component_connect.py +++ b/python/metalstack/admin/v2/component_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/component.proto +# Generated from metalstack/admin/v2/component.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.component_pb2 as metalstack_dot_admin_dot_v2_dot_component__pb2 + +from .component_pb import ComponentServiceDeleteRequest, ComponentServiceDeleteResponse, ComponentServiceGetRequest, ComponentServiceGetResponse, ComponentServiceListRequest, ComponentServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ComponentService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: ComponentServiceGetRequest, ctx: RequestContext[ComponentServiceGetRequest, ComponentServiceGetResponse]) -> ComponentServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: ComponentServiceDeleteRequest, ctx: RequestContext[ComponentServiceDeleteRequest, ComponentServiceDeleteResponse]) -> ComponentServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: ComponentServiceListRequest, ctx: RequestContext[ComponentServiceListRequest, ComponentServiceListResponse]) -> ComponentServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ComponentServiceASGIApplication(ConnectASGIApplication[ComponentService]): - def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ComponentService | AsyncGenerator[ComponentService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,8 +53,8 @@ def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], method=MethodInfo( name="Get", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse, + input=ComponentServiceGetRequest, + output=ComponentServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -47,8 +63,8 @@ def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse, + input=ComponentServiceDeleteRequest, + output=ComponentServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -57,8 +73,8 @@ def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], method=MethodInfo( name="List", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse, + input=ComponentServiceListRequest, + output=ComponentServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -79,18 +95,18 @@ def path(self) -> str: class ComponentServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, + request: ComponentServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse: + ) -> ComponentServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse, + input=ComponentServiceGetRequest, + output=ComponentServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -99,18 +115,18 @@ async def get( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, + request: ComponentServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse: + ) -> ComponentServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse, + input=ComponentServiceDeleteRequest, + output=ComponentServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -119,47 +135,52 @@ async def delete( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, + request: ComponentServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse: + ) -> ComponentServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse, + input=ComponentServiceListRequest, + output=ComponentServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class ComponentServiceSync(Protocol): + def get(self, request: ComponentServiceGetRequest, ctx: RequestContext[ComponentServiceGetRequest, ComponentServiceGetResponse]) -> ComponentServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: ComponentServiceDeleteRequest, ctx: RequestContext[ComponentServiceDeleteRequest, ComponentServiceDeleteResponse]) -> ComponentServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class ComponentServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: ComponentServiceListRequest, ctx: RequestContext[ComponentServiceListRequest, ComponentServiceListResponse]) -> ComponentServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ComponentServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ComponentServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ComponentServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.ComponentService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse, + input=ComponentServiceGetRequest, + output=ComponentServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -168,8 +189,8 @@ def __init__(self, service: ComponentServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse, + input=ComponentServiceDeleteRequest, + output=ComponentServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -178,8 +199,8 @@ def __init__(self, service: ComponentServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="List", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse, + input=ComponentServiceListRequest, + output=ComponentServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -200,62 +221,58 @@ def path(self) -> str: class ComponentServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, + request: ComponentServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse: + ) -> ComponentServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceGetResponse, + input=ComponentServiceGetRequest, + output=ComponentServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, + request: ComponentServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse: + ) -> ComponentServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceDeleteResponse, + input=ComponentServiceDeleteRequest, + output=ComponentServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, + request: ComponentServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse: + ) -> ComponentServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.ComponentService", - input=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_component__pb2.ComponentServiceListResponse, + input=ComponentServiceListRequest, + output=ComponentServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/component_pb.py b/python/metalstack/admin/v2/component_pb.py new file mode 100644 index 00000000..507fa025 --- /dev/null +++ b/python/metalstack/admin/v2/component_pb.py @@ -0,0 +1,236 @@ +# Generated from metalstack/admin/v2/component.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, component_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.component_pb import Component, ComponentQuery + + +_ComponentServiceListRequestFields: TypeAlias = Literal["query"] + +class ComponentServiceListRequest(Message[_ComponentServiceListRequestFields]): + """ + ComponentServiceListRequest is the request payload for listing components. + + ```proto + message metalstack.admin.v2.ComponentServiceListRequest + ``` + + Attributes: + query: + Query filters components + + ```proto + optional metalstack.api.v2.ComponentQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: ComponentQuery | None = None, + ) -> None: + pass + + query: ComponentQuery | None + +_ComponentServiceListResponseFields: TypeAlias = Literal["components"] + +class ComponentServiceListResponse(Message[_ComponentServiceListResponseFields]): + """ + ComponentServiceListResponse is the response payload for listing components. + + ```proto + message metalstack.admin.v2.ComponentServiceListResponse + ``` + + Attributes: + components: + Components contains the list of components + + ```proto + repeated metalstack.api.v2.Component components = 1; + ``` + """ + + __slots__ = ("components",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + components: list[Component] | None = None, + ) -> None: + pass + + components: list[Component] + +_ComponentServiceGetRequestFields: TypeAlias = Literal["uuid"] + +class ComponentServiceGetRequest(Message[_ComponentServiceGetRequestFields]): + """ + ComponentServiceGetRequest is the request payload for getting a component. + + ```proto + message metalstack.admin.v2.ComponentServiceGetRequest + ``` + + Attributes: + uuid: + UUID identifies the component to get + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_ComponentServiceGetResponseFields: TypeAlias = Literal["component"] + +class ComponentServiceGetResponse(Message[_ComponentServiceGetResponseFields]): + """ + ComponentServiceGetResponse is the response payload for getting a component. + + ```proto + message metalstack.admin.v2.ComponentServiceGetResponse + ``` + + Attributes: + component: + Component contains the retrieved component + + ```proto + optional metalstack.api.v2.Component component = 1; + ``` + """ + + __slots__ = ("component",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + component: Component | None = None, + ) -> None: + pass + + component: Component | None + +_ComponentServiceDeleteRequestFields: TypeAlias = Literal["uuid"] + +class ComponentServiceDeleteRequest(Message[_ComponentServiceDeleteRequestFields]): + """ + ComponentServiceDeleteRequest is the request payload for deleting a component. + + ```proto + message metalstack.admin.v2.ComponentServiceDeleteRequest + ``` + + Attributes: + uuid: + UUID identifies the component to delete + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_ComponentServiceDeleteResponseFields: TypeAlias = Literal["component"] + +class ComponentServiceDeleteResponse(Message[_ComponentServiceDeleteResponseFields]): + """ + ComponentServiceDeleteResponse is the response payload for deleting a component. + + ```proto + message metalstack.admin.v2.ComponentServiceDeleteResponse + ``` + + Attributes: + component: + Component contains the deleted component + + ```proto + optional metalstack.api.v2.Component component = 1; + ``` + """ + + __slots__ = ("component",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + component: Component | None = None, + ) -> None: + pass + + component: Component | None + + +_DESC = file_desc( + b'\n#metalstack/admin/v2/component.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/component.proto"V\n\x1bComponentServiceListRequest\x127\n\x05query\x18\x01 \x01(\x0b2!.metalstack.api.v2.ComponentQueryR\x05query"\\\n\x1cComponentServiceListResponse\x12<\n\ncomponents\x18\x01 \x03(\x0b2\x1c.metalstack.api.v2.ComponentR\ncomponents":\n\x1aComponentServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"Y\n\x1bComponentServiceGetResponse\x12:\n\tcomponent\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.ComponentR\tcomponent"=\n\x1dComponentServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"\\\n\x1eComponentServiceDeleteResponse\x12:\n\tcomponent\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.ComponentR\tcomponent2\xff\x02\n\x10ComponentService\x12t\n\x03Get\x12/.metalstack.admin.v2.ComponentServiceGetRequest\x1a0.metalstack.admin.v2.ComponentServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12|\n\x06Delete\x122.metalstack.admin.v2.ComponentServiceDeleteRequest\x1a3.metalstack.admin.v2.ComponentServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12w\n\x04List\x120.metalstack.admin.v2.ComponentServiceListRequest\x1a1.metalstack.admin.v2.ComponentServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd2\x01\n\x17com.metalstack.admin.v2B\x0eComponentProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + component_pb.desc(), + ], + { + "ComponentServiceListRequest": ComponentServiceListRequest, + "ComponentServiceListResponse": ComponentServiceListResponse, + "ComponentServiceGetRequest": ComponentServiceGetRequest, + "ComponentServiceGetResponse": ComponentServiceGetResponse, + "ComponentServiceDeleteRequest": ComponentServiceDeleteRequest, + "ComponentServiceDeleteResponse": ComponentServiceDeleteResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/component.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/component_pb2.py b/python/metalstack/admin/v2/component_pb2.py deleted file mode 100644 index d689c7af..00000000 --- a/python/metalstack/admin/v2/component_pb2.py +++ /dev/null @@ -1,62 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/component.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/component.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import component_pb2 as metalstack_dot_api_dot_v2_dot_component__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#metalstack/admin/v2/component.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/component.proto\"V\n\x1b\x43omponentServiceListRequest\x12\x37\n\x05query\x18\x01 \x01(\x0b\x32!.metalstack.api.v2.ComponentQueryR\x05query\"\\\n\x1c\x43omponentServiceListResponse\x12<\n\ncomponents\x18\x01 \x03(\x0b\x32\x1c.metalstack.api.v2.ComponentR\ncomponents\":\n\x1a\x43omponentServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"Y\n\x1b\x43omponentServiceGetResponse\x12:\n\tcomponent\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.ComponentR\tcomponent\"=\n\x1d\x43omponentServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\\\n\x1e\x43omponentServiceDeleteResponse\x12:\n\tcomponent\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.ComponentR\tcomponent2\xff\x02\n\x10\x43omponentService\x12t\n\x03Get\x12/.metalstack.admin.v2.ComponentServiceGetRequest\x1a\x30.metalstack.admin.v2.ComponentServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12|\n\x06\x44\x65lete\x12\x32.metalstack.admin.v2.ComponentServiceDeleteRequest\x1a\x33.metalstack.admin.v2.ComponentServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12w\n\x04List\x12\x30.metalstack.admin.v2.ComponentServiceListRequest\x1a\x31.metalstack.admin.v2.ComponentServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd2\x01\n\x17\x63om.metalstack.admin.v2B\x0e\x43omponentProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.component_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\016ComponentProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_COMPONENTSERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_COMPONENTSERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_COMPONENTSERVICEDELETEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_COMPONENTSERVICEDELETEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_COMPONENTSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_COMPONENTSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_COMPONENTSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_COMPONENTSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_COMPONENTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_COMPONENTSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_COMPONENTSERVICELISTREQUEST']._serialized_start=156 - _globals['_COMPONENTSERVICELISTREQUEST']._serialized_end=242 - _globals['_COMPONENTSERVICELISTRESPONSE']._serialized_start=244 - _globals['_COMPONENTSERVICELISTRESPONSE']._serialized_end=336 - _globals['_COMPONENTSERVICEGETREQUEST']._serialized_start=338 - _globals['_COMPONENTSERVICEGETREQUEST']._serialized_end=396 - _globals['_COMPONENTSERVICEGETRESPONSE']._serialized_start=398 - _globals['_COMPONENTSERVICEGETRESPONSE']._serialized_end=487 - _globals['_COMPONENTSERVICEDELETEREQUEST']._serialized_start=489 - _globals['_COMPONENTSERVICEDELETEREQUEST']._serialized_end=550 - _globals['_COMPONENTSERVICEDELETERESPONSE']._serialized_start=552 - _globals['_COMPONENTSERVICEDELETERESPONSE']._serialized_end=644 - _globals['_COMPONENTSERVICE']._serialized_start=647 - _globals['_COMPONENTSERVICE']._serialized_end=1030 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/component_pb2.pyi b/python/metalstack/admin/v2/component_pb2.pyi deleted file mode 100644 index 2921789f..00000000 --- a/python/metalstack/admin/v2/component_pb2.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import component_pb2 as _component_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ComponentServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _component_pb2.ComponentQuery - def __init__(self, query: _Optional[_Union[_component_pb2.ComponentQuery, _Mapping]] = ...) -> None: ... - -class ComponentServiceListResponse(_message.Message): - __slots__ = ("components",) - COMPONENTS_FIELD_NUMBER: _ClassVar[int] - components: _containers.RepeatedCompositeFieldContainer[_component_pb2.Component] - def __init__(self, components: _Optional[_Iterable[_Union[_component_pb2.Component, _Mapping]]] = ...) -> None: ... - -class ComponentServiceGetRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class ComponentServiceGetResponse(_message.Message): - __slots__ = ("component",) - COMPONENT_FIELD_NUMBER: _ClassVar[int] - component: _component_pb2.Component - def __init__(self, component: _Optional[_Union[_component_pb2.Component, _Mapping]] = ...) -> None: ... - -class ComponentServiceDeleteRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class ComponentServiceDeleteResponse(_message.Message): - __slots__ = ("component",) - COMPONENT_FIELD_NUMBER: _ClassVar[int] - component: _component_pb2.Component - def __init__(self, component: _Optional[_Union[_component_pb2.Component, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/filesystem_connect.py b/python/metalstack/admin/v2/filesystem_connect.py index 18b1283d..69fb59fa 100644 --- a/python/metalstack/admin/v2/filesystem_connect.py +++ b/python/metalstack/admin/v2/filesystem_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/filesystem.proto +# Generated from metalstack/admin/v2/filesystem.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.filesystem_pb2 as metalstack_dot_admin_dot_v2_dot_filesystem__pb2 + +from .filesystem_pb import FilesystemServiceCreateRequest, FilesystemServiceCreateResponse, FilesystemServiceDeleteRequest, FilesystemServiceDeleteResponse, FilesystemServiceMatchRequest, FilesystemServiceMatchResponse, FilesystemServiceUpdateRequest, FilesystemServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class FilesystemService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: FilesystemServiceCreateRequest, ctx: RequestContext[FilesystemServiceCreateRequest, FilesystemServiceCreateResponse]) -> FilesystemServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: FilesystemServiceUpdateRequest, ctx: RequestContext[FilesystemServiceUpdateRequest, FilesystemServiceUpdateResponse]) -> FilesystemServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: FilesystemServiceDeleteRequest, ctx: RequestContext[FilesystemServiceDeleteRequest, FilesystemServiceDeleteResponse]) -> FilesystemServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def match(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def match(self, request: FilesystemServiceMatchRequest, ctx: RequestContext[FilesystemServiceMatchRequest, FilesystemServiceMatchResponse]) -> FilesystemServiceMatchResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class FilesystemServiceASGIApplication(ConnectASGIApplication[FilesystemService]): - def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: FilesystemService | AsyncGenerator[FilesystemService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="Create", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse, + input=FilesystemServiceCreateRequest, + output=FilesystemServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -50,8 +66,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="Update", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse, + input=FilesystemServiceUpdateRequest, + output=FilesystemServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -60,8 +76,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse, + input=FilesystemServiceDeleteRequest, + output=FilesystemServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -70,8 +86,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="Match", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse, + input=FilesystemServiceMatchRequest, + output=FilesystemServiceMatchResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.match, @@ -92,18 +108,18 @@ def path(self) -> str: class FilesystemServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, + request: FilesystemServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse: + ) -> FilesystemServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse, + input=FilesystemServiceCreateRequest, + output=FilesystemServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, + request: FilesystemServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse: + ) -> FilesystemServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse, + input=FilesystemServiceUpdateRequest, + output=FilesystemServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, + request: FilesystemServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse: + ) -> FilesystemServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse, + input=FilesystemServiceDeleteRequest, + output=FilesystemServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def delete( async def match( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, + request: FilesystemServiceMatchRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse: + ) -> FilesystemServiceMatchResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Match", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse, + input=FilesystemServiceMatchRequest, + output=FilesystemServiceMatchResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class FilesystemServiceSync(Protocol): + def create(self, request: FilesystemServiceCreateRequest, ctx: RequestContext[FilesystemServiceCreateRequest, FilesystemServiceCreateResponse]) -> FilesystemServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: FilesystemServiceUpdateRequest, ctx: RequestContext[FilesystemServiceUpdateRequest, FilesystemServiceUpdateResponse]) -> FilesystemServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: FilesystemServiceDeleteRequest, ctx: RequestContext[FilesystemServiceDeleteRequest, FilesystemServiceDeleteResponse]) -> FilesystemServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class FilesystemServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def match(self, request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def match(self, request: FilesystemServiceMatchRequest, ctx: RequestContext[FilesystemServiceMatchRequest, FilesystemServiceMatchResponse]) -> FilesystemServiceMatchResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class FilesystemServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: FilesystemServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.FilesystemService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse, + input=FilesystemServiceCreateRequest, + output=FilesystemServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -203,8 +225,8 @@ def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[Interc method=MethodInfo( name="Update", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse, + input=FilesystemServiceUpdateRequest, + output=FilesystemServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -213,8 +235,8 @@ def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[Interc method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse, + input=FilesystemServiceDeleteRequest, + output=FilesystemServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -223,8 +245,8 @@ def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[Interc method=MethodInfo( name="Match", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse, + input=FilesystemServiceMatchRequest, + output=FilesystemServiceMatchResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.match, @@ -245,82 +267,77 @@ def path(self) -> str: class FilesystemServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, + request: FilesystemServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse: + ) -> FilesystemServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceCreateResponse, + input=FilesystemServiceCreateRequest, + output=FilesystemServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, + request: FilesystemServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse: + ) -> FilesystemServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceUpdateResponse, + input=FilesystemServiceUpdateRequest, + output=FilesystemServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, + request: FilesystemServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse: + ) -> FilesystemServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceDeleteResponse, + input=FilesystemServiceDeleteRequest, + output=FilesystemServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def match( self, - request: metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, + request: FilesystemServiceMatchRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse: + ) -> FilesystemServiceMatchResponse: return self.execute_unary( request=request, method=MethodInfo( name="Match", service_name="metalstack.admin.v2.FilesystemService", - input=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchRequest, - output=metalstack_dot_admin_dot_v2_dot_filesystem__pb2.FilesystemServiceMatchResponse, + input=FilesystemServiceMatchRequest, + output=FilesystemServiceMatchResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/filesystem_pb.py b/python/metalstack/admin/v2/filesystem_pb.py new file mode 100644 index 00000000..8b2c6bad --- /dev/null +++ b/python/metalstack/admin/v2/filesystem_pb.py @@ -0,0 +1,459 @@ +# Generated from metalstack/admin/v2/filesystem.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, filesystem_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile, Oneof + + from ...api.v2.common_pb import UpdateMeta + from ...api.v2.filesystem_pb import Disk, Filesystem, FilesystemLayout, FilesystemLayoutConstraints, LogicalVolume, Raid, VolumeGroup + + +_FilesystemServiceCreateRequestFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceCreateRequest(Message[_FilesystemServiceCreateRequestFields]): + """ + FilesystemServiceCreateRequest is the request payload for creating a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceCreateRequest + ``` + + Attributes: + filesystem_layout: + FilesystemLayout is the filesystem layout to create + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + +_FilesystemServiceCreateResponseFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceCreateResponse(Message[_FilesystemServiceCreateResponseFields]): + """ + FilesystemServiceCreateResponse is the response payload for creating a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceCreateResponse + ``` + + Attributes: + filesystem_layout: + FilesystemLayout contains the created filesystem layout + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + +_FilesystemServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints"] + +class FilesystemServiceUpdateRequest(Message[_FilesystemServiceUpdateRequestFields]): + """ + FilesystemServiceUpdateRequest is the request payload for updating a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceUpdateRequest + ``` + + Attributes: + id: + Id of this filesystemLayout + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + name: + Name of this filesystemLayout + + ```proto + optional string name = 3; + ``` + description: + Description of this filesystemLayout + + ```proto + optional string description = 4; + ``` + filesystems: + Filesystems is a list of filesystems to create on a machine + + ```proto + repeated metalstack.api.v2.Filesystem filesystems = 5; + ``` + disks: + Disks list of disks that belong to this layout + + ```proto + repeated metalstack.api.v2.Disk disks = 6; + ``` + raid: + Raid arrays to create + + ```proto + repeated metalstack.api.v2.Raid raid = 7; + ``` + volume_groups: + VolumeGroups list of volumegroups to create + + ```proto + repeated metalstack.api.v2.VolumeGroup volume_groups = 8; + ``` + logical_volumes: + LogicalVolumes list of logicalvolumes to create + + ```proto + repeated metalstack.api.v2.LogicalVolume logical_volumes = 9; + ``` + constraints: + Constraints which must match that this layout is taken, if sizes and images are empty these are develop layouts + + ```proto + optional metalstack.api.v2.FilesystemLayoutConstraints constraints = 10; + ``` + """ + + __slots__ = ("id", "update_meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + name: str | None = None, + description: str | None = None, + filesystems: list[Filesystem] | None = None, + disks: list[Disk] | None = None, + raid: list[Raid] | None = None, + volume_groups: list[VolumeGroup] | None = None, + logical_volumes: list[LogicalVolume] | None = None, + constraints: FilesystemLayoutConstraints | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + name: str + description: str + filesystems: list[Filesystem] + disks: list[Disk] + raid: list[Raid] + volume_groups: list[VolumeGroup] + logical_volumes: list[LogicalVolume] + constraints: FilesystemLayoutConstraints | None + +_FilesystemServiceUpdateResponseFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceUpdateResponse(Message[_FilesystemServiceUpdateResponseFields]): + """ + FilesystemServiceUpdateResponse is the response payload for updating a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceUpdateResponse + ``` + + Attributes: + filesystem_layout: + FilesystemLayout contains the updated filesystem layout + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + +_FilesystemServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class FilesystemServiceDeleteRequest(Message[_FilesystemServiceDeleteRequestFields]): + """ + FilesystemServiceDeleteRequest is the request payload for deleting a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceDeleteRequest + ``` + + Attributes: + id: + ID of the filesystem to delete + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_FilesystemServiceDeleteResponseFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceDeleteResponse(Message[_FilesystemServiceDeleteResponseFields]): + """ + FilesystemServiceDeleteResponse is the response payload for deleting a filesystem. + + ```proto + message metalstack.admin.v2.FilesystemServiceDeleteResponse + ``` + + Attributes: + filesystem_layout: + FilesystemLayout contains the deleted filesystem layout + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + +_FilesystemServiceMatchRequestFields: TypeAlias = Literal["size_and_image", "machine_and_filesystemlayout"] + +class FilesystemServiceMatchRequest(Message[_FilesystemServiceMatchRequestFields]): + """ + FilesystemServiceMatchRequest + + ```proto + message metalstack.admin.v2.FilesystemServiceMatchRequest + ``` + + Attributes: + match: + Match size and image to a filesystem layout + or match a machine to a filesystem layout + + ```proto + oneof match + ``` + """ + + __slots__ = ("match",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + match: Oneof[Literal["size_and_image"], MatchImageAndSize] | Oneof[Literal["machine_and_filesystemlayout"], MatchMachineAndFilesystemLayout] | None = None, + ) -> None: + pass + + match: Oneof[Literal["size_and_image"], MatchImageAndSize] | Oneof[Literal["machine_and_filesystemlayout"], MatchMachineAndFilesystemLayout] | None + +_MatchImageAndSizeFields: TypeAlias = Literal["size", "image"] + +class MatchImageAndSize(Message[_MatchImageAndSizeFields]): + """ + MatchImageAndSize + + ```proto + message metalstack.admin.v2.MatchImageAndSize + ``` + + Attributes: + size: + Size, machine size to try + + ```proto + string size = 1; + ``` + image: + Image machine image to try + + ```proto + string image = 2; + ``` + """ + + __slots__ = ("size", "image") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + image: str = "", + ) -> None: + pass + + size: str + image: str + +_MatchMachineAndFilesystemLayoutFields: TypeAlias = Literal["machine", "filesystem_layout"] + +class MatchMachineAndFilesystemLayout(Message[_MatchMachineAndFilesystemLayoutFields]): + """ + MatchMachineAndFilesystemLayout + + ```proto + message metalstack.admin.v2.MatchMachineAndFilesystemLayout + ``` + + Attributes: + machine: + Machine to check + + ```proto + string machine = 1; + ``` + filesystem_layout: + FilesystemLayout to check + + ```proto + string filesystem_layout = 2; + ``` + """ + + __slots__ = ("machine", "filesystem_layout") + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: str = "", + filesystem_layout: str = "", + ) -> None: + pass + + machine: str + filesystem_layout: str + +_FilesystemServiceMatchResponseFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceMatchResponse(Message[_FilesystemServiceMatchResponseFields]): + """ + FilesystemServiceMatchResponse + + ```proto + message metalstack.admin.v2.FilesystemServiceMatchResponse + ``` + + Attributes: + filesystem_layout: + FilesystemLayout the filesystemlayout + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + + +_DESC = file_desc( + b'\n$metalstack/admin/v2/filesystem.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a"metalstack/api/v2/filesystem.proto\x1a(metalstack/api/v2/predefined_rules.proto"r\n\x1eFilesystemServiceCreateRequest\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout"s\n\x1fFilesystemServiceCreateResponse\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout"\xf7\x04\n\x1eFilesystemServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12?\n\x0bfilesystems\x18\x05 \x03(\x0b2\x1d.metalstack.api.v2.FilesystemR\x0bfilesystems\x12-\n\x05disks\x18\x06 \x03(\x0b2\x17.metalstack.api.v2.DiskR\x05disks\x12+\n\x04raid\x18\x07 \x03(\x0b2\x17.metalstack.api.v2.RaidR\x04raid\x12C\n\rvolume_groups\x18\x08 \x03(\x0b2\x1e.metalstack.api.v2.VolumeGroupR\x0cvolumeGroups\x12I\n\x0flogical_volumes\x18\t \x03(\x0b2 .metalstack.api.v2.LogicalVolumeR\x0elogicalVolumes\x12P\n\x0bconstraints\x18\n \x01(\x0b2..metalstack.api.v2.FilesystemLayoutConstraintsR\x0bconstraintsB\x07\n\x05_nameB\x0e\n\x0c_description"s\n\x1fFilesystemServiceUpdateResponse\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout"=\n\x1eFilesystemServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"s\n\x1fFilesystemServiceDeleteResponse\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout"\xf9\x01\n\x1dFilesystemServiceMatchRequest\x12N\n\x0esize_and_image\x18\x01 \x01(\x0b2&.metalstack.admin.v2.MatchImageAndSizeH\x00R\x0csizeAndImage\x12x\n\x1cmachine_and_filesystemlayout\x18\x02 \x01(\x0b24.metalstack.admin.v2.MatchMachineAndFilesystemLayoutH\x00R\x1amachineAndFilesystemlayoutB\x0e\n\x05match\x12\x05\xbaH\x02\x08\x01"W\n\x11MatchImageAndSize\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12!\n\x05image\x18\x02 \x01(\tR\x05imageB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\x7f\n\x1fMatchMachineAndFilesystemLayout\x12"\n\x07machine\x18\x01 \x01(\tR\x07machineB\x08\xbaH\x05r\x03\xb0\x01\x01\x128\n\x11filesystem_layout\x18\x02 \x01(\tR\x10filesystemLayoutB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"r\n\x1eFilesystemServiceMatchResponse\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout2\x91\x04\n\x11FilesystemService\x12~\n\x06Create\x123.metalstack.admin.v2.FilesystemServiceCreateRequest\x1a4.metalstack.admin.v2.FilesystemServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12~\n\x06Update\x123.metalstack.admin.v2.FilesystemServiceUpdateRequest\x1a4.metalstack.admin.v2.FilesystemServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12~\n\x06Delete\x123.metalstack.admin.v2.FilesystemServiceDeleteRequest\x1a4.metalstack.admin.v2.FilesystemServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x05Match\x122.metalstack.admin.v2.FilesystemServiceMatchRequest\x1a3.metalstack.admin.v2.FilesystemServiceMatchResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd3\x01\n\x17com.metalstack.admin.v2B\x0fFilesystemProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + filesystem_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "FilesystemServiceCreateRequest": FilesystemServiceCreateRequest, + "FilesystemServiceCreateResponse": FilesystemServiceCreateResponse, + "FilesystemServiceUpdateRequest": FilesystemServiceUpdateRequest, + "FilesystemServiceUpdateResponse": FilesystemServiceUpdateResponse, + "FilesystemServiceDeleteRequest": FilesystemServiceDeleteRequest, + "FilesystemServiceDeleteResponse": FilesystemServiceDeleteResponse, + "FilesystemServiceMatchRequest": FilesystemServiceMatchRequest, + "MatchImageAndSize": MatchImageAndSize, + "MatchMachineAndFilesystemLayout": MatchMachineAndFilesystemLayout, + "FilesystemServiceMatchResponse": FilesystemServiceMatchResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/filesystem.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/filesystem_pb2.py b/python/metalstack/admin/v2/filesystem_pb2.py deleted file mode 100644 index 3d5f0e61..00000000 --- a/python/metalstack/admin/v2/filesystem_pb2.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/filesystem.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/filesystem.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import filesystem_pb2 as metalstack_dot_api_dot_v2_dot_filesystem__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$metalstack/admin/v2/filesystem.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\"metalstack/api/v2/filesystem.proto\x1a(metalstack/api/v2/predefined_rules.proto\"r\n\x1e\x46ilesystemServiceCreateRequest\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\"s\n\x1f\x46ilesystemServiceCreateResponse\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\"\xf7\x04\n\x1e\x46ilesystemServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12?\n\x0b\x66ilesystems\x18\x05 \x03(\x0b\x32\x1d.metalstack.api.v2.FilesystemR\x0b\x66ilesystems\x12-\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x17.metalstack.api.v2.DiskR\x05\x64isks\x12+\n\x04raid\x18\x07 \x03(\x0b\x32\x17.metalstack.api.v2.RaidR\x04raid\x12\x43\n\rvolume_groups\x18\x08 \x03(\x0b\x32\x1e.metalstack.api.v2.VolumeGroupR\x0cvolumeGroups\x12I\n\x0flogical_volumes\x18\t \x03(\x0b\x32 .metalstack.api.v2.LogicalVolumeR\x0elogicalVolumes\x12P\n\x0b\x63onstraints\x18\n \x01(\x0b\x32..metalstack.api.v2.FilesystemLayoutConstraintsR\x0b\x63onstraintsB\x07\n\x05_nameB\x0e\n\x0c_description\"s\n\x1f\x46ilesystemServiceUpdateResponse\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\"=\n\x1e\x46ilesystemServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"s\n\x1f\x46ilesystemServiceDeleteResponse\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\"\xf9\x01\n\x1d\x46ilesystemServiceMatchRequest\x12N\n\x0esize_and_image\x18\x01 \x01(\x0b\x32&.metalstack.admin.v2.MatchImageAndSizeH\x00R\x0csizeAndImage\x12x\n\x1cmachine_and_filesystemlayout\x18\x02 \x01(\x0b\x32\x34.metalstack.admin.v2.MatchMachineAndFilesystemLayoutH\x00R\x1amachineAndFilesystemlayoutB\x0e\n\x05match\x12\x05\xbaH\x02\x08\x01\"W\n\x11MatchImageAndSize\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12!\n\x05image\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05image\"\x7f\n\x1fMatchMachineAndFilesystemLayout\x12\"\n\x07machine\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07machine\x12\x38\n\x11\x66ilesystem_layout\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x10\x66ilesystemLayout\"r\n\x1e\x46ilesystemServiceMatchResponse\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout2\x91\x04\n\x11\x46ilesystemService\x12~\n\x06\x43reate\x12\x33.metalstack.admin.v2.FilesystemServiceCreateRequest\x1a\x34.metalstack.admin.v2.FilesystemServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12~\n\x06Update\x12\x33.metalstack.admin.v2.FilesystemServiceUpdateRequest\x1a\x34.metalstack.admin.v2.FilesystemServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12~\n\x06\x44\x65lete\x12\x33.metalstack.admin.v2.FilesystemServiceDeleteRequest\x1a\x34.metalstack.admin.v2.FilesystemServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x05Match\x12\x32.metalstack.admin.v2.FilesystemServiceMatchRequest\x1a\x33.metalstack.admin.v2.FilesystemServiceMatchResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd3\x01\n\x17\x63om.metalstack.admin.v2B\x0f\x46ilesystemProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.filesystem_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\017FilesystemProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_FILESYSTEMSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_FILESYSTEMSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_FILESYSTEMSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMSERVICEMATCHREQUEST'].oneofs_by_name['match']._loaded_options = None - _globals['_FILESYSTEMSERVICEMATCHREQUEST'].oneofs_by_name['match']._serialized_options = b'\272H\002\010\001' - _globals['_MATCHIMAGEANDSIZE'].fields_by_name['size']._loaded_options = None - _globals['_MATCHIMAGEANDSIZE'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MATCHIMAGEANDSIZE'].fields_by_name['image']._loaded_options = None - _globals['_MATCHIMAGEANDSIZE'].fields_by_name['image']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT'].fields_by_name['machine']._loaded_options = None - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT'].fields_by_name['machine']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT'].fields_by_name['filesystem_layout']._loaded_options = None - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT'].fields_by_name['filesystem_layout']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_FILESYSTEMSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_FILESYSTEMSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_FILESYSTEMSERVICE'].methods_by_name['Match']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['Match']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_FILESYSTEMSERVICECREATEREQUEST']._serialized_start=200 - _globals['_FILESYSTEMSERVICECREATEREQUEST']._serialized_end=314 - _globals['_FILESYSTEMSERVICECREATERESPONSE']._serialized_start=316 - _globals['_FILESYSTEMSERVICECREATERESPONSE']._serialized_end=431 - _globals['_FILESYSTEMSERVICEUPDATEREQUEST']._serialized_start=434 - _globals['_FILESYSTEMSERVICEUPDATEREQUEST']._serialized_end=1065 - _globals['_FILESYSTEMSERVICEUPDATERESPONSE']._serialized_start=1067 - _globals['_FILESYSTEMSERVICEUPDATERESPONSE']._serialized_end=1182 - _globals['_FILESYSTEMSERVICEDELETEREQUEST']._serialized_start=1184 - _globals['_FILESYSTEMSERVICEDELETEREQUEST']._serialized_end=1245 - _globals['_FILESYSTEMSERVICEDELETERESPONSE']._serialized_start=1247 - _globals['_FILESYSTEMSERVICEDELETERESPONSE']._serialized_end=1362 - _globals['_FILESYSTEMSERVICEMATCHREQUEST']._serialized_start=1365 - _globals['_FILESYSTEMSERVICEMATCHREQUEST']._serialized_end=1614 - _globals['_MATCHIMAGEANDSIZE']._serialized_start=1616 - _globals['_MATCHIMAGEANDSIZE']._serialized_end=1703 - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT']._serialized_start=1705 - _globals['_MATCHMACHINEANDFILESYSTEMLAYOUT']._serialized_end=1832 - _globals['_FILESYSTEMSERVICEMATCHRESPONSE']._serialized_start=1834 - _globals['_FILESYSTEMSERVICEMATCHRESPONSE']._serialized_end=1948 - _globals['_FILESYSTEMSERVICE']._serialized_start=1951 - _globals['_FILESYSTEMSERVICE']._serialized_end=2480 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/filesystem_pb2.pyi b/python/metalstack/admin/v2/filesystem_pb2.pyi deleted file mode 100644 index 8ece5fca..00000000 --- a/python/metalstack/admin/v2/filesystem_pb2.pyi +++ /dev/null @@ -1,95 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import filesystem_pb2 as _filesystem_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class FilesystemServiceCreateRequest(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: _filesystem_pb2.FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ...) -> None: ... - -class FilesystemServiceCreateResponse(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: _filesystem_pb2.FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ...) -> None: ... - -class FilesystemServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - FILESYSTEMS_FIELD_NUMBER: _ClassVar[int] - DISKS_FIELD_NUMBER: _ClassVar[int] - RAID_FIELD_NUMBER: _ClassVar[int] - VOLUME_GROUPS_FIELD_NUMBER: _ClassVar[int] - LOGICAL_VOLUMES_FIELD_NUMBER: _ClassVar[int] - CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - name: str - description: str - filesystems: _containers.RepeatedCompositeFieldContainer[_filesystem_pb2.Filesystem] - disks: _containers.RepeatedCompositeFieldContainer[_filesystem_pb2.Disk] - raid: _containers.RepeatedCompositeFieldContainer[_filesystem_pb2.Raid] - volume_groups: _containers.RepeatedCompositeFieldContainer[_filesystem_pb2.VolumeGroup] - logical_volumes: _containers.RepeatedCompositeFieldContainer[_filesystem_pb2.LogicalVolume] - constraints: _filesystem_pb2.FilesystemLayoutConstraints - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., filesystems: _Optional[_Iterable[_Union[_filesystem_pb2.Filesystem, _Mapping]]] = ..., disks: _Optional[_Iterable[_Union[_filesystem_pb2.Disk, _Mapping]]] = ..., raid: _Optional[_Iterable[_Union[_filesystem_pb2.Raid, _Mapping]]] = ..., volume_groups: _Optional[_Iterable[_Union[_filesystem_pb2.VolumeGroup, _Mapping]]] = ..., logical_volumes: _Optional[_Iterable[_Union[_filesystem_pb2.LogicalVolume, _Mapping]]] = ..., constraints: _Optional[_Union[_filesystem_pb2.FilesystemLayoutConstraints, _Mapping]] = ...) -> None: ... - -class FilesystemServiceUpdateResponse(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: _filesystem_pb2.FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ...) -> None: ... - -class FilesystemServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class FilesystemServiceDeleteResponse(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: _filesystem_pb2.FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ...) -> None: ... - -class FilesystemServiceMatchRequest(_message.Message): - __slots__ = ("size_and_image", "machine_and_filesystemlayout") - SIZE_AND_IMAGE_FIELD_NUMBER: _ClassVar[int] - MACHINE_AND_FILESYSTEMLAYOUT_FIELD_NUMBER: _ClassVar[int] - size_and_image: MatchImageAndSize - machine_and_filesystemlayout: MatchMachineAndFilesystemLayout - def __init__(self, size_and_image: _Optional[_Union[MatchImageAndSize, _Mapping]] = ..., machine_and_filesystemlayout: _Optional[_Union[MatchMachineAndFilesystemLayout, _Mapping]] = ...) -> None: ... - -class MatchImageAndSize(_message.Message): - __slots__ = ("size", "image") - SIZE_FIELD_NUMBER: _ClassVar[int] - IMAGE_FIELD_NUMBER: _ClassVar[int] - size: str - image: str - def __init__(self, size: _Optional[str] = ..., image: _Optional[str] = ...) -> None: ... - -class MatchMachineAndFilesystemLayout(_message.Message): - __slots__ = ("machine", "filesystem_layout") - MACHINE_FIELD_NUMBER: _ClassVar[int] - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - machine: str - filesystem_layout: str - def __init__(self, machine: _Optional[str] = ..., filesystem_layout: _Optional[str] = ...) -> None: ... - -class FilesystemServiceMatchResponse(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: _filesystem_pb2.FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/image_connect.py b/python/metalstack/admin/v2/image_connect.py index dc7f25c0..1b021a9f 100644 --- a/python/metalstack/admin/v2/image_connect.py +++ b/python/metalstack/admin/v2/image_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/image.proto +# Generated from metalstack/admin/v2/image.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.image_pb2 as metalstack_dot_admin_dot_v2_dot_image__pb2 + +from .image_pb import ImageServiceCreateRequest, ImageServiceCreateResponse, ImageServiceDeleteRequest, ImageServiceDeleteResponse, ImageServiceUpdateRequest, ImageServiceUpdateResponse, ImageServiceUsageRequest, ImageServiceUsageResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ImageService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: ImageServiceCreateRequest, ctx: RequestContext[ImageServiceCreateRequest, ImageServiceCreateResponse]) -> ImageServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: ImageServiceUpdateRequest, ctx: RequestContext[ImageServiceUpdateRequest, ImageServiceUpdateResponse]) -> ImageServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: ImageServiceDeleteRequest, ctx: RequestContext[ImageServiceDeleteRequest, ImageServiceDeleteResponse]) -> ImageServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def usage(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def usage(self, request: ImageServiceUsageRequest, ctx: RequestContext[ImageServiceUsageRequest, ImageServiceUsageResponse]) -> ImageServiceUsageResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ImageServiceASGIApplication(ConnectASGIApplication[ImageService]): - def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ImageService | AsyncGenerator[ImageService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Create", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse, + input=ImageServiceCreateRequest, + output=ImageServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -50,8 +66,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Update", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse, + input=ImageServiceUpdateRequest, + output=ImageServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -60,8 +76,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse, + input=ImageServiceDeleteRequest, + output=ImageServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -70,8 +86,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Usage", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse, + input=ImageServiceUsageRequest, + output=ImageServiceUsageResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.usage, @@ -92,18 +108,18 @@ def path(self) -> str: class ImageServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, + request: ImageServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse: + ) -> ImageServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse, + input=ImageServiceCreateRequest, + output=ImageServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, + request: ImageServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse: + ) -> ImageServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse, + input=ImageServiceUpdateRequest, + output=ImageServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, + request: ImageServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse: + ) -> ImageServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse, + input=ImageServiceDeleteRequest, + output=ImageServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def delete( async def usage( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, + request: ImageServiceUsageRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse: + ) -> ImageServiceUsageResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Usage", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse, + input=ImageServiceUsageRequest, + output=ImageServiceUsageResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class ImageServiceSync(Protocol): + def create(self, request: ImageServiceCreateRequest, ctx: RequestContext[ImageServiceCreateRequest, ImageServiceCreateResponse]) -> ImageServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: ImageServiceUpdateRequest, ctx: RequestContext[ImageServiceUpdateRequest, ImageServiceUpdateResponse]) -> ImageServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: ImageServiceDeleteRequest, ctx: RequestContext[ImageServiceDeleteRequest, ImageServiceDeleteResponse]) -> ImageServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class ImageServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def usage(self, request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def usage(self, request: ImageServiceUsageRequest, ctx: RequestContext[ImageServiceUsageRequest, ImageServiceUsageResponse]) -> ImageServiceUsageResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ImageServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ImageServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ImageServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.ImageService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse, + input=ImageServiceCreateRequest, + output=ImageServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -203,8 +225,8 @@ def __init__(self, service: ImageServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Update", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse, + input=ImageServiceUpdateRequest, + output=ImageServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -213,8 +235,8 @@ def __init__(self, service: ImageServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse, + input=ImageServiceDeleteRequest, + output=ImageServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -223,8 +245,8 @@ def __init__(self, service: ImageServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Usage", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse, + input=ImageServiceUsageRequest, + output=ImageServiceUsageResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.usage, @@ -245,82 +267,77 @@ def path(self) -> str: class ImageServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, + request: ImageServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse: + ) -> ImageServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceCreateResponse, + input=ImageServiceCreateRequest, + output=ImageServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, + request: ImageServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse: + ) -> ImageServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUpdateResponse, + input=ImageServiceUpdateRequest, + output=ImageServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, + request: ImageServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse: + ) -> ImageServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceDeleteResponse, + input=ImageServiceDeleteRequest, + output=ImageServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def usage( self, - request: metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, + request: ImageServiceUsageRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse: + ) -> ImageServiceUsageResponse: return self.execute_unary( request=request, method=MethodInfo( name="Usage", service_name="metalstack.admin.v2.ImageService", - input=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageRequest, - output=metalstack_dot_admin_dot_v2_dot_image__pb2.ImageServiceUsageResponse, + input=ImageServiceUsageRequest, + output=ImageServiceUsageResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/image_pb.py b/python/metalstack/admin/v2/image_pb.py new file mode 100644 index 00000000..48a2398a --- /dev/null +++ b/python/metalstack/admin/v2/image_pb.py @@ -0,0 +1,363 @@ +# Generated from metalstack/admin/v2/image.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, image_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from ...api.v2.common_pb import UpdateMeta + from ...api.v2.image_pb import Image, ImageClassification, ImageFeature, ImageQuery, ImageUsage + + +_ImageServiceCreateRequestFields: TypeAlias = Literal["image"] + +class ImageServiceCreateRequest(Message[_ImageServiceCreateRequestFields]): + """ + ImageServiceCreateRequest is the request payload for creating an image. + + ```proto + message metalstack.admin.v2.ImageServiceCreateRequest + ``` + + Attributes: + image: + Image is the image to create + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageServiceCreateResponseFields: TypeAlias = Literal["image"] + +class ImageServiceCreateResponse(Message[_ImageServiceCreateResponseFields]): + """ + ImageServiceCreateResponse is the response payload for creating an image. + + ```proto + message metalstack.admin.v2.ImageServiceCreateResponse + ``` + + Attributes: + image: + Image contains the created image + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "url", "name", "description", "features", "classification", "expires_at"] + +class ImageServiceUpdateRequest(Message[_ImageServiceUpdateRequestFields]): + """ + ImageServiceUpdateRequest is the request payload for updating an image. + + ```proto + message metalstack.admin.v2.ImageServiceUpdateRequest + ``` + + Attributes: + id: + Id of this image + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + url: + URL where this image is located + + ```proto + optional string url = 3; + ``` + name: + Name of this image + + ```proto + optional string name = 4; + ``` + description: + Description of this image + + ```proto + optional string description = 5; + ``` + features: + Features of this image + + ```proto + repeated metalstack.api.v2.ImageFeature features = 6 [packed = true]; + ``` + classification: + Classification of this image + + ```proto + metalstack.api.v2.ImageClassification classification = 7; + ``` + expires_at: + ExpiresAt indicates that usage is not possible after this date + + ```proto + optional google.protobuf.Timestamp expires_at = 8; + ``` + """ + + __slots__ = ("id", "update_meta", "url", "name", "description", "features", "classification", "expires_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + url: str | None = None, + name: str | None = None, + description: str | None = None, + features: list[ImageFeature] | None = None, + classification: ImageClassification | None = None, + expires_at: Timestamp | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + url: str + name: str + description: str + features: list[ImageFeature] + classification: ImageClassification + expires_at: Timestamp | None + +_ImageServiceUpdateResponseFields: TypeAlias = Literal["image"] + +class ImageServiceUpdateResponse(Message[_ImageServiceUpdateResponseFields]): + """ + ImageServiceUpdateResponse is the response payload for updating an image. + + ```proto + message metalstack.admin.v2.ImageServiceUpdateResponse + ``` + + Attributes: + image: + Image contains the updated image + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class ImageServiceDeleteRequest(Message[_ImageServiceDeleteRequestFields]): + """ + ImageServiceDeleteRequest is the request payload for deleting an image. + + ```proto + message metalstack.admin.v2.ImageServiceDeleteRequest + ``` + + Attributes: + id: + ID of the image to delete + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_ImageServiceDeleteResponseFields: TypeAlias = Literal["image"] + +class ImageServiceDeleteResponse(Message[_ImageServiceDeleteResponseFields]): + """ + ImageServiceDeleteResponse is the response payload for deleting an image. + + ```proto + message metalstack.admin.v2.ImageServiceDeleteResponse + ``` + + Attributes: + image: + Image contains the deleted image + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageServiceUsageRequestFields: TypeAlias = Literal["query"] + +class ImageServiceUsageRequest(Message[_ImageServiceUsageRequestFields]): + """ + ImageServiceUsageRequest is the request payload for getting image usage. + + ```proto + message metalstack.admin.v2.ImageServiceUsageRequest + ``` + + Attributes: + query: + Query for which images the usage should be reported + + ```proto + optional metalstack.api.v2.ImageQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: ImageQuery | None = None, + ) -> None: + pass + + query: ImageQuery | None + +_ImageServiceUsageResponseFields: TypeAlias = Literal["image_usage"] + +class ImageServiceUsageResponse(Message[_ImageServiceUsageResponseFields]): + """ + ImageServiceUsageResponse is the response payload for getting image usage. + + ```proto + message metalstack.admin.v2.ImageServiceUsageResponse + ``` + + Attributes: + image_usage: + Images contains usage information + + ```proto + repeated metalstack.api.v2.ImageUsage image_usage = 1; + ``` + """ + + __slots__ = ("image_usage",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image_usage: list[ImageUsage] | None = None, + ) -> None: + pass + + image_usage: list[ImageUsage] + + +_DESC = file_desc( + b'\n\x1fmetalstack/admin/v2/image.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1dmetalstack/api/v2/image.proto\x1a(metalstack/api/v2/predefined_rules.proto"K\n\x19ImageServiceCreateRequest\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"L\n\x1aImageServiceCreateResponse\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"\x82\x04\n\x19ImageServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12"\n\x03url\x18\x03 \x01(\tH\x00R\x03urlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12L\n\x08features\x18\x06 \x03(\x0e2\x1f.metalstack.api.v2.ImageFeatureR\x08featuresB\x0f\xbaH\x0c\x92\x01\t\x18\x01"\x05\x82\x01\x02\x10\x01\x12X\n\x0eclassification\x18\x07 \x01(\x0e2&.metalstack.api.v2.ImageClassificationR\x0eclassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01\x129\n\nexpires_at\x18\x08 \x01(\x0b2\x1a.google.protobuf.TimestampR\texpiresAtB\x06\n\x04_urlB\x07\n\x05_nameB\x0e\n\x0c_description"L\n\x1aImageServiceUpdateResponse\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"8\n\x19ImageServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"L\n\x1aImageServiceDeleteResponse\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"O\n\x18ImageServiceUsageRequest\x123\n\x05query\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.ImageQueryR\x05query"[\n\x19ImageServiceUsageResponse\x12>\n\x0bimage_usage\x18\x01 \x03(\x0b2\x1d.metalstack.api.v2.ImageUsageR\nimageUsage2\xe4\x03\n\x0cImageService\x12t\n\x06Create\x12..metalstack.admin.v2.ImageServiceCreateRequest\x1a/.metalstack.admin.v2.ImageServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Update\x12..metalstack.admin.v2.ImageServiceUpdateRequest\x1a/.metalstack.admin.v2.ImageServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Delete\x12..metalstack.admin.v2.ImageServiceDeleteRequest\x1a/.metalstack.admin.v2.ImageServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x05Usage\x12-.metalstack.admin.v2.ImageServiceUsageRequest\x1a..metalstack.admin.v2.ImageServiceUsageResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xce\x01\n\x17com.metalstack.admin.v2B\nImageProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + image_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "ImageServiceCreateRequest": ImageServiceCreateRequest, + "ImageServiceCreateResponse": ImageServiceCreateResponse, + "ImageServiceUpdateRequest": ImageServiceUpdateRequest, + "ImageServiceUpdateResponse": ImageServiceUpdateResponse, + "ImageServiceDeleteRequest": ImageServiceDeleteRequest, + "ImageServiceDeleteResponse": ImageServiceDeleteResponse, + "ImageServiceUsageRequest": ImageServiceUsageRequest, + "ImageServiceUsageResponse": ImageServiceUsageResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/image.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/image_pb2.py b/python/metalstack/admin/v2/image_pb2.py deleted file mode 100644 index b115c6b5..00000000 --- a/python/metalstack/admin/v2/image_pb2.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/image.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/image.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import image_pb2 as metalstack_dot_api_dot_v2_dot_image__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/admin/v2/image.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1dmetalstack/api/v2/image.proto\x1a(metalstack/api/v2/predefined_rules.proto\"K\n\x19ImageServiceCreateRequest\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"L\n\x1aImageServiceCreateResponse\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"\x82\x04\n\x19ImageServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\"\n\x03url\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x00R\x03url\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12L\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0e\x32\x1f.metalstack.api.v2.ImageFeatureB\x0f\xbaH\x0c\x92\x01\t\x18\x01\"\x05\x82\x01\x02\x10\x01R\x08\x66\x65\x61tures\x12X\n\x0e\x63lassification\x18\x07 \x01(\x0e\x32&.metalstack.api.v2.ImageClassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0e\x63lassification\x12\x39\n\nexpires_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAtB\x06\n\x04_urlB\x07\n\x05_nameB\x0e\n\x0c_description\"L\n\x1aImageServiceUpdateResponse\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"8\n\x19ImageServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"L\n\x1aImageServiceDeleteResponse\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"O\n\x18ImageServiceUsageRequest\x12\x33\n\x05query\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.ImageQueryR\x05query\"[\n\x19ImageServiceUsageResponse\x12>\n\x0bimage_usage\x18\x01 \x03(\x0b\x32\x1d.metalstack.api.v2.ImageUsageR\nimageUsage2\xe4\x03\n\x0cImageService\x12t\n\x06\x43reate\x12..metalstack.admin.v2.ImageServiceCreateRequest\x1a/.metalstack.admin.v2.ImageServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Update\x12..metalstack.admin.v2.ImageServiceUpdateRequest\x1a/.metalstack.admin.v2.ImageServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06\x44\x65lete\x12..metalstack.admin.v2.ImageServiceDeleteRequest\x1a/.metalstack.admin.v2.ImageServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x05Usage\x12-.metalstack.admin.v2.ImageServiceUsageRequest\x1a..metalstack.admin.v2.ImageServiceUsageResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xce\x01\n\x17\x63om.metalstack.admin.v2B\nImageProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.image_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\nImageProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['url']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['features']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['features']._serialized_options = b'\272H\014\222\001\t\030\001\"\005\202\001\002\020\001' - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['classification']._loaded_options = None - _globals['_IMAGESERVICEUPDATEREQUEST'].fields_by_name['classification']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IMAGESERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_IMAGESERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGESERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_IMAGESERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_IMAGESERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_IMAGESERVICE'].methods_by_name['Usage']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Usage']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_IMAGESERVICECREATEREQUEST']._serialized_start=223 - _globals['_IMAGESERVICECREATEREQUEST']._serialized_end=298 - _globals['_IMAGESERVICECREATERESPONSE']._serialized_start=300 - _globals['_IMAGESERVICECREATERESPONSE']._serialized_end=376 - _globals['_IMAGESERVICEUPDATEREQUEST']._serialized_start=379 - _globals['_IMAGESERVICEUPDATEREQUEST']._serialized_end=893 - _globals['_IMAGESERVICEUPDATERESPONSE']._serialized_start=895 - _globals['_IMAGESERVICEUPDATERESPONSE']._serialized_end=971 - _globals['_IMAGESERVICEDELETEREQUEST']._serialized_start=973 - _globals['_IMAGESERVICEDELETEREQUEST']._serialized_end=1029 - _globals['_IMAGESERVICEDELETERESPONSE']._serialized_start=1031 - _globals['_IMAGESERVICEDELETERESPONSE']._serialized_end=1107 - _globals['_IMAGESERVICEUSAGEREQUEST']._serialized_start=1109 - _globals['_IMAGESERVICEUSAGEREQUEST']._serialized_end=1188 - _globals['_IMAGESERVICEUSAGERESPONSE']._serialized_start=1190 - _globals['_IMAGESERVICEUSAGERESPONSE']._serialized_end=1281 - _globals['_IMAGESERVICE']._serialized_start=1284 - _globals['_IMAGESERVICE']._serialized_end=1768 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/image_pb2.pyi b/python/metalstack/admin/v2/image_pb2.pyi deleted file mode 100644 index 205e60e3..00000000 --- a/python/metalstack/admin/v2/image_pb2.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import image_pb2 as _image_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ImageServiceCreateRequest(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: _image_pb2.Image - def __init__(self, image: _Optional[_Union[_image_pb2.Image, _Mapping]] = ...) -> None: ... - -class ImageServiceCreateResponse(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: _image_pb2.Image - def __init__(self, image: _Optional[_Union[_image_pb2.Image, _Mapping]] = ...) -> None: ... - -class ImageServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "url", "name", "description", "features", "classification", "expires_at") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - FEATURES_FIELD_NUMBER: _ClassVar[int] - CLASSIFICATION_FIELD_NUMBER: _ClassVar[int] - EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - url: str - name: str - description: str - features: _containers.RepeatedScalarFieldContainer[_image_pb2.ImageFeature] - classification: _image_pb2.ImageClassification - expires_at: _timestamp_pb2.Timestamp - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., url: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., features: _Optional[_Iterable[_Union[_image_pb2.ImageFeature, str]]] = ..., classification: _Optional[_Union[_image_pb2.ImageClassification, str]] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class ImageServiceUpdateResponse(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: _image_pb2.Image - def __init__(self, image: _Optional[_Union[_image_pb2.Image, _Mapping]] = ...) -> None: ... - -class ImageServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class ImageServiceDeleteResponse(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: _image_pb2.Image - def __init__(self, image: _Optional[_Union[_image_pb2.Image, _Mapping]] = ...) -> None: ... - -class ImageServiceUsageRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _image_pb2.ImageQuery - def __init__(self, query: _Optional[_Union[_image_pb2.ImageQuery, _Mapping]] = ...) -> None: ... - -class ImageServiceUsageResponse(_message.Message): - __slots__ = ("image_usage",) - IMAGE_USAGE_FIELD_NUMBER: _ClassVar[int] - image_usage: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUsage] - def __init__(self, image_usage: _Optional[_Iterable[_Union[_image_pb2.ImageUsage, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/ip_connect.py b/python/metalstack/admin/v2/ip_connect.py index 2eab3807..bc235c8f 100644 --- a/python/metalstack/admin/v2/ip_connect.py +++ b/python/metalstack/admin/v2/ip_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/ip.proto +# Generated from metalstack/admin/v2/ip.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.ip_pb2 as metalstack_dot_admin_dot_v2_dot_ip__pb2 + +from .ip_pb import IPServiceListRequest, IPServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class IPService(Protocol): - async def list(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: IPServiceListRequest, ctx: RequestContext[IPServiceListRequest, IPServiceListResponse]) -> IPServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class IPServiceASGIApplication(ConnectASGIApplication[IPService]): - def __init__(self, service: IPService | AsyncGenerator[IPService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: IPService | AsyncGenerator[IPService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="List", service_name="metalstack.admin.v2.IPService", - input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -53,43 +69,46 @@ def path(self) -> str: class IPServiceClient(ConnectClient): async def list( self, - request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, + request: IPServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: + ) -> IPServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.IPService", - input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class IPServiceSync(Protocol): - def list(self, request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: IPServiceListRequest, ctx: RequestContext[IPServiceListRequest, IPServiceListResponse]) -> IPServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class IPServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: IPServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.IPService/List": EndpointSync.unary( method=MethodInfo( name="List", service_name="metalstack.admin.v2.IPService", - input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -110,22 +129,20 @@ def path(self) -> str: class IPServiceClientSync(ConnectClientSync): def list( self, - request: metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, + request: IPServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse: + ) -> IPServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.IPService", - input=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/ip_pb.py b/python/metalstack/admin/v2/ip_pb.py new file mode 100644 index 00000000..01901109 --- /dev/null +++ b/python/metalstack/admin/v2/ip_pb.py @@ -0,0 +1,102 @@ +# Generated from metalstack/admin/v2/ip.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ...api.v2 import common_pb, ip_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.ip_pb import IP, IPQuery + + +_IPServiceListRequestFields: TypeAlias = Literal["query"] + +class IPServiceListRequest(Message[_IPServiceListRequestFields]): + """ + IPServiceListRequest is the request payload for listing IP addresses. + + ```proto + message metalstack.admin.v2.IPServiceListRequest + ``` + + Attributes: + query: + Query to search for IP addresses + + ```proto + optional metalstack.api.v2.IPQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: IPQuery | None = None, + ) -> None: + pass + + query: IPQuery | None + +_IPServiceListResponseFields: TypeAlias = Literal["ips"] + +class IPServiceListResponse(Message[_IPServiceListResponseFields]): + """ + IPServiceListResponse is the response payload for listing IP addresses. + + ```proto + message metalstack.admin.v2.IPServiceListResponse + ``` + + Attributes: + ips: + IPs contains the list of IP addresses + + ```proto + repeated metalstack.api.v2.IP ips = 1; + ``` + """ + + __slots__ = ("ips",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ips: list[IP] | None = None, + ) -> None: + pass + + ips: list[IP] + + +_DESC = file_desc( + b'\n\x1cmetalstack/admin/v2/ip.proto\x12\x13metalstack.admin.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1ametalstack/api/v2/ip.proto"H\n\x14IPServiceListRequest\x120\n\x05query\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.IPQueryR\x05query"@\n\x15IPServiceListResponse\x12\'\n\x03ips\x18\x01 \x03(\x0b2\x15.metalstack.api.v2.IPR\x03ips2v\n\tIPService\x12i\n\x04List\x12).metalstack.admin.v2.IPServiceListRequest\x1a*.metalstack.admin.v2.IPServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xcb\x01\n\x17com.metalstack.admin.v2B\x07IpProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + common_pb.desc(), + ip_pb.desc(), + ], + { + "IPServiceListRequest": IPServiceListRequest, + "IPServiceListResponse": IPServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/ip.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/ip_pb2.py b/python/metalstack/admin/v2/ip_pb2.py deleted file mode 100644 index 9c060e08..00000000 --- a/python/metalstack/admin/v2/ip_pb2.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/ip.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/ip.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import ip_pb2 as metalstack_dot_api_dot_v2_dot_ip__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cmetalstack/admin/v2/ip.proto\x12\x13metalstack.admin.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1ametalstack/api/v2/ip.proto\"H\n\x14IPServiceListRequest\x12\x30\n\x05query\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.IPQueryR\x05query\"@\n\x15IPServiceListResponse\x12\'\n\x03ips\x18\x01 \x03(\x0b\x32\x15.metalstack.api.v2.IPR\x03ips2v\n\tIPService\x12i\n\x04List\x12).metalstack.admin.v2.IPServiceListRequest\x1a*.metalstack.admin.v2.IPServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xcb\x01\n\x17\x63om.metalstack.admin.v2B\x07IpProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.ip_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\007IpProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_IPSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_IPSERVICELISTREQUEST']._serialized_start=113 - _globals['_IPSERVICELISTREQUEST']._serialized_end=185 - _globals['_IPSERVICELISTRESPONSE']._serialized_start=187 - _globals['_IPSERVICELISTRESPONSE']._serialized_end=251 - _globals['_IPSERVICE']._serialized_start=253 - _globals['_IPSERVICE']._serialized_end=371 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/ip_pb2.pyi b/python/metalstack/admin/v2/ip_pb2.pyi deleted file mode 100644 index df572a5e..00000000 --- a/python/metalstack/admin/v2/ip_pb2.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import ip_pb2 as _ip_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class IPServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _ip_pb2.IPQuery - def __init__(self, query: _Optional[_Union[_ip_pb2.IPQuery, _Mapping]] = ...) -> None: ... - -class IPServiceListResponse(_message.Message): - __slots__ = ("ips",) - IPS_FIELD_NUMBER: _ClassVar[int] - ips: _containers.RepeatedCompositeFieldContainer[_ip_pb2.IP] - def __init__(self, ips: _Optional[_Iterable[_Union[_ip_pb2.IP, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/machine_connect.py b/python/metalstack/admin/v2/machine_connect.py index 80933712..6479769b 100644 --- a/python/metalstack/admin/v2/machine_connect.py +++ b/python/metalstack/admin/v2/machine_connect.py @@ -1,53 +1,69 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/machine.proto +# Generated from metalstack/admin/v2/machine.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.machine_pb2 as metalstack_dot_admin_dot_v2_dot_machine__pb2 + +from .machine_pb import MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse, MachineServiceConsolePasswordRequest, MachineServiceConsolePasswordResponse, MachineServiceDeleteRequest, MachineServiceDeleteResponse, MachineServiceGetBMCRequest, MachineServiceGetBMCResponse, MachineServiceGetRequest, MachineServiceGetResponse, MachineServiceIssuesRequest, MachineServiceIssuesResponse, MachineServiceListBMCRequest, MachineServiceListBMCResponse, MachineServiceListRequest, MachineServiceListResponse, MachineServiceSetStateRequest, MachineServiceSetStateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class MachineService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: MachineServiceGetRequest, ctx: RequestContext[MachineServiceGetRequest, MachineServiceGetResponse]) -> MachineServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: MachineServiceListRequest, ctx: RequestContext[MachineServiceListRequest, MachineServiceListResponse]) -> MachineServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: MachineServiceDeleteRequest, ctx: RequestContext[MachineServiceDeleteRequest, MachineServiceDeleteResponse]) -> MachineServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def b_m_c_command(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def bmc_command(self, request: MachineServiceBMCCommandRequest, ctx: RequestContext[MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse]) -> MachineServiceBMCCommandResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def get_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get_bmc(self, request: MachineServiceGetBMCRequest, ctx: RequestContext[MachineServiceGetBMCRequest, MachineServiceGetBMCResponse]) -> MachineServiceGetBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list_bmc(self, request: MachineServiceListBMCRequest, ctx: RequestContext[MachineServiceListBMCRequest, MachineServiceListBMCResponse]) -> MachineServiceListBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def console_password(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def console_password(self, request: MachineServiceConsolePasswordRequest, ctx: RequestContext[MachineServiceConsolePasswordRequest, MachineServiceConsolePasswordResponse]) -> MachineServiceConsolePasswordResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def set_state(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def set_state(self, request: MachineServiceSetStateRequest, ctx: RequestContext[MachineServiceSetStateRequest, MachineServiceSetStateResponse]) -> MachineServiceSetStateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def issues(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def issues(self, request: MachineServiceIssuesRequest, ctx: RequestContext[MachineServiceIssuesRequest, MachineServiceIssuesResponse]) -> MachineServiceIssuesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MachineServiceASGIApplication(ConnectASGIApplication[MachineService]): - def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MachineService | AsyncGenerator[MachineService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -55,8 +71,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -65,8 +81,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="List", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -75,8 +91,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -85,38 +101,38 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="BMCCommand", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.b_m_c_command, + function=svc.bmc_command, ), "/metalstack.admin.v2.MachineService/GetBMC": Endpoint.unary( method=MethodInfo( name="GetBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.get_b_m_c, + function=svc.get_bmc, ), "/metalstack.admin.v2.MachineService/ListBMC": Endpoint.unary( method=MethodInfo( name="ListBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse, + input=MachineServiceListBMCRequest, + output=MachineServiceListBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.list_b_m_c, + function=svc.list_bmc, ), "/metalstack.admin.v2.MachineService/ConsolePassword": Endpoint.unary( method=MethodInfo( name="ConsolePassword", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse, + input=MachineServiceConsolePasswordRequest, + output=MachineServiceConsolePasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.console_password, @@ -125,8 +141,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="SetState", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + input=MachineServiceSetStateRequest, + output=MachineServiceSetStateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.set_state, @@ -135,8 +151,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Issues", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse, + input=MachineServiceIssuesRequest, + output=MachineServiceIssuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.issues, @@ -157,18 +173,18 @@ def path(self) -> str: class MachineServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, + request: MachineServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: + ) -> MachineServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -177,18 +193,18 @@ async def get( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, + request: MachineServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: + ) -> MachineServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -197,78 +213,78 @@ async def list( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, + request: MachineServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: + ) -> MachineServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def b_m_c_command( + async def bmc_command( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, + request: MachineServiceBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: + ) -> MachineServiceBMCCommandResponse: return await self.execute_unary( request=request, method=MethodInfo( name="BMCCommand", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def get_b_m_c( + async def get_bmc( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, + request: MachineServiceGetBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: + ) -> MachineServiceGetBMCResponse: return await self.execute_unary( request=request, method=MethodInfo( name="GetBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def list_b_m_c( + async def list_bmc( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, + request: MachineServiceListBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse: + ) -> MachineServiceListBMCResponse: return await self.execute_unary( request=request, method=MethodInfo( name="ListBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse, + input=MachineServiceListBMCRequest, + output=MachineServiceListBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -277,18 +293,18 @@ async def list_b_m_c( async def console_password( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, + request: MachineServiceConsolePasswordRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: + ) -> MachineServiceConsolePasswordResponse: return await self.execute_unary( request=request, method=MethodInfo( name="ConsolePassword", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse, + input=MachineServiceConsolePasswordRequest, + output=MachineServiceConsolePasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -297,18 +313,18 @@ async def console_password( async def set_state( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + request: MachineServiceSetStateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + ) -> MachineServiceSetStateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="SetState", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + input=MachineServiceSetStateRequest, + output=MachineServiceSetStateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -317,59 +333,70 @@ async def set_state( async def issues( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, + request: MachineServiceIssuesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse: + ) -> MachineServiceIssuesResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Issues", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse, + input=MachineServiceIssuesRequest, + output=MachineServiceIssuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class MachineServiceSync(Protocol): + def get(self, request: MachineServiceGetRequest, ctx: RequestContext[MachineServiceGetRequest, MachineServiceGetResponse]) -> MachineServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: MachineServiceListRequest, ctx: RequestContext[MachineServiceListRequest, MachineServiceListResponse]) -> MachineServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: MachineServiceDeleteRequest, ctx: RequestContext[MachineServiceDeleteRequest, MachineServiceDeleteResponse]) -> MachineServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def bmc_command(self, request: MachineServiceBMCCommandRequest, ctx: RequestContext[MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse]) -> MachineServiceBMCCommandResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class MachineServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def b_m_c_command(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def get_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list_b_m_c(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def console_password(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def set_state(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def issues(self, request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get_bmc(self, request: MachineServiceGetBMCRequest, ctx: RequestContext[MachineServiceGetBMCRequest, MachineServiceGetBMCResponse]) -> MachineServiceGetBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list_bmc(self, request: MachineServiceListBMCRequest, ctx: RequestContext[MachineServiceListBMCRequest, MachineServiceListBMCResponse]) -> MachineServiceListBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def console_password(self, request: MachineServiceConsolePasswordRequest, ctx: RequestContext[MachineServiceConsolePasswordRequest, MachineServiceConsolePasswordResponse]) -> MachineServiceConsolePasswordResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def set_state(self, request: MachineServiceSetStateRequest, ctx: RequestContext[MachineServiceSetStateRequest, MachineServiceSetStateResponse]) -> MachineServiceSetStateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def issues(self, request: MachineServiceIssuesRequest, ctx: RequestContext[MachineServiceIssuesRequest, MachineServiceIssuesResponse]) -> MachineServiceIssuesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MachineServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: MachineServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MachineServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.MachineService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -378,8 +405,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="List", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -388,8 +415,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -398,38 +425,38 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="BMCCommand", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.b_m_c_command, + function=service.bmc_command, ), "/metalstack.admin.v2.MachineService/GetBMC": EndpointSync.unary( method=MethodInfo( name="GetBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.get_b_m_c, + function=service.get_bmc, ), "/metalstack.admin.v2.MachineService/ListBMC": EndpointSync.unary( method=MethodInfo( name="ListBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse, + input=MachineServiceListBMCRequest, + output=MachineServiceListBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.list_b_m_c, + function=service.list_bmc, ), "/metalstack.admin.v2.MachineService/ConsolePassword": EndpointSync.unary( method=MethodInfo( name="ConsolePassword", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse, + input=MachineServiceConsolePasswordRequest, + output=MachineServiceConsolePasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.console_password, @@ -438,8 +465,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="SetState", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + input=MachineServiceSetStateRequest, + output=MachineServiceSetStateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.set_state, @@ -448,8 +475,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Issues", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse, + input=MachineServiceIssuesRequest, + output=MachineServiceIssuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.issues, @@ -470,182 +497,172 @@ def path(self) -> str: class MachineServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, + request: MachineServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse: + ) -> MachineServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, + request: MachineServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse: + ) -> MachineServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, + request: MachineServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: + ) -> MachineServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def b_m_c_command( + def bmc_command( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, + request: MachineServiceBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: + ) -> MachineServiceBMCCommandResponse: return self.execute_unary( request=request, method=MethodInfo( name="BMCCommand", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def get_b_m_c( + def get_bmc( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, + request: MachineServiceGetBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: + ) -> MachineServiceGetBMCResponse: return self.execute_unary( request=request, method=MethodInfo( name="GetBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def list_b_m_c( + def list_bmc( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, + request: MachineServiceListBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse: + ) -> MachineServiceListBMCResponse: return self.execute_unary( request=request, method=MethodInfo( name="ListBMC", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceListBMCResponse, + input=MachineServiceListBMCRequest, + output=MachineServiceListBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def console_password( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, + request: MachineServiceConsolePasswordRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse: + ) -> MachineServiceConsolePasswordResponse: return self.execute_unary( request=request, method=MethodInfo( name="ConsolePassword", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceConsolePasswordResponse, + input=MachineServiceConsolePasswordRequest, + output=MachineServiceConsolePasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def set_state( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, + request: MachineServiceSetStateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse: + ) -> MachineServiceSetStateResponse: return self.execute_unary( request=request, method=MethodInfo( name="SetState", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceSetStateResponse, + input=MachineServiceSetStateRequest, + output=MachineServiceSetStateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def issues( self, - request: metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, + request: MachineServiceIssuesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse: + ) -> MachineServiceIssuesResponse: return self.execute_unary( request=request, method=MethodInfo( name="Issues", service_name="metalstack.admin.v2.MachineService", - input=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesRequest, - output=metalstack_dot_admin_dot_v2_dot_machine__pb2.MachineServiceIssuesResponse, + input=MachineServiceIssuesRequest, + output=MachineServiceIssuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/machine_pb.py b/python/metalstack/admin/v2/machine_pb.py new file mode 100644 index 00000000..929fab91 --- /dev/null +++ b/python/metalstack/admin/v2/machine_pb.py @@ -0,0 +1,680 @@ +# Generated from metalstack/admin/v2/machine.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, machine_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.machine_pb import Machine, MachineBMCCommand, MachineBMCQuery, MachineBMCReport, MachineIssues, MachineIssuesQuery, MachineQuery, MachineState + + +_MachineServiceGetRequestFields: TypeAlias = Literal["uuid"] + +class MachineServiceGetRequest(Message[_MachineServiceGetRequestFields]): + """ + MachineServiceGetRequest is the request payload for a machine get request + + ```proto + message metalstack.admin.v2.MachineServiceGetRequest + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_MachineServiceGetResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceGetResponse(Message[_MachineServiceGetResponseFields]): + """ + MachineServiceGetResponse is the response payload for a machine get request + + ```proto + message metalstack.admin.v2.MachineServiceGetResponse + ``` + + Attributes: + machine: + Machine is the machine requested + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceListRequestFields: TypeAlias = Literal["query", "partition"] + +class MachineServiceListRequest(Message[_MachineServiceListRequestFields]): + """ + MachineServiceListRequest is the request payload for a machine list request + + ```proto + message metalstack.admin.v2.MachineServiceListRequest + ``` + + Attributes: + query: + Query to list one or more machines + + ```proto + optional metalstack.api.v2.MachineQuery query = 1; + ``` + partition: + Partition for which machines should be listed, could be left empty if only one partition is present + otherwise an error is thrown that the partition must be specified + + ```proto + optional string partition = 2; + ``` + """ + + __slots__ = ("query", "partition") + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: MachineQuery | None = None, + partition: str | None = None, + ) -> None: + pass + + query: MachineQuery | None + partition: str + +_MachineServiceListResponseFields: TypeAlias = Literal["machines"] + +class MachineServiceListResponse(Message[_MachineServiceListResponseFields]): + """ + MachineServiceListResponse is the response payload for a machine list request + + ```proto + message metalstack.admin.v2.MachineServiceListResponse + ``` + + Attributes: + machines: + Machines are the machines requested by a list request + + ```proto + repeated metalstack.api.v2.Machine machines = 1; + ``` + """ + + __slots__ = ("machines",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machines: list[Machine] | None = None, + ) -> None: + pass + + machines: list[Machine] + +_MachineServiceDeleteRequestFields: TypeAlias = Literal["uuid"] + +class MachineServiceDeleteRequest(Message[_MachineServiceDeleteRequestFields]): + """ + MachineServiceDeleteRequest is the request payload for a machine delete request + + ```proto + message metalstack.admin.v2.MachineServiceDeleteRequest + ``` + + Attributes: + uuid: + UUID of the machine to permanently delete + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_MachineServiceDeleteResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceDeleteResponse(Message[_MachineServiceDeleteResponseFields]): + """ + MachineServiceDeleteResponse is the response payload for a machine delete request + + ```proto + message metalstack.admin.v2.MachineServiceDeleteResponse + ``` + + Attributes: + machine: + Machine is the machine permanently deleted + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceBMCCommandRequestFields: TypeAlias = Literal["uuid", "command"] + +class MachineServiceBMCCommandRequest(Message[_MachineServiceBMCCommandRequestFields]): + """ + MachineServiceBMCCommandRequest is the request payload for a machine bmc command + + ```proto + message metalstack.admin.v2.MachineServiceBMCCommandRequest + ``` + + Attributes: + uuid: + UUID of the machine to send the command to + + ```proto + string uuid = 1; + ``` + command: + Command to send to the bmc of the machine + + ```proto + metalstack.api.v2.MachineBMCCommand command = 2; + ``` + """ + + __slots__ = ("uuid", "command") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + command: MachineBMCCommand | None = None, + ) -> None: + pass + + uuid: str + command: MachineBMCCommand + +_MachineServiceBMCCommandResponseFields: TypeAlias = NoReturn + +class MachineServiceBMCCommandResponse(Message[_MachineServiceBMCCommandResponseFields]): + """ + MachineServiceBMCCommandResponse is the response payload for a machine bmc command + + ```proto + message metalstack.admin.v2.MachineServiceBMCCommandResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_MachineServiceGetBMCRequestFields: TypeAlias = Literal["uuid"] + +class MachineServiceGetBMCRequest(Message[_MachineServiceGetBMCRequestFields]): + """ + MachineServiceGetBMCRequest is the request payload for a machine getbmc request + + ```proto + message metalstack.admin.v2.MachineServiceGetBMCRequest + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_MachineServiceGetBMCResponseFields: TypeAlias = Literal["uuid", "bmc"] + +class MachineServiceGetBMCResponse(Message[_MachineServiceGetBMCResponseFields]): + """ + MachineServiceGetBMCResponse is the response payload for a machine getbmc request + + ```proto + message metalstack.admin.v2.MachineServiceGetBMCResponse + ``` + + Attributes: + uuid: + UUID of the machine + + ```proto + string uuid = 1; + ``` + bmc: + BMC contains the BMC details of this machine + + ```proto + optional metalstack.api.v2.MachineBMCReport bmc = 2; + ``` + """ + + __slots__ = ("uuid", "bmc") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + bmc: MachineBMCReport | None = None, + ) -> None: + pass + + uuid: str + bmc: MachineBMCReport | None + +_MachineServiceListBMCRequestFields: TypeAlias = Literal["query"] + +class MachineServiceListBMCRequest(Message[_MachineServiceListBMCRequestFields]): + """ + MachineServiceListBMCRequest is the request payload for a machine listbmc request + + ```proto + message metalstack.admin.v2.MachineServiceListBMCRequest + ``` + + Attributes: + query: + Query to list one or more BMCs of many machines + + ```proto + optional metalstack.api.v2.MachineBMCQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: MachineBMCQuery | None = None, + ) -> None: + pass + + query: MachineBMCQuery | None + +_MachineServiceListBMCResponseFields: TypeAlias = Literal["bmc_reports"] + +class MachineServiceListBMCResponse(Message[_MachineServiceListBMCResponseFields]): + """ + MachineServiceListBMCResponse is the response payload for a machine listbmc request + + ```proto + message metalstack.admin.v2.MachineServiceListBMCResponse + ``` + + Attributes: + bmc_reports: + BMCReports maps the bmc report per machine uuid + + ```proto + map bmc_reports = 1; + ``` + """ + + __slots__ = ("bmc_reports",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + bmc_reports: dict[str, MachineBMCReport] | None = None, + ) -> None: + pass + + bmc_reports: dict[str, MachineBMCReport] + +_MachineServiceConsolePasswordRequestFields: TypeAlias = Literal["uuid", "reason"] + +class MachineServiceConsolePasswordRequest(Message[_MachineServiceConsolePasswordRequestFields]): + """ + MachineServiceConsolePasswordRequest is the request payload for getting the console password. + + ```proto + message metalstack.admin.v2.MachineServiceConsolePasswordRequest + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + reason: + Reason must be provided why access to the console is requested + Reason is only forwarded to an audit sink + + ```proto + string reason = 2; + ``` + """ + + __slots__ = ("uuid", "reason") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + reason: str = "", + ) -> None: + pass + + uuid: str + reason: str + +_MachineServiceConsolePasswordResponseFields: TypeAlias = Literal["uuid", "password"] + +class MachineServiceConsolePasswordResponse(Message[_MachineServiceConsolePasswordResponseFields]): + """ + MachineServiceConsolePasswordResponse is the response payload for getting the console password. + + ```proto + message metalstack.admin.v2.MachineServiceConsolePasswordResponse + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + password: + Password to access the console + + ```proto + string password = 2; + ``` + """ + + __slots__ = ("uuid", "password") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + password: str = "", + ) -> None: + pass + + uuid: str + password: str + +_MachineServiceSetStateRequestFields: TypeAlias = Literal["uuid", "state", "description"] + +class MachineServiceSetStateRequest(Message[_MachineServiceSetStateRequestFields]): + """ + MachineServiceSetStateRequest is the request payload for a machine set state request + + ```proto + message metalstack.admin.v2.MachineServiceSetStateRequest + ``` + + Attributes: + uuid: + UUID of the machine to set the state to + + ```proto + string uuid = 1; + ``` + state: + State the state of this machine. + If State set to available, description is also cleared. + + ```proto + metalstack.api.v2.MachineState state = 2; + ``` + description: + Description a description why this machine is in the given state + + ```proto + string description = 3; + ``` + """ + + __slots__ = ("uuid", "state", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + state: MachineState | None = None, + description: str = "", + ) -> None: + pass + + uuid: str + state: MachineState + description: str + +_MachineServiceSetStateResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceSetStateResponse(Message[_MachineServiceSetStateResponseFields]): + """ + MachineServiceSetStateResponse is the response payload for a machine set state request + + ```proto + message metalstack.admin.v2.MachineServiceSetStateResponse + ``` + + Attributes: + machine: + Machine with the changed state. + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceIssuesRequestFields: TypeAlias = Literal["query"] + +class MachineServiceIssuesRequest(Message[_MachineServiceIssuesRequestFields]): + """ + MachineServiceIssuesRequest is the request payload for a machine issues request + + ```proto + message metalstack.admin.v2.MachineServiceIssuesRequest + ``` + + Attributes: + query: + Query which machine issues to include + + ```proto + optional metalstack.api.v2.MachineIssuesQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: MachineIssuesQuery | None = None, + ) -> None: + pass + + query: MachineIssuesQuery | None + +_MachineServiceIssuesResponseFields: TypeAlias = Literal["issues"] + +class MachineServiceIssuesResponse(Message[_MachineServiceIssuesResponseFields]): + """ + MachineServiceIssuesResponse is the response payload for a machine issues request + + ```proto + message metalstack.admin.v2.MachineServiceIssuesResponse + ``` + + Attributes: + issues: + Issues is the result of the issues query + + ```proto + repeated metalstack.api.v2.MachineIssues issues = 1; + ``` + """ + + __slots__ = ("issues",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + issues: list[MachineIssues] | None = None, + ) -> None: + pass + + issues: list[MachineIssues] + + +_DESC = file_desc( + b'\n!metalstack/admin/v2/machine.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto"8\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"Q\n\x19MachineServiceGetResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"\x90\x01\n\x19MachineServiceListRequest\x125\n\x05query\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.MachineQueryR\x05query\x12.\n\tpartition\x18\x02 \x01(\tH\x00R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01B\x0c\n\n_partition"T\n\x1aMachineServiceListResponse\x126\n\x08machines\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.MachineR\x08machines";\n\x1bMachineServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"T\n\x1cMachineServiceDeleteResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"\x89\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12H\n\x07command\x18\x02 \x01(\x0e2$.metalstack.api.v2.MachineBMCCommandR\x07commandB\x08\xbaH\x05\x82\x01\x02\x10\x01""\n MachineServiceBMCCommandResponse";\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x125\n\x03bmc\x18\x02 \x01(\x0b2#.metalstack.api.v2.MachineBMCReportR\x03bmc"X\n\x1cMachineServiceListBMCRequest\x128\n\x05query\x18\x01 \x01(\x0b2".metalstack.api.v2.MachineBMCQueryR\x05query"\xf7\x01\n\x1dMachineServiceListBMCResponse\x12r\n\x0bbmc_reports\x18\x01 \x03(\x0b2B.metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntryR\nbmcReportsB\r\xbaH\n\x9a\x01\x07"\x05r\x03\xb0\x01\x01\x1ab\n\x0fBmcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x129\n\x05value\x18\x02 \x01(\x0b2#.metalstack.api.v2.MachineBMCReportR\x05value:\x028\x01"h\n$MachineServiceConsolePasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x06reason\x18\x02 \x01(\tR\x06reasonB\n\xbaH\x07r\x05\x10\n\x18\x80\x04"a\n%MachineServiceConsolePasswordResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password"\xad\x01\n\x1dMachineServiceSetStateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12?\n\x05state\x18\x02 \x01(\x0e2\x1f.metalstack.api.v2.MachineStateR\x05stateB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12-\n\x0bdescription\x18\x03 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"V\n\x1eMachineServiceSetStateResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"Z\n\x1bMachineServiceIssuesRequest\x12;\n\x05query\x18\x01 \x01(\x0b2%.metalstack.api.v2.MachineIssuesQueryR\x05query"X\n\x1cMachineServiceIssuesResponse\x128\n\x06issues\x18\x01 \x03(\x0b2 .metalstack.api.v2.MachineIssuesR\x06issues2\x83\t\n\x0eMachineService\x12p\n\x03Get\x12-.metalstack.admin.v2.MachineServiceGetRequest\x1a..metalstack.admin.v2.MachineServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12..metalstack.admin.v2.MachineServiceListRequest\x1a/.metalstack.admin.v2.MachineServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12x\n\x06Delete\x120.metalstack.admin.v2.MachineServiceDeleteRequest\x1a1.metalstack.admin.v2.MachineServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x84\x01\n\nBMCCommand\x124.metalstack.admin.v2.MachineServiceBMCCommandRequest\x1a5.metalstack.admin.v2.MachineServiceBMCCommandResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06GetBMC\x120.metalstack.admin.v2.MachineServiceGetBMCRequest\x1a1.metalstack.admin.v2.MachineServiceGetBMCResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12|\n\x07ListBMC\x121.metalstack.admin.v2.MachineServiceListBMCRequest\x1a2.metalstack.admin.v2.MachineServiceListBMCResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x94\x01\n\x0fConsolePassword\x129.metalstack.admin.v2.MachineServiceConsolePasswordRequest\x1a:.metalstack.admin.v2.MachineServiceConsolePasswordResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12~\n\x08SetState\x122.metalstack.admin.v2.MachineServiceSetStateRequest\x1a3.metalstack.admin.v2.MachineServiceSetStateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06Issues\x120.metalstack.admin.v2.MachineServiceIssuesRequest\x1a1.metalstack.admin.v2.MachineServiceIssuesResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd0\x01\n\x17com.metalstack.admin.v2B\x0cMachineProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + machine_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "MachineServiceGetRequest": MachineServiceGetRequest, + "MachineServiceGetResponse": MachineServiceGetResponse, + "MachineServiceListRequest": MachineServiceListRequest, + "MachineServiceListResponse": MachineServiceListResponse, + "MachineServiceDeleteRequest": MachineServiceDeleteRequest, + "MachineServiceDeleteResponse": MachineServiceDeleteResponse, + "MachineServiceBMCCommandRequest": MachineServiceBMCCommandRequest, + "MachineServiceBMCCommandResponse": MachineServiceBMCCommandResponse, + "MachineServiceGetBMCRequest": MachineServiceGetBMCRequest, + "MachineServiceGetBMCResponse": MachineServiceGetBMCResponse, + "MachineServiceListBMCRequest": MachineServiceListBMCRequest, + "MachineServiceListBMCResponse": MachineServiceListBMCResponse, + "MachineServiceConsolePasswordRequest": MachineServiceConsolePasswordRequest, + "MachineServiceConsolePasswordResponse": MachineServiceConsolePasswordResponse, + "MachineServiceSetStateRequest": MachineServiceSetStateRequest, + "MachineServiceSetStateResponse": MachineServiceSetStateResponse, + "MachineServiceIssuesRequest": MachineServiceIssuesRequest, + "MachineServiceIssuesResponse": MachineServiceIssuesResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/machine.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/machine_pb2.py b/python/metalstack/admin/v2/machine_pb2.py deleted file mode 100644 index 5c99e714..00000000 --- a/python/metalstack/admin/v2/machine_pb2.py +++ /dev/null @@ -1,127 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/machine.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/machine.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/admin/v2/machine.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"8\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"Q\n\x19MachineServiceGetResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\x90\x01\n\x19MachineServiceListRequest\x12\x35\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x05query\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x00R\tpartition\x88\x01\x01\x42\x0c\n\n_partition\"T\n\x1aMachineServiceListResponse\x12\x36\n\x08machines\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.MachineR\x08machines\";\n\x1bMachineServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"T\n\x1cMachineServiceDeleteResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\x89\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12H\n\x07\x63ommand\x18\x02 \x01(\x0e\x32$.metalstack.api.v2.MachineBMCCommandB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07\x63ommand\"\"\n MachineServiceBMCCommandResponse\";\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x03\x62mc\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x03\x62mc\"X\n\x1cMachineServiceListBMCRequest\x12\x38\n\x05query\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.MachineBMCQueryR\x05query\"\xf7\x01\n\x1dMachineServiceListBMCResponse\x12r\n\x0b\x62mc_reports\x18\x01 \x03(\x0b\x32\x42.metalstack.admin.v2.MachineServiceListBMCResponse.BmcReportsEntryB\r\xbaH\n\x9a\x01\x07\"\x05r\x03\xb0\x01\x01R\nbmcReports\x1a\x62\n\x0f\x42mcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x05value:\x02\x38\x01\"h\n$MachineServiceConsolePasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x06reason\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\n\x18\x80\x04R\x06reason\"a\n%MachineServiceConsolePasswordResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password\"\xad\x01\n\x1dMachineServiceSetStateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12?\n\x05state\x18\x02 \x01(\x0e\x32\x1f.metalstack.api.v2.MachineStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05state\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\"V\n\x1eMachineServiceSetStateResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"Z\n\x1bMachineServiceIssuesRequest\x12;\n\x05query\x18\x01 \x01(\x0b\x32%.metalstack.api.v2.MachineIssuesQueryR\x05query\"X\n\x1cMachineServiceIssuesResponse\x12\x38\n\x06issues\x18\x01 \x03(\x0b\x32 .metalstack.api.v2.MachineIssuesR\x06issues2\x83\t\n\x0eMachineService\x12p\n\x03Get\x12-.metalstack.admin.v2.MachineServiceGetRequest\x1a..metalstack.admin.v2.MachineServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12..metalstack.admin.v2.MachineServiceListRequest\x1a/.metalstack.admin.v2.MachineServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12x\n\x06\x44\x65lete\x12\x30.metalstack.admin.v2.MachineServiceDeleteRequest\x1a\x31.metalstack.admin.v2.MachineServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x84\x01\n\nBMCCommand\x12\x34.metalstack.admin.v2.MachineServiceBMCCommandRequest\x1a\x35.metalstack.admin.v2.MachineServiceBMCCommandResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06GetBMC\x12\x30.metalstack.admin.v2.MachineServiceGetBMCRequest\x1a\x31.metalstack.admin.v2.MachineServiceGetBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12|\n\x07ListBMC\x12\x31.metalstack.admin.v2.MachineServiceListBMCRequest\x1a\x32.metalstack.admin.v2.MachineServiceListBMCResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x94\x01\n\x0f\x43onsolePassword\x12\x39.metalstack.admin.v2.MachineServiceConsolePasswordRequest\x1a:.metalstack.admin.v2.MachineServiceConsolePasswordResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12~\n\x08SetState\x12\x32.metalstack.admin.v2.MachineServiceSetStateRequest\x1a\x33.metalstack.admin.v2.MachineServiceSetStateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x06Issues\x12\x30.metalstack.admin.v2.MachineServiceIssuesRequest\x1a\x31.metalstack.admin.v2.MachineServiceIssuesResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd0\x01\n\x17\x63om.metalstack.admin.v2B\x0cMachineProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.machine_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\014MachineProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICELISTREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_MACHINESERVICELISTREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['command']._loaded_options = None - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['command']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEGETBMCRESPONSE'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETBMCRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICELISTBMCRESPONSE_BMCREPORTSENTRY']._loaded_options = None - _globals['_MACHINESERVICELISTBMCRESPONSE_BMCREPORTSENTRY']._serialized_options = b'8\001' - _globals['_MACHINESERVICELISTBMCRESPONSE'].fields_by_name['bmc_reports']._loaded_options = None - _globals['_MACHINESERVICELISTBMCRESPONSE'].fields_by_name['bmc_reports']._serialized_options = b'\272H\n\232\001\007\"\005r\003\260\001\001' - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST'].fields_by_name['reason']._loaded_options = None - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST'].fields_by_name['reason']._serialized_options = b'\272H\007r\005\020\n\030\200\004' - _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['state']._loaded_options = None - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['state']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_MACHINESERVICESETSTATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINESERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_MACHINESERVICE'].methods_by_name['List']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_MACHINESERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['BMCCommand']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['BMCCommand']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['GetBMC']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['GetBMC']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['ListBMC']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['ListBMC']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['ConsolePassword']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['ConsolePassword']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['SetState']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['SetState']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['Issues']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Issues']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_MACHINESERVICEGETREQUEST']._serialized_start=194 - _globals['_MACHINESERVICEGETREQUEST']._serialized_end=250 - _globals['_MACHINESERVICEGETRESPONSE']._serialized_start=252 - _globals['_MACHINESERVICEGETRESPONSE']._serialized_end=333 - _globals['_MACHINESERVICELISTREQUEST']._serialized_start=336 - _globals['_MACHINESERVICELISTREQUEST']._serialized_end=480 - _globals['_MACHINESERVICELISTRESPONSE']._serialized_start=482 - _globals['_MACHINESERVICELISTRESPONSE']._serialized_end=566 - _globals['_MACHINESERVICEDELETEREQUEST']._serialized_start=568 - _globals['_MACHINESERVICEDELETEREQUEST']._serialized_end=627 - _globals['_MACHINESERVICEDELETERESPONSE']._serialized_start=629 - _globals['_MACHINESERVICEDELETERESPONSE']._serialized_end=713 - _globals['_MACHINESERVICEBMCCOMMANDREQUEST']._serialized_start=716 - _globals['_MACHINESERVICEBMCCOMMANDREQUEST']._serialized_end=853 - _globals['_MACHINESERVICEBMCCOMMANDRESPONSE']._serialized_start=855 - _globals['_MACHINESERVICEBMCCOMMANDRESPONSE']._serialized_end=889 - _globals['_MACHINESERVICEGETBMCREQUEST']._serialized_start=891 - _globals['_MACHINESERVICEGETBMCREQUEST']._serialized_end=950 - _globals['_MACHINESERVICEGETBMCRESPONSE']._serialized_start=952 - _globals['_MACHINESERVICEGETBMCRESPONSE']._serialized_end=1067 - _globals['_MACHINESERVICELISTBMCREQUEST']._serialized_start=1069 - _globals['_MACHINESERVICELISTBMCREQUEST']._serialized_end=1157 - _globals['_MACHINESERVICELISTBMCRESPONSE']._serialized_start=1160 - _globals['_MACHINESERVICELISTBMCRESPONSE']._serialized_end=1407 - _globals['_MACHINESERVICELISTBMCRESPONSE_BMCREPORTSENTRY']._serialized_start=1309 - _globals['_MACHINESERVICELISTBMCRESPONSE_BMCREPORTSENTRY']._serialized_end=1407 - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST']._serialized_start=1409 - _globals['_MACHINESERVICECONSOLEPASSWORDREQUEST']._serialized_end=1513 - _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE']._serialized_start=1515 - _globals['_MACHINESERVICECONSOLEPASSWORDRESPONSE']._serialized_end=1612 - _globals['_MACHINESERVICESETSTATEREQUEST']._serialized_start=1615 - _globals['_MACHINESERVICESETSTATEREQUEST']._serialized_end=1788 - _globals['_MACHINESERVICESETSTATERESPONSE']._serialized_start=1790 - _globals['_MACHINESERVICESETSTATERESPONSE']._serialized_end=1876 - _globals['_MACHINESERVICEISSUESREQUEST']._serialized_start=1878 - _globals['_MACHINESERVICEISSUESREQUEST']._serialized_end=1968 - _globals['_MACHINESERVICEISSUESRESPONSE']._serialized_start=1970 - _globals['_MACHINESERVICEISSUESRESPONSE']._serialized_end=2058 - _globals['_MACHINESERVICE']._serialized_start=2061 - _globals['_MACHINESERVICE']._serialized_end=3216 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/machine_pb2.pyi b/python/metalstack/admin/v2/machine_pb2.pyi deleted file mode 100644 index a75325ce..00000000 --- a/python/metalstack/admin/v2/machine_pb2.pyi +++ /dev/null @@ -1,138 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class MachineServiceGetRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class MachineServiceGetResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: _machine_pb2.Machine - def __init__(self, machine: _Optional[_Union[_machine_pb2.Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceListRequest(_message.Message): - __slots__ = ("query", "partition") - QUERY_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - query: _machine_pb2.MachineQuery - partition: str - def __init__(self, query: _Optional[_Union[_machine_pb2.MachineQuery, _Mapping]] = ..., partition: _Optional[str] = ...) -> None: ... - -class MachineServiceListResponse(_message.Message): - __slots__ = ("machines",) - MACHINES_FIELD_NUMBER: _ClassVar[int] - machines: _containers.RepeatedCompositeFieldContainer[_machine_pb2.Machine] - def __init__(self, machines: _Optional[_Iterable[_Union[_machine_pb2.Machine, _Mapping]]] = ...) -> None: ... - -class MachineServiceDeleteRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class MachineServiceDeleteResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: _machine_pb2.Machine - def __init__(self, machine: _Optional[_Union[_machine_pb2.Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceBMCCommandRequest(_message.Message): - __slots__ = ("uuid", "command") - UUID_FIELD_NUMBER: _ClassVar[int] - COMMAND_FIELD_NUMBER: _ClassVar[int] - uuid: str - command: _machine_pb2.MachineBMCCommand - def __init__(self, uuid: _Optional[str] = ..., command: _Optional[_Union[_machine_pb2.MachineBMCCommand, str]] = ...) -> None: ... - -class MachineServiceBMCCommandResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class MachineServiceGetBMCRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class MachineServiceGetBMCResponse(_message.Message): - __slots__ = ("uuid", "bmc") - UUID_FIELD_NUMBER: _ClassVar[int] - BMC_FIELD_NUMBER: _ClassVar[int] - uuid: str - bmc: _machine_pb2.MachineBMCReport - def __init__(self, uuid: _Optional[str] = ..., bmc: _Optional[_Union[_machine_pb2.MachineBMCReport, _Mapping]] = ...) -> None: ... - -class MachineServiceListBMCRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _machine_pb2.MachineBMCQuery - def __init__(self, query: _Optional[_Union[_machine_pb2.MachineBMCQuery, _Mapping]] = ...) -> None: ... - -class MachineServiceListBMCResponse(_message.Message): - __slots__ = ("bmc_reports",) - class BmcReportsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _machine_pb2.MachineBMCReport - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_machine_pb2.MachineBMCReport, _Mapping]] = ...) -> None: ... - BMC_REPORTS_FIELD_NUMBER: _ClassVar[int] - bmc_reports: _containers.MessageMap[str, _machine_pb2.MachineBMCReport] - def __init__(self, bmc_reports: _Optional[_Mapping[str, _machine_pb2.MachineBMCReport]] = ...) -> None: ... - -class MachineServiceConsolePasswordRequest(_message.Message): - __slots__ = ("uuid", "reason") - UUID_FIELD_NUMBER: _ClassVar[int] - REASON_FIELD_NUMBER: _ClassVar[int] - uuid: str - reason: str - def __init__(self, uuid: _Optional[str] = ..., reason: _Optional[str] = ...) -> None: ... - -class MachineServiceConsolePasswordResponse(_message.Message): - __slots__ = ("uuid", "password") - UUID_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - uuid: str - password: str - def __init__(self, uuid: _Optional[str] = ..., password: _Optional[str] = ...) -> None: ... - -class MachineServiceSetStateRequest(_message.Message): - __slots__ = ("uuid", "state", "description") - UUID_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - uuid: str - state: _machine_pb2.MachineState - description: str - def __init__(self, uuid: _Optional[str] = ..., state: _Optional[_Union[_machine_pb2.MachineState, str]] = ..., description: _Optional[str] = ...) -> None: ... - -class MachineServiceSetStateResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: _machine_pb2.Machine - def __init__(self, machine: _Optional[_Union[_machine_pb2.Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceIssuesRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _machine_pb2.MachineIssuesQuery - def __init__(self, query: _Optional[_Union[_machine_pb2.MachineIssuesQuery, _Mapping]] = ...) -> None: ... - -class MachineServiceIssuesResponse(_message.Message): - __slots__ = ("issues",) - ISSUES_FIELD_NUMBER: _ClassVar[int] - issues: _containers.RepeatedCompositeFieldContainer[_machine_pb2.MachineIssues] - def __init__(self, issues: _Optional[_Iterable[_Union[_machine_pb2.MachineIssues, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/network_connect.py b/python/metalstack/admin/v2/network_connect.py index be2a73bf..a21dadf2 100644 --- a/python/metalstack/admin/v2/network_connect.py +++ b/python/metalstack/admin/v2/network_connect.py @@ -1,41 +1,57 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/network.proto +# Generated from metalstack/admin/v2/network.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.network_pb2 as metalstack_dot_admin_dot_v2_dot_network__pb2 + +from .network_pb import NetworkServiceCreateRequest, NetworkServiceCreateResponse, NetworkServiceDeleteRequest, NetworkServiceDeleteResponse, NetworkServiceGetRequest, NetworkServiceGetResponse, NetworkServiceListRequest, NetworkServiceListResponse, NetworkServiceUpdateRequest, NetworkServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class NetworkService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: NetworkServiceGetRequest, ctx: RequestContext[NetworkServiceGetRequest, NetworkServiceGetResponse]) -> NetworkServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: NetworkServiceCreateRequest, ctx: RequestContext[NetworkServiceCreateRequest, NetworkServiceCreateResponse]) -> NetworkServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: NetworkServiceUpdateRequest, ctx: RequestContext[NetworkServiceUpdateRequest, NetworkServiceUpdateResponse]) -> NetworkServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: NetworkServiceDeleteRequest, ctx: RequestContext[NetworkServiceDeleteRequest, NetworkServiceDeleteResponse]) -> NetworkServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: NetworkServiceListRequest, ctx: RequestContext[NetworkServiceListRequest, NetworkServiceListResponse]) -> NetworkServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class NetworkServiceASGIApplication(ConnectASGIApplication[NetworkService]): - def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: NetworkService | AsyncGenerator[NetworkService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -43,8 +59,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -53,8 +69,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -63,8 +79,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -73,8 +89,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -83,8 +99,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="List", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -105,18 +121,18 @@ def path(self) -> str: class NetworkServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, + request: NetworkServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse: + ) -> NetworkServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -125,18 +141,18 @@ async def get( async def create( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, + request: NetworkServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: + ) -> NetworkServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -145,18 +161,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, + request: NetworkServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: + ) -> NetworkServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -165,18 +181,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, + request: NetworkServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: + ) -> NetworkServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -185,51 +201,58 @@ async def delete( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, + request: NetworkServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse: + ) -> NetworkServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class NetworkServiceSync(Protocol): + def get(self, request: NetworkServiceGetRequest, ctx: RequestContext[NetworkServiceGetRequest, NetworkServiceGetResponse]) -> NetworkServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def create(self, request: NetworkServiceCreateRequest, ctx: RequestContext[NetworkServiceCreateRequest, NetworkServiceCreateResponse]) -> NetworkServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: NetworkServiceUpdateRequest, ctx: RequestContext[NetworkServiceUpdateRequest, NetworkServiceUpdateResponse]) -> NetworkServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: NetworkServiceDeleteRequest, ctx: RequestContext[NetworkServiceDeleteRequest, NetworkServiceDeleteResponse]) -> NetworkServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class NetworkServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: NetworkServiceListRequest, ctx: RequestContext[NetworkServiceListRequest, NetworkServiceListResponse]) -> NetworkServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class NetworkServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: NetworkServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: NetworkServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.NetworkService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -238,8 +261,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Create", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -248,8 +271,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Update", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -258,8 +281,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -268,8 +291,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="List", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -290,102 +313,96 @@ def path(self) -> str: class NetworkServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, + request: NetworkServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse: + ) -> NetworkServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, + request: NetworkServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: + ) -> NetworkServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, + request: NetworkServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: + ) -> NetworkServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, + request: NetworkServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: + ) -> NetworkServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, + request: NetworkServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse: + ) -> NetworkServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.NetworkService", - input=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/network_pb.py b/python/metalstack/admin/v2/network_pb.py new file mode 100644 index 00000000..4617fb92 --- /dev/null +++ b/python/metalstack/admin/v2/network_pb.py @@ -0,0 +1,586 @@ +# Generated from metalstack/admin/v2/network.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, network_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import Labels, UpdateLabels, UpdateMeta + from ...api.v2.network_pb import ChildPrefixLength, NATType, Network, NetworkAddressFamily, NetworkQuery, NetworkType + + +_NetworkServiceGetRequestFields: TypeAlias = Literal["id"] + +class NetworkServiceGetRequest(Message[_NetworkServiceGetRequestFields]): + """ + NetworkServiceGetRequest is the request payload for getting a network. + + ```proto + message metalstack.admin.v2.NetworkServiceGetRequest + ``` + + Attributes: + id: + ID of the network to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_NetworkServiceGetResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceGetResponse(Message[_NetworkServiceGetResponseFields]): + """ + NetworkServiceGetResponse is the response payload for getting a network. + + ```proto + message metalstack.admin.v2.NetworkServiceGetResponse + ``` + + Attributes: + network: + Network contains the requested network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceCreateRequestFields: TypeAlias = Literal["id", "name", "description", "partition", "project", "type", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "length", "address_family"] + +class NetworkServiceCreateRequest(Message[_NetworkServiceCreateRequestFields]): + """ + NetworkServiceCreateRequest is the request payload for creating a network. + + ```proto + message metalstack.admin.v2.NetworkServiceCreateRequest + ``` + + Attributes: + id: + Id of this network + + ```proto + optional string id = 1; + ``` + name: + Name of this network + + ```proto + optional string name = 2; + ``` + description: + Description of this network + + ```proto + optional string description = 3; + ``` + partition: + Partition where this network will be created + + ```proto + optional string partition = 4; + ``` + project: + Project where this network belongs to + + ```proto + optional string project = 5; + ``` + type: + Type of the network to create + + ```proto + metalstack.api.v2.NetworkType type = 6; + ``` + labels: + Labels on this network + + ```proto + optional metalstack.api.v2.Labels labels = 7; + ``` + prefixes: + Prefixes in this network + + ```proto + repeated string prefixes = 8; + ``` + destination_prefixes: + Destination Prefixes in this network + + ```proto + repeated string destination_prefixes = 9; + ``` + default_child_prefix_length: + Default Child Prefix length defines the bitlength of a child network created per addressfamily, if not specified during the allocate request + + ```proto + optional metalstack.api.v2.ChildPrefixLength default_child_prefix_length = 10; + ``` + min_child_prefix_length: + Min Child Prefix length asserts that during child network creation the requested bit length is greater or equal the min child prefix length + + ```proto + optional metalstack.api.v2.ChildPrefixLength min_child_prefix_length = 11; + ``` + nat_type: + NATType of this network + + ```proto + optional metalstack.api.v2.NATType nat_type = 12; + ``` + vrf: + VRF of this network has this VNI + + ```proto + optional uint32 vrf = 13; + ``` + parent_network: + Parent Network points to the id of the parent network if any + + ```proto + optional string parent_network = 14; + ``` + additional_announcable_cidrs: + AdditionalAnnouncableCidrs will be added to the allow list on the switch which prefixes might be announced + + ```proto + repeated string additional_announcable_cidrs = 15; + ``` + length: + Length per addressfamily + + ```proto + optional metalstack.api.v2.ChildPrefixLength length = 16; + ``` + address_family: + AddressFamily to create, defaults to the same as the parent + + ```proto + optional metalstack.api.v2.NetworkAddressFamily address_family = 17; + ``` + """ + + __slots__ = ("id", "name", "description", "partition", "project", "type", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "length", "address_family") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + name: str | None = None, + description: str | None = None, + partition: str | None = None, + project: str | None = None, + type: NetworkType | None = None, + labels: Labels | None = None, + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + default_child_prefix_length: ChildPrefixLength | None = None, + min_child_prefix_length: ChildPrefixLength | None = None, + nat_type: NATType | None = None, + vrf: int | None = None, + parent_network: str | None = None, + additional_announcable_cidrs: list[str] | None = None, + length: ChildPrefixLength | None = None, + address_family: NetworkAddressFamily | None = None, + ) -> None: + pass + + id: str + name: str + description: str + partition: str + project: str + type: NetworkType + labels: Labels | None + prefixes: list[str] + destination_prefixes: list[str] + default_child_prefix_length: ChildPrefixLength | None + min_child_prefix_length: ChildPrefixLength | None + nat_type: NATType + vrf: int + parent_network: str + additional_announcable_cidrs: list[str] + length: ChildPrefixLength | None + address_family: NetworkAddressFamily + +_NetworkServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "name", "description", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "additional_announcable_cidrs", "force"] + +class NetworkServiceUpdateRequest(Message[_NetworkServiceUpdateRequestFields]): + """ + NetworkServiceUpdateRequest is the request payload for updating a network. + + ```proto + message metalstack.admin.v2.NetworkServiceUpdateRequest + ``` + + Attributes: + id: + Id of this network + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + name: + Name of this network + + ```proto + optional string name = 3; + ``` + description: + Description of this network + + ```proto + optional string description = 4; + ``` + labels: + Labels to update on this network + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 5; + ``` + prefixes: + Prefixes in this network + + ```proto + repeated string prefixes = 6; + ``` + destination_prefixes: + Destination Prefixes in this network + + ```proto + repeated string destination_prefixes = 7; + ``` + default_child_prefix_length: + Default Child Prefix length defines the bit length of a child network created per addressfamily, if not specified during the allocate request + + ```proto + optional metalstack.api.v2.ChildPrefixLength default_child_prefix_length = 8; + ``` + min_child_prefix_length: + Min Child Prefix length asserts that during child network creation the requested bit length is greater or equal the min child prefix length + + ```proto + optional metalstack.api.v2.ChildPrefixLength min_child_prefix_length = 9; + ``` + nat_type: + NATType of this network + + ```proto + optional metalstack.api.v2.NATType nat_type = 10; + ``` + additional_announcable_cidrs: + AdditionalAnnouncableCidrs will be added to the allow list on the switch which prefixes might be announced + + ```proto + repeated string additional_announcable_cidrs = 11; + ``` + force: + Force update, prevents accidental removal of additional_announcable_cidrs which will destroy your dataplane. + + ```proto + bool force = 12; + ``` + """ + + __slots__ = ("id", "update_meta", "name", "description", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "additional_announcable_cidrs", "force") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + name: str | None = None, + description: str | None = None, + labels: UpdateLabels | None = None, + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + default_child_prefix_length: ChildPrefixLength | None = None, + min_child_prefix_length: ChildPrefixLength | None = None, + nat_type: NATType | None = None, + additional_announcable_cidrs: list[str] | None = None, + force: bool = False, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + name: str + description: str + labels: UpdateLabels | None + prefixes: list[str] + destination_prefixes: list[str] + default_child_prefix_length: ChildPrefixLength | None + min_child_prefix_length: ChildPrefixLength | None + nat_type: NATType + additional_announcable_cidrs: list[str] + force: bool + +_NetworkServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class NetworkServiceDeleteRequest(Message[_NetworkServiceDeleteRequestFields]): + """ + NetworkServiceDeleteRequest is the request payload for deleting a network. + + ```proto + message metalstack.admin.v2.NetworkServiceDeleteRequest + ``` + + Attributes: + id: + ID of the network to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_NetworkServiceListRequestFields: TypeAlias = Literal["query"] + +class NetworkServiceListRequest(Message[_NetworkServiceListRequestFields]): + """ + NetworkServiceListRequest is the request payload for listing networks. + + ```proto + message metalstack.admin.v2.NetworkServiceListRequest + ``` + + Attributes: + query: + Query specifies which networks to return + + ```proto + optional metalstack.api.v2.NetworkQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: NetworkQuery | None = None, + ) -> None: + pass + + query: NetworkQuery | None + +_NetworkServiceCreateResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceCreateResponse(Message[_NetworkServiceCreateResponseFields]): + """ + NetworkServiceCreateResponse is the response payload for creating a network. + + ```proto + message metalstack.admin.v2.NetworkServiceCreateResponse + ``` + + Attributes: + network: + Network contains the created network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceUpdateResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceUpdateResponse(Message[_NetworkServiceUpdateResponseFields]): + """ + NetworkServiceUpdateResponse is the response payload for updating a network. + + ```proto + message metalstack.admin.v2.NetworkServiceUpdateResponse + ``` + + Attributes: + network: + Network contains the updated network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceDeleteResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceDeleteResponse(Message[_NetworkServiceDeleteResponseFields]): + """ + NetworkServiceDeleteResponse is the response payload for deleting a network. + + ```proto + message metalstack.admin.v2.NetworkServiceDeleteResponse + ``` + + Attributes: + network: + Network contains the deleted network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceListResponseFields: TypeAlias = Literal["networks"] + +class NetworkServiceListResponse(Message[_NetworkServiceListResponseFields]): + """ + NetworkServiceListResponse is the response payload for listing networks. + + ```proto + message metalstack.admin.v2.NetworkServiceListResponse + ``` + + Attributes: + networks: + Networks contains the list of networks + + ```proto + repeated metalstack.api.v2.Network networks = 1; + ``` + """ + + __slots__ = ("networks",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + networks: list[Network] | None = None, + ) -> None: + pass + + networks: list[Network] + + +_DESC = file_desc( + b'\n!metalstack/admin/v2/network.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/network.proto\x1a(metalstack/api/v2/predefined_rules.proto"7\n\x18NetworkServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"Q\n\x19NetworkServiceGetResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"\xa8\t\n\x1bNetworkServiceCreateRequest\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tH\x03R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tH\x04R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12<\n\x04type\x18\x06 \x01(\x0e2\x1e.metalstack.api.v2.NetworkTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x126\n\x06labels\x18\x07 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x05R\x06labels\x88\x01\x01\x12(\n\x08prefixes\x18\x08 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\t \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12c\n\x1bdefault_child_prefix_length\x18\n \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthR\x18defaultChildPrefixLength\x12[\n\x17min_child_prefix_length\x18\x0b \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthR\x14minChildPrefixLength\x12D\n\x08nat_type\x18\x0c \x01(\x0e2\x1a.metalstack.api.v2.NATTypeH\x06R\x07natTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12\x15\n\x03vrf\x18\r \x01(\rH\x07R\x03vrf\x88\x01\x01\x127\n\x0eparent_network\x18\x0e \x01(\tH\x08R\rparentNetworkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12N\n\x1cadditional_announcable_cidrs\x18\x0f \x03(\tR\x1aadditionalAnnouncableCidrsB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12A\n\x06length\x18\x10 \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthH\tR\x06length\x88\x01\x01\x12]\n\x0eaddress_family\x18\x11 \x01(\x0e2\'.metalstack.api.v2.NetworkAddressFamilyH\nR\raddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\t\n\x07_labelsB\x0b\n\t_nat_typeB\x06\n\x04_vrfB\x11\n\x0f_parent_networkB\t\n\x07_lengthB\x11\n\x0f_address_family"\xea\x06\n\x1bNetworkServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x06labels\x18\x05 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01\x12(\n\x08prefixes\x18\x06 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\x07 \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12h\n\x1bdefault_child_prefix_length\x18\x08 \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthH\x03R\x18defaultChildPrefixLength\x88\x01\x01\x12`\n\x17min_child_prefix_length\x18\t \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthH\x04R\x14minChildPrefixLength\x88\x01\x01\x12D\n\x08nat_type\x18\n \x01(\x0e2\x1a.metalstack.api.v2.NATTypeH\x05R\x07natTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12N\n\x1cadditional_announcable_cidrs\x18\x0b \x03(\tR\x1aadditionalAnnouncableCidrsB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12\x14\n\x05force\x18\x0c \x01(\x08R\x05forceB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labelsB\x1e\n\x1c_default_child_prefix_lengthB\x1a\n\x18_min_child_prefix_lengthB\x0b\n\t_nat_type":\n\x1bNetworkServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"R\n\x19NetworkServiceListRequest\x125\n\x05query\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.NetworkQueryR\x05query"T\n\x1cNetworkServiceCreateResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"T\n\x1cNetworkServiceUpdateResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"T\n\x1cNetworkServiceDeleteResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"T\n\x1aNetworkServiceListResponse\x126\n\x08networks\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.NetworkR\x08networks2\xe5\x04\n\x0eNetworkService\x12p\n\x03Get\x12-.metalstack.admin.v2.NetworkServiceGetRequest\x1a..metalstack.admin.v2.NetworkServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12x\n\x06Create\x120.metalstack.admin.v2.NetworkServiceCreateRequest\x1a1.metalstack.admin.v2.NetworkServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12x\n\x06Update\x120.metalstack.admin.v2.NetworkServiceUpdateRequest\x1a1.metalstack.admin.v2.NetworkServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12x\n\x06Delete\x120.metalstack.admin.v2.NetworkServiceDeleteRequest\x1a1.metalstack.admin.v2.NetworkServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12s\n\x04List\x12..metalstack.admin.v2.NetworkServiceListRequest\x1a/.metalstack.admin.v2.NetworkServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd0\x01\n\x17com.metalstack.admin.v2B\x0cNetworkProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + network_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "NetworkServiceGetRequest": NetworkServiceGetRequest, + "NetworkServiceGetResponse": NetworkServiceGetResponse, + "NetworkServiceCreateRequest": NetworkServiceCreateRequest, + "NetworkServiceUpdateRequest": NetworkServiceUpdateRequest, + "NetworkServiceDeleteRequest": NetworkServiceDeleteRequest, + "NetworkServiceListRequest": NetworkServiceListRequest, + "NetworkServiceCreateResponse": NetworkServiceCreateResponse, + "NetworkServiceUpdateResponse": NetworkServiceUpdateResponse, + "NetworkServiceDeleteResponse": NetworkServiceDeleteResponse, + "NetworkServiceListResponse": NetworkServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/network.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/network_pb2.py b/python/metalstack/admin/v2/network_pb2.py deleted file mode 100644 index fcb8dda7..00000000 --- a/python/metalstack/admin/v2/network_pb2.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/network.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/network.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import network_pb2 as metalstack_dot_api_dot_v2_dot_network__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/admin/v2/network.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/network.proto\x1a(metalstack/api/v2/predefined_rules.proto\"7\n\x18NetworkServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"Q\n\x19NetworkServiceGetResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"\xa8\t\n\x1bNetworkServiceCreateRequest\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x03R\tpartition\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\x07project\x88\x01\x01\x12<\n\x04type\x18\x06 \x01(\x0e\x32\x1e.metalstack.api.v2.NetworkTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x36\n\x06labels\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x05R\x06labels\x88\x01\x01\x12(\n\x08prefixes\x18\x08 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\t \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12\x63\n\x1b\x64\x65\x66\x61ult_child_prefix_length\x18\n \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthR\x18\x64\x65\x66\x61ultChildPrefixLength\x12[\n\x17min_child_prefix_length\x18\x0b \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthR\x14minChildPrefixLength\x12\x44\n\x08nat_type\x18\x0c \x01(\x0e\x32\x1a.metalstack.api.v2.NATTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x06R\x07natType\x88\x01\x01\x12\x15\n\x03vrf\x18\r \x01(\rH\x07R\x03vrf\x88\x01\x01\x12\x37\n\x0eparent_network\x18\x0e \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x08R\rparentNetwork\x88\x01\x01\x12N\n\x1c\x61\x64\x64itional_announcable_cidrs\x18\x0f \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x1a\x61\x64\x64itionalAnnouncableCidrs\x12\x41\n\x06length\x18\x10 \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthH\tR\x06length\x88\x01\x01\x12]\n\x0e\x61\x64\x64ress_family\x18\x11 \x01(\x0e\x32\'.metalstack.api.v2.NetworkAddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01H\nR\raddressFamily\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\t\n\x07_labelsB\x0b\n\t_nat_typeB\x06\n\x04_vrfB\x11\n\x0f_parent_networkB\t\n\x07_lengthB\x11\n\x0f_address_family\"\xea\x06\n\x1bNetworkServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12<\n\x06labels\x18\x05 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01\x12(\n\x08prefixes\x18\x06 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\x07 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12h\n\x1b\x64\x65\x66\x61ult_child_prefix_length\x18\x08 \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthH\x03R\x18\x64\x65\x66\x61ultChildPrefixLength\x88\x01\x01\x12`\n\x17min_child_prefix_length\x18\t \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthH\x04R\x14minChildPrefixLength\x88\x01\x01\x12\x44\n\x08nat_type\x18\n \x01(\x0e\x32\x1a.metalstack.api.v2.NATTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x05R\x07natType\x88\x01\x01\x12N\n\x1c\x61\x64\x64itional_announcable_cidrs\x18\x0b \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x1a\x61\x64\x64itionalAnnouncableCidrs\x12\x14\n\x05\x66orce\x18\x0c \x01(\x08R\x05\x66orceB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labelsB\x1e\n\x1c_default_child_prefix_lengthB\x1a\n\x18_min_child_prefix_lengthB\x0b\n\t_nat_type\":\n\x1bNetworkServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"R\n\x19NetworkServiceListRequest\x12\x35\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.NetworkQueryR\x05query\"T\n\x1cNetworkServiceCreateResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"T\n\x1cNetworkServiceUpdateResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"T\n\x1cNetworkServiceDeleteResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"T\n\x1aNetworkServiceListResponse\x12\x36\n\x08networks\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x08networks2\xe5\x04\n\x0eNetworkService\x12p\n\x03Get\x12-.metalstack.admin.v2.NetworkServiceGetRequest\x1a..metalstack.admin.v2.NetworkServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12x\n\x06\x43reate\x12\x30.metalstack.admin.v2.NetworkServiceCreateRequest\x1a\x31.metalstack.admin.v2.NetworkServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12x\n\x06Update\x12\x30.metalstack.admin.v2.NetworkServiceUpdateRequest\x1a\x31.metalstack.admin.v2.NetworkServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12x\n\x06\x44\x65lete\x12\x30.metalstack.admin.v2.NetworkServiceDeleteRequest\x1a\x31.metalstack.admin.v2.NetworkServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12s\n\x04List\x12..metalstack.admin.v2.NetworkServiceListRequest\x1a/.metalstack.admin.v2.NetworkServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd0\x01\n\x17\x63om.metalstack.admin.v2B\x0cNetworkProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.network_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\014NetworkProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['type']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['prefixes']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['nat_type']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['nat_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['parent_network']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['parent_network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['additional_announcable_cidrs']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['additional_announcable_cidrs']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['address_family']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['address_family']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['prefixes']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['nat_type']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['nat_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['additional_announcable_cidrs']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['additional_announcable_cidrs']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_NETWORKSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_NETWORKSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_NETWORKSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_NETWORKSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_NETWORKSERVICEGETREQUEST']._serialized_start=194 - _globals['_NETWORKSERVICEGETREQUEST']._serialized_end=249 - _globals['_NETWORKSERVICEGETRESPONSE']._serialized_start=251 - _globals['_NETWORKSERVICEGETRESPONSE']._serialized_end=332 - _globals['_NETWORKSERVICECREATEREQUEST']._serialized_start=335 - _globals['_NETWORKSERVICECREATEREQUEST']._serialized_end=1527 - _globals['_NETWORKSERVICEUPDATEREQUEST']._serialized_start=1530 - _globals['_NETWORKSERVICEUPDATEREQUEST']._serialized_end=2404 - _globals['_NETWORKSERVICEDELETEREQUEST']._serialized_start=2406 - _globals['_NETWORKSERVICEDELETEREQUEST']._serialized_end=2464 - _globals['_NETWORKSERVICELISTREQUEST']._serialized_start=2466 - _globals['_NETWORKSERVICELISTREQUEST']._serialized_end=2548 - _globals['_NETWORKSERVICECREATERESPONSE']._serialized_start=2550 - _globals['_NETWORKSERVICECREATERESPONSE']._serialized_end=2634 - _globals['_NETWORKSERVICEUPDATERESPONSE']._serialized_start=2636 - _globals['_NETWORKSERVICEUPDATERESPONSE']._serialized_end=2720 - _globals['_NETWORKSERVICEDELETERESPONSE']._serialized_start=2722 - _globals['_NETWORKSERVICEDELETERESPONSE']._serialized_end=2806 - _globals['_NETWORKSERVICELISTRESPONSE']._serialized_start=2808 - _globals['_NETWORKSERVICELISTRESPONSE']._serialized_end=2892 - _globals['_NETWORKSERVICE']._serialized_start=2895 - _globals['_NETWORKSERVICE']._serialized_end=3508 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/network_pb2.pyi b/python/metalstack/admin/v2/network_pb2.pyi deleted file mode 100644 index 85ccd36e..00000000 --- a/python/metalstack/admin/v2/network_pb2.pyi +++ /dev/null @@ -1,125 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import network_pb2 as _network_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class NetworkServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class NetworkServiceGetResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: _network_pb2.Network - def __init__(self, network: _Optional[_Union[_network_pb2.Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceCreateRequest(_message.Message): - __slots__ = ("id", "name", "description", "partition", "project", "type", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "length", "address_family") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - DEFAULT_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - MIN_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - NAT_TYPE_FIELD_NUMBER: _ClassVar[int] - VRF_FIELD_NUMBER: _ClassVar[int] - PARENT_NETWORK_FIELD_NUMBER: _ClassVar[int] - ADDITIONAL_ANNOUNCABLE_CIDRS_FIELD_NUMBER: _ClassVar[int] - LENGTH_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FAMILY_FIELD_NUMBER: _ClassVar[int] - id: str - name: str - description: str - partition: str - project: str - type: _network_pb2.NetworkType - labels: _common_pb2.Labels - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - default_child_prefix_length: _network_pb2.ChildPrefixLength - min_child_prefix_length: _network_pb2.ChildPrefixLength - nat_type: _network_pb2.NATType - vrf: int - parent_network: str - additional_announcable_cidrs: _containers.RepeatedScalarFieldContainer[str] - length: _network_pb2.ChildPrefixLength - address_family: _network_pb2.NetworkAddressFamily - def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., partition: _Optional[str] = ..., project: _Optional[str] = ..., type: _Optional[_Union[_network_pb2.NetworkType, str]] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., default_child_prefix_length: _Optional[_Union[_network_pb2.ChildPrefixLength, _Mapping]] = ..., min_child_prefix_length: _Optional[_Union[_network_pb2.ChildPrefixLength, _Mapping]] = ..., nat_type: _Optional[_Union[_network_pb2.NATType, str]] = ..., vrf: _Optional[int] = ..., parent_network: _Optional[str] = ..., additional_announcable_cidrs: _Optional[_Iterable[str]] = ..., length: _Optional[_Union[_network_pb2.ChildPrefixLength, _Mapping]] = ..., address_family: _Optional[_Union[_network_pb2.NetworkAddressFamily, str]] = ...) -> None: ... - -class NetworkServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "name", "description", "labels", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "nat_type", "additional_announcable_cidrs", "force") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - DEFAULT_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - MIN_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - NAT_TYPE_FIELD_NUMBER: _ClassVar[int] - ADDITIONAL_ANNOUNCABLE_CIDRS_FIELD_NUMBER: _ClassVar[int] - FORCE_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - name: str - description: str - labels: _common_pb2.UpdateLabels - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - default_child_prefix_length: _network_pb2.ChildPrefixLength - min_child_prefix_length: _network_pb2.ChildPrefixLength - nat_type: _network_pb2.NATType - additional_announcable_cidrs: _containers.RepeatedScalarFieldContainer[str] - force: bool - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., default_child_prefix_length: _Optional[_Union[_network_pb2.ChildPrefixLength, _Mapping]] = ..., min_child_prefix_length: _Optional[_Union[_network_pb2.ChildPrefixLength, _Mapping]] = ..., nat_type: _Optional[_Union[_network_pb2.NATType, str]] = ..., additional_announcable_cidrs: _Optional[_Iterable[str]] = ..., force: _Optional[bool] = ...) -> None: ... - -class NetworkServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class NetworkServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _network_pb2.NetworkQuery - def __init__(self, query: _Optional[_Union[_network_pb2.NetworkQuery, _Mapping]] = ...) -> None: ... - -class NetworkServiceCreateResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: _network_pb2.Network - def __init__(self, network: _Optional[_Union[_network_pb2.Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceUpdateResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: _network_pb2.Network - def __init__(self, network: _Optional[_Union[_network_pb2.Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceDeleteResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: _network_pb2.Network - def __init__(self, network: _Optional[_Union[_network_pb2.Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceListResponse(_message.Message): - __slots__ = ("networks",) - NETWORKS_FIELD_NUMBER: _ClassVar[int] - networks: _containers.RepeatedCompositeFieldContainer[_network_pb2.Network] - def __init__(self, networks: _Optional[_Iterable[_Union[_network_pb2.Network, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/partition_connect.py b/python/metalstack/admin/v2/partition_connect.py index 84722e1b..9f0299d7 100644 --- a/python/metalstack/admin/v2/partition_connect.py +++ b/python/metalstack/admin/v2/partition_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/partition.proto +# Generated from metalstack/admin/v2/partition.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.partition_pb2 as metalstack_dot_admin_dot_v2_dot_partition__pb2 + +from .partition_pb import PartitionServiceCapacityRequest, PartitionServiceCapacityResponse, PartitionServiceCreateRequest, PartitionServiceCreateResponse, PartitionServiceDeleteRequest, PartitionServiceDeleteResponse, PartitionServiceUpdateRequest, PartitionServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class PartitionService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: PartitionServiceCreateRequest, ctx: RequestContext[PartitionServiceCreateRequest, PartitionServiceCreateResponse]) -> PartitionServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: PartitionServiceUpdateRequest, ctx: RequestContext[PartitionServiceUpdateRequest, PartitionServiceUpdateResponse]) -> PartitionServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: PartitionServiceDeleteRequest, ctx: RequestContext[PartitionServiceDeleteRequest, PartitionServiceDeleteResponse]) -> PartitionServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def capacity(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def capacity(self, request: PartitionServiceCapacityRequest, ctx: RequestContext[PartitionServiceCapacityRequest, PartitionServiceCapacityResponse]) -> PartitionServiceCapacityResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class PartitionServiceASGIApplication(ConnectASGIApplication[PartitionService]): - def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: PartitionService | AsyncGenerator[PartitionService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="Create", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse, + input=PartitionServiceCreateRequest, + output=PartitionServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -50,8 +66,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="Update", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse, + input=PartitionServiceUpdateRequest, + output=PartitionServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -60,8 +76,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse, + input=PartitionServiceDeleteRequest, + output=PartitionServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -70,8 +86,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="Capacity", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse, + input=PartitionServiceCapacityRequest, + output=PartitionServiceCapacityResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.capacity, @@ -92,18 +108,18 @@ def path(self) -> str: class PartitionServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, + request: PartitionServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse: + ) -> PartitionServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse, + input=PartitionServiceCreateRequest, + output=PartitionServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, + request: PartitionServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse: + ) -> PartitionServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse, + input=PartitionServiceUpdateRequest, + output=PartitionServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, + request: PartitionServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse: + ) -> PartitionServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse, + input=PartitionServiceDeleteRequest, + output=PartitionServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def delete( async def capacity( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, + request: PartitionServiceCapacityRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse: + ) -> PartitionServiceCapacityResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Capacity", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse, + input=PartitionServiceCapacityRequest, + output=PartitionServiceCapacityResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class PartitionServiceSync(Protocol): + def create(self, request: PartitionServiceCreateRequest, ctx: RequestContext[PartitionServiceCreateRequest, PartitionServiceCreateResponse]) -> PartitionServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: PartitionServiceUpdateRequest, ctx: RequestContext[PartitionServiceUpdateRequest, PartitionServiceUpdateResponse]) -> PartitionServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: PartitionServiceDeleteRequest, ctx: RequestContext[PartitionServiceDeleteRequest, PartitionServiceDeleteResponse]) -> PartitionServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class PartitionServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def capacity(self, request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def capacity(self, request: PartitionServiceCapacityRequest, ctx: RequestContext[PartitionServiceCapacityRequest, PartitionServiceCapacityResponse]) -> PartitionServiceCapacityResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class PartitionServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: PartitionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: PartitionServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.PartitionService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse, + input=PartitionServiceCreateRequest, + output=PartitionServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -203,8 +225,8 @@ def __init__(self, service: PartitionServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="Update", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse, + input=PartitionServiceUpdateRequest, + output=PartitionServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -213,8 +235,8 @@ def __init__(self, service: PartitionServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse, + input=PartitionServiceDeleteRequest, + output=PartitionServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -223,8 +245,8 @@ def __init__(self, service: PartitionServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="Capacity", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse, + input=PartitionServiceCapacityRequest, + output=PartitionServiceCapacityResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.capacity, @@ -245,82 +267,77 @@ def path(self) -> str: class PartitionServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, + request: PartitionServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse: + ) -> PartitionServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCreateResponse, + input=PartitionServiceCreateRequest, + output=PartitionServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, + request: PartitionServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse: + ) -> PartitionServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceUpdateResponse, + input=PartitionServiceUpdateRequest, + output=PartitionServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, + request: PartitionServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse: + ) -> PartitionServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceDeleteResponse, + input=PartitionServiceDeleteRequest, + output=PartitionServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def capacity( self, - request: metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, + request: PartitionServiceCapacityRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse: + ) -> PartitionServiceCapacityResponse: return self.execute_unary( request=request, method=MethodInfo( name="Capacity", service_name="metalstack.admin.v2.PartitionService", - input=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityRequest, - output=metalstack_dot_admin_dot_v2_dot_partition__pb2.PartitionServiceCapacityResponse, + input=PartitionServiceCapacityRequest, + output=PartitionServiceCapacityResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/partition_pb.py b/python/metalstack/admin/v2/partition_pb.py new file mode 100644 index 00000000..6ef60577 --- /dev/null +++ b/python/metalstack/admin/v2/partition_pb.py @@ -0,0 +1,566 @@ +# Generated from metalstack/admin/v2/partition.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, partition_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import UpdateLabels, UpdateMeta + from ...api.v2.partition_pb import DNSServer, NTPServer, Partition, PartitionBootConfiguration + + +_PartitionServiceCreateRequestFields: TypeAlias = Literal["partition"] + +class PartitionServiceCreateRequest(Message[_PartitionServiceCreateRequestFields]): + """ + PartitionServiceCreateRequest is the request payload for a partition create request + + ```proto + message metalstack.admin.v2.PartitionServiceCreateRequest + ``` + + Attributes: + partition: + Partition the partition + + ```proto + optional metalstack.api.v2.Partition partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: Partition | None = None, + ) -> None: + pass + + partition: Partition | None + +_PartitionServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses", "labels"] + +class PartitionServiceUpdateRequest(Message[_PartitionServiceUpdateRequestFields]): + """ + PartitionServiceUpdateRequest is the request payload for updating a partition. + + ```proto + message metalstack.admin.v2.PartitionServiceUpdateRequest + ``` + + Attributes: + id: + ID of this partition + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + description: + Description of this partition + + ```proto + optional string description = 3; + ``` + boot_configuration: + PartitionBootConfiguration defines how metal-hammer boots + + ```proto + optional metalstack.api.v2.PartitionBootConfiguration boot_configuration = 4; + ``` + dns_servers: + DNSServers for this partition + + ```proto + repeated metalstack.api.v2.DNSServer dns_servers = 5; + ``` + ntp_servers: + NTPServers for this partition + + ```proto + repeated metalstack.api.v2.NTPServer ntp_servers = 6; + ``` + mgmt_service_addresses: + ManagementServiceAddresses defines where the management is reachable + must be in the form : + + ```proto + repeated string mgmt_service_addresses = 7; + ``` + labels: + Labels to update on this network + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 8; + ``` + """ + + __slots__ = ("id", "update_meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + description: str | None = None, + boot_configuration: PartitionBootConfiguration | None = None, + dns_servers: list[DNSServer] | None = None, + ntp_servers: list[NTPServer] | None = None, + mgmt_service_addresses: list[str] | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + description: str + boot_configuration: PartitionBootConfiguration | None + dns_servers: list[DNSServer] + ntp_servers: list[NTPServer] + mgmt_service_addresses: list[str] + labels: UpdateLabels | None + +_PartitionServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class PartitionServiceDeleteRequest(Message[_PartitionServiceDeleteRequestFields]): + """ + PartitionServiceDeleteRequest is the request payload for a partition delete request + + ```proto + message metalstack.admin.v2.PartitionServiceDeleteRequest + ``` + + Attributes: + id: + ID of the partition to delete + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_PartitionServiceCreateResponseFields: TypeAlias = Literal["partition"] + +class PartitionServiceCreateResponse(Message[_PartitionServiceCreateResponseFields]): + """ + PartitionServiceCreateResponse is the response payload for a partition create request + + ```proto + message metalstack.admin.v2.PartitionServiceCreateResponse + ``` + + Attributes: + partition: + Partition the partition + + ```proto + optional metalstack.api.v2.Partition partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: Partition | None = None, + ) -> None: + pass + + partition: Partition | None + +_PartitionServiceUpdateResponseFields: TypeAlias = Literal["partition"] + +class PartitionServiceUpdateResponse(Message[_PartitionServiceUpdateResponseFields]): + """ + PartitionServiceUpdateResponse is the response payload for a partition update request + + ```proto + message metalstack.admin.v2.PartitionServiceUpdateResponse + ``` + + Attributes: + partition: + Partition the partition + + ```proto + optional metalstack.api.v2.Partition partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: Partition | None = None, + ) -> None: + pass + + partition: Partition | None + +_PartitionServiceDeleteResponseFields: TypeAlias = Literal["partition"] + +class PartitionServiceDeleteResponse(Message[_PartitionServiceDeleteResponseFields]): + """ + PartitionServiceDeleteResponse is the response payload for deleting a partition. + + ```proto + message metalstack.admin.v2.PartitionServiceDeleteResponse + ``` + + Attributes: + partition: + Partition contains the deleted partition + + ```proto + optional metalstack.api.v2.Partition partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: Partition | None = None, + ) -> None: + pass + + partition: Partition | None + +_PartitionServiceCapacityRequestFields: TypeAlias = Literal["id", "size", "project"] + +class PartitionServiceCapacityRequest(Message[_PartitionServiceCapacityRequestFields]): + """ + PartitionServiceCapacityRequest is the request payload for getting partition capacity. + + ```proto + message metalstack.admin.v2.PartitionServiceCapacityRequest + ``` + + Attributes: + id: + ID of the partition to get + + ```proto + optional string id = 1; + ``` + size: + Size of machines to show the capacity + + ```proto + optional string size = 2; + ``` + project: + Project of machines to show the capacity + + ```proto + optional string project = 3; + ``` + """ + + __slots__ = ("id", "size", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + size: str | None = None, + project: str | None = None, + ) -> None: + pass + + id: str + size: str + project: str + +_PartitionServiceCapacityResponseFields: TypeAlias = Literal["partition_capacity"] + +class PartitionServiceCapacityResponse(Message[_PartitionServiceCapacityResponseFields]): + """ + PartitionServiceCapacityResponse is the response payload for a partition capacity request + + ```proto + message metalstack.admin.v2.PartitionServiceCapacityResponse + ``` + + Attributes: + partition_capacity: + PartitionCapacity is a capacity report per partition + + ```proto + repeated metalstack.admin.v2.PartitionCapacity partition_capacity = 1; + ``` + """ + + __slots__ = ("partition_capacity",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition_capacity: list[PartitionCapacity] | None = None, + ) -> None: + pass + + partition_capacity: list[PartitionCapacity] + +_PartitionCapacityFields: TypeAlias = Literal["partition", "machine_size_capacities"] + +class PartitionCapacity(Message[_PartitionCapacityFields]): + """ + PartitionCapacity is the capacity of one partition + + ```proto + message metalstack.admin.v2.PartitionCapacity + ``` + + Attributes: + partition: + Partition of which this capacity is reported. + + ```proto + string partition = 1; + ``` + machine_size_capacities: + MachineSizeCapacities is the capacity per machine size. + + ```proto + repeated metalstack.admin.v2.MachineSizeCapacity machine_size_capacities = 2; + ``` + """ + + __slots__ = ("partition", "machine_size_capacities") + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: str = "", + machine_size_capacities: list[MachineSizeCapacity] | None = None, + ) -> None: + pass + + partition: str + machine_size_capacities: list[MachineSizeCapacity] + +_MachineSizeCapacityFields: TypeAlias = Literal["size", "total", "phoned_home", "waiting", "other", "other_machines", "allocated", "allocatable", "free", "unavailable", "faulty", "faulty_machines", "reservations", "used_reservations", "remaining_reservations"] + +class MachineSizeCapacity(Message[_MachineSizeCapacityFields]): + """ + ServerCapacity is the capacity of one server type, eg machine size + + ```proto + message metalstack.admin.v2.MachineSizeCapacity + ``` + + Attributes: + size: + Size is the size id correlating to all counts in this server capacity. + + ```proto + string size = 2; + ``` + total: + Total is the total amount of machines for this size. + + ```proto + int64 total = 3; + ``` + phoned_home: + PhonedHome is the amount of machines that are currently in the provisioning state "phoned home". + + ```proto + int64 phoned_home = 4; + ``` + waiting: + Waiting is the amount of machines that are currently in the provisioning state "waiting". + + ```proto + int64 waiting = 5; + ``` + other: + Other is the amount of machines that are neither in the provisioning state waiting nor in phoned home but in another provisioning state. + + ```proto + int64 other = 6; + ``` + other_machines: + OtherMachines contains the machine IDs for machines that were classified into "Other". + + ```proto + repeated string other_machines = 7; + ``` + allocated: + Allocated is the amount of machines that are currently allocated. + + ```proto + int64 allocated = 8; + ``` + allocatable: + Allocatable is the amount of machines in a partition is the amount of machines that can be allocated. + Effectively this is the amount of waiting machines minus the machines that are unavailable due to machine state or un-allocatable. Size reservations are not considered in this count. + + ```proto + int64 allocatable = 9; + ``` + free: + Free is the amount of machines in a partition that can be freely allocated at any given moment by a project. + Effectively this is the amount of waiting machines minus the machines that are unavailable due to machine state or un-allocatable due to size reservations. + + ```proto + int64 free = 10; + ``` + unavailable: + Unavailable is the amount of machine in a partition that are currently not allocatable because they are not waiting or + not in the machine state "available", e.g. locked or reserved. + + ```proto + int64 unavailable = 11; + ``` + faulty: + Faulty is the amount of machines that are neither allocated nor in the pool of available machines because they report an error. + + ```proto + int64 faulty = 12; + ``` + faulty_machines: + FaultyMachines contains the machine IDs for machines that were classified into "Faulty". + + ```proto + repeated string faulty_machines = 13; + ``` + reservations: + Reservations is the amount of reservations made for this size. + + ```proto + int64 reservations = 14; + ``` + used_reservations: + UsedReservations is the amount of reservations already used up for this size. + + ```proto + int64 used_reservations = 15; + ``` + remaining_reservations: + RemainingReservations is the amount of reservations remaining for this size. + + ```proto + int64 remaining_reservations = 16; + ``` + """ + + __slots__ = ("size", "total", "phoned_home", "waiting", "other", "other_machines", "allocated", "allocatable", "free", "unavailable", "faulty", "faulty_machines", "reservations", "used_reservations", "remaining_reservations") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + total: int = 0, + phoned_home: int = 0, + waiting: int = 0, + other: int = 0, + other_machines: list[str] | None = None, + allocated: int = 0, + allocatable: int = 0, + free: int = 0, + unavailable: int = 0, + faulty: int = 0, + faulty_machines: list[str] | None = None, + reservations: int = 0, + used_reservations: int = 0, + remaining_reservations: int = 0, + ) -> None: + pass + + size: str + total: int + phoned_home: int + waiting: int + other: int + other_machines: list[str] + allocated: int + allocatable: int + free: int + unavailable: int + faulty: int + faulty_machines: list[str] + reservations: int + used_reservations: int + remaining_reservations: int + + +_DESC = file_desc( + b'\n#metalstack/admin/v2/partition.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/partition.proto\x1a(metalstack/api/v2/predefined_rules.proto"[\n\x1dPartitionServiceCreateRequest\x12:\n\tpartition\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition"\xc5\x04\n\x1dPartitionServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\\\n\x12boot_configuration\x18\x04 \x01(\x0b2-.metalstack.api.v2.PartitionBootConfigurationR\x11bootConfiguration\x12G\n\x0bdns_servers\x18\x05 \x03(\x0b2\x1c.metalstack.api.v2.DNSServerR\ndnsServersB\x08\xbaH\x05\x92\x01\x02\x10\x03\x12G\n\x0bntp_servers\x18\x06 \x03(\x0b2\x1c.metalstack.api.v2.NTPServerR\nntpServersB\x08\xbaH\x05\x92\x01\x02\x10\n\x12B\n\x16mgmt_service_addresses\x18\x07 \x03(\tR\x14mgmtServiceAddressesB\x0c\xbaH\t\x92\x01\x06\xc8\xa4\xb3\xb1\x02\x01\x12<\n\x06labels\x18\x08 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x01R\x06labels\x88\x01\x01B\x0e\n\x0c_descriptionB\t\n\x07_labels"<\n\x1dPartitionServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"\\\n\x1ePartitionServiceCreateResponse\x12:\n\tpartition\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition"\\\n\x1ePartitionServiceUpdateResponse\x12:\n\tpartition\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition"\\\n\x1ePartitionServiceDeleteResponse\x12:\n\tpartition\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition"\xae\x01\n\x1fPartitionServiceCapacityRequest\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04size\x18\x02 \x01(\tH\x01R\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tH\x02R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\x05\n\x03_idB\x07\n\x05_sizeB\n\n\x08_project"y\n PartitionServiceCapacityResponse\x12U\n\x12partition_capacity\x18\x01 \x03(\x0b2&.metalstack.admin.v2.PartitionCapacityR\x11partitionCapacity"\xa0\x01\n\x11PartitionCapacity\x12)\n\tpartition\x18\x01 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12`\n\x17machine_size_capacities\x18\x02 \x03(\x0b2(.metalstack.admin.v2.MachineSizeCapacityR\x15machineSizeCapacities"\x83\x04\n\x13MachineSizeCapacity\x12\x1f\n\x04size\x18\x02 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x14\n\x05total\x18\x03 \x01(\x03R\x05total\x12\x1f\n\x0bphoned_home\x18\x04 \x01(\x03R\nphonedHome\x12\x18\n\x07waiting\x18\x05 \x01(\x03R\x07waiting\x12\x14\n\x05other\x18\x06 \x01(\x03R\x05other\x12%\n\x0eother_machines\x18\x07 \x03(\tR\rotherMachines\x12\x1c\n\tallocated\x18\x08 \x01(\x03R\tallocated\x12 \n\x0ballocatable\x18\t \x01(\x03R\x0ballocatable\x12\x12\n\x04free\x18\n \x01(\x03R\x04free\x12 \n\x0bunavailable\x18\x0b \x01(\x03R\x0bunavailable\x12\x16\n\x06faulty\x18\x0c \x01(\x03R\x06faulty\x12\'\n\x0ffaulty_machines\x18\r \x03(\tR\x0efaultyMachines\x12"\n\x0creservations\x18\x0e \x01(\x03R\x0creservations\x12+\n\x11used_reservations\x18\x0f \x01(\x03R\x10usedReservations\x125\n\x16remaining_reservations\x18\x10 \x01(\x03R\x15remainingReservations2\x92\x04\n\x10PartitionService\x12|\n\x06Create\x122.metalstack.admin.v2.PartitionServiceCreateRequest\x1a3.metalstack.admin.v2.PartitionServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x06Update\x122.metalstack.admin.v2.PartitionServiceUpdateRequest\x1a3.metalstack.admin.v2.PartitionServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x06Delete\x122.metalstack.admin.v2.PartitionServiceDeleteRequest\x1a3.metalstack.admin.v2.PartitionServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x08Capacity\x124.metalstack.admin.v2.PartitionServiceCapacityRequest\x1a5.metalstack.admin.v2.PartitionServiceCapacityResponse"\n\xd2\xf3\x18\x02\x02\x01\xe0\xf3\x18\x02B\xd2\x01\n\x17com.metalstack.admin.v2B\x0ePartitionProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + partition_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "PartitionServiceCreateRequest": PartitionServiceCreateRequest, + "PartitionServiceUpdateRequest": PartitionServiceUpdateRequest, + "PartitionServiceDeleteRequest": PartitionServiceDeleteRequest, + "PartitionServiceCreateResponse": PartitionServiceCreateResponse, + "PartitionServiceUpdateResponse": PartitionServiceUpdateResponse, + "PartitionServiceDeleteResponse": PartitionServiceDeleteResponse, + "PartitionServiceCapacityRequest": PartitionServiceCapacityRequest, + "PartitionServiceCapacityResponse": PartitionServiceCapacityResponse, + "PartitionCapacity": PartitionCapacity, + "MachineSizeCapacity": MachineSizeCapacity, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/partition.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/partition_pb2.py b/python/metalstack/admin/v2/partition_pb2.py deleted file mode 100644 index a2888b84..00000000 --- a/python/metalstack/admin/v2/partition_pb2.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/partition.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/partition.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import partition_pb2 as metalstack_dot_api_dot_v2_dot_partition__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#metalstack/admin/v2/partition.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/partition.proto\x1a(metalstack/api/v2/predefined_rules.proto\"[\n\x1dPartitionServiceCreateRequest\x12:\n\tpartition\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\"\xc5\x04\n\x1dPartitionServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\\\n\x12\x62oot_configuration\x18\x04 \x01(\x0b\x32-.metalstack.api.v2.PartitionBootConfigurationR\x11\x62ootConfiguration\x12G\n\x0b\x64ns_servers\x18\x05 \x03(\x0b\x32\x1c.metalstack.api.v2.DNSServerB\x08\xbaH\x05\x92\x01\x02\x10\x03R\ndnsServers\x12G\n\x0bntp_servers\x18\x06 \x03(\x0b\x32\x1c.metalstack.api.v2.NTPServerB\x08\xbaH\x05\x92\x01\x02\x10\nR\nntpServers\x12\x42\n\x16mgmt_service_addresses\x18\x07 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc8\xa4\xb3\xb1\x02\x01R\x14mgmtServiceAddresses\x12<\n\x06labels\x18\x08 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x01R\x06labels\x88\x01\x01\x42\x0e\n\x0c_descriptionB\t\n\x07_labels\"<\n\x1dPartitionServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\x02id\"\\\n\x1ePartitionServiceCreateResponse\x12:\n\tpartition\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\"\\\n\x1ePartitionServiceUpdateResponse\x12:\n\tpartition\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\"\\\n\x1ePartitionServiceDeleteResponse\x12:\n\tpartition\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\"\xae\x01\n\x1fPartitionServiceCapacityRequest\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12$\n\x04size\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04size\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x02R\x07project\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_sizeB\n\n\x08_project\"y\n PartitionServiceCapacityResponse\x12U\n\x12partition_capacity\x18\x01 \x03(\x0b\x32&.metalstack.admin.v2.PartitionCapacityR\x11partitionCapacity\"\xa0\x01\n\x11PartitionCapacity\x12)\n\tpartition\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\x12`\n\x17machine_size_capacities\x18\x02 \x03(\x0b\x32(.metalstack.admin.v2.MachineSizeCapacityR\x15machineSizeCapacities\"\x83\x04\n\x13MachineSizeCapacity\x12\x1f\n\x04size\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12\x14\n\x05total\x18\x03 \x01(\x03R\x05total\x12\x1f\n\x0bphoned_home\x18\x04 \x01(\x03R\nphonedHome\x12\x18\n\x07waiting\x18\x05 \x01(\x03R\x07waiting\x12\x14\n\x05other\x18\x06 \x01(\x03R\x05other\x12%\n\x0eother_machines\x18\x07 \x03(\tR\rotherMachines\x12\x1c\n\tallocated\x18\x08 \x01(\x03R\tallocated\x12 \n\x0b\x61llocatable\x18\t \x01(\x03R\x0b\x61llocatable\x12\x12\n\x04\x66ree\x18\n \x01(\x03R\x04\x66ree\x12 \n\x0bunavailable\x18\x0b \x01(\x03R\x0bunavailable\x12\x16\n\x06\x66\x61ulty\x18\x0c \x01(\x03R\x06\x66\x61ulty\x12\'\n\x0f\x66\x61ulty_machines\x18\r \x03(\tR\x0e\x66\x61ultyMachines\x12\"\n\x0creservations\x18\x0e \x01(\x03R\x0creservations\x12+\n\x11used_reservations\x18\x0f \x01(\x03R\x10usedReservations\x12\x35\n\x16remaining_reservations\x18\x10 \x01(\x03R\x15remainingReservations2\x92\x04\n\x10PartitionService\x12|\n\x06\x43reate\x12\x32.metalstack.admin.v2.PartitionServiceCreateRequest\x1a\x33.metalstack.admin.v2.PartitionServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x06Update\x12\x32.metalstack.admin.v2.PartitionServiceUpdateRequest\x1a\x33.metalstack.admin.v2.PartitionServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12|\n\x06\x44\x65lete\x12\x32.metalstack.admin.v2.PartitionServiceDeleteRequest\x1a\x33.metalstack.admin.v2.PartitionServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x08\x43\x61pacity\x12\x34.metalstack.admin.v2.PartitionServiceCapacityRequest\x1a\x35.metalstack.admin.v2.PartitionServiceCapacityResponse\"\n\xd2\xf3\x18\x02\x02\x01\xe0\xf3\x18\x02\x42\xd2\x01\n\x17\x63om.metalstack.admin.v2B\x0ePartitionProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.partition_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\016PartitionProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['dns_servers']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['dns_servers']._serialized_options = b'\272H\005\222\001\002\020\003' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['ntp_servers']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['ntp_servers']._serialized_options = b'\272H\005\222\001\002\020\n' - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['mgmt_service_addresses']._loaded_options = None - _globals['_PARTITIONSERVICEUPDATEREQUEST'].fields_by_name['mgmt_service_addresses']._serialized_options = b'\272H\t\222\001\006\310\244\263\261\002\001' - _globals['_PARTITIONSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_PARTITIONSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PARTITIONSERVICECAPACITYREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PARTITIONCAPACITY'].fields_by_name['partition']._loaded_options = None - _globals['_PARTITIONCAPACITY'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_MACHINESIZECAPACITY'].fields_by_name['size']._loaded_options = None - _globals['_MACHINESIZECAPACITY'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PARTITIONSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_PARTITIONSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_PARTITIONSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_PARTITIONSERVICE'].methods_by_name['Capacity']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['Capacity']._serialized_options = b'\322\363\030\002\002\001\340\363\030\002' - _globals['_PARTITIONSERVICECREATEREQUEST']._serialized_start=198 - _globals['_PARTITIONSERVICECREATEREQUEST']._serialized_end=289 - _globals['_PARTITIONSERVICEUPDATEREQUEST']._serialized_start=292 - _globals['_PARTITIONSERVICEUPDATEREQUEST']._serialized_end=873 - _globals['_PARTITIONSERVICEDELETEREQUEST']._serialized_start=875 - _globals['_PARTITIONSERVICEDELETEREQUEST']._serialized_end=935 - _globals['_PARTITIONSERVICECREATERESPONSE']._serialized_start=937 - _globals['_PARTITIONSERVICECREATERESPONSE']._serialized_end=1029 - _globals['_PARTITIONSERVICEUPDATERESPONSE']._serialized_start=1031 - _globals['_PARTITIONSERVICEUPDATERESPONSE']._serialized_end=1123 - _globals['_PARTITIONSERVICEDELETERESPONSE']._serialized_start=1125 - _globals['_PARTITIONSERVICEDELETERESPONSE']._serialized_end=1217 - _globals['_PARTITIONSERVICECAPACITYREQUEST']._serialized_start=1220 - _globals['_PARTITIONSERVICECAPACITYREQUEST']._serialized_end=1394 - _globals['_PARTITIONSERVICECAPACITYRESPONSE']._serialized_start=1396 - _globals['_PARTITIONSERVICECAPACITYRESPONSE']._serialized_end=1517 - _globals['_PARTITIONCAPACITY']._serialized_start=1520 - _globals['_PARTITIONCAPACITY']._serialized_end=1680 - _globals['_MACHINESIZECAPACITY']._serialized_start=1683 - _globals['_MACHINESIZECAPACITY']._serialized_end=2198 - _globals['_PARTITIONSERVICE']._serialized_start=2201 - _globals['_PARTITIONSERVICE']._serialized_end=2731 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/partition_pb2.pyi b/python/metalstack/admin/v2/partition_pb2.pyi deleted file mode 100644 index 848ade2d..00000000 --- a/python/metalstack/admin/v2/partition_pb2.pyi +++ /dev/null @@ -1,119 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import partition_pb2 as _partition_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class PartitionServiceCreateRequest(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: _partition_pb2.Partition - def __init__(self, partition: _Optional[_Union[_partition_pb2.Partition, _Mapping]] = ...) -> None: ... - -class PartitionServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - BOOT_CONFIGURATION_FIELD_NUMBER: _ClassVar[int] - DNS_SERVERS_FIELD_NUMBER: _ClassVar[int] - NTP_SERVERS_FIELD_NUMBER: _ClassVar[int] - MGMT_SERVICE_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - description: str - boot_configuration: _partition_pb2.PartitionBootConfiguration - dns_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.DNSServer] - ntp_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.NTPServer] - mgmt_service_addresses: _containers.RepeatedScalarFieldContainer[str] - labels: _common_pb2.UpdateLabels - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., description: _Optional[str] = ..., boot_configuration: _Optional[_Union[_partition_pb2.PartitionBootConfiguration, _Mapping]] = ..., dns_servers: _Optional[_Iterable[_Union[_partition_pb2.DNSServer, _Mapping]]] = ..., ntp_servers: _Optional[_Iterable[_Union[_partition_pb2.NTPServer, _Mapping]]] = ..., mgmt_service_addresses: _Optional[_Iterable[str]] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class PartitionServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class PartitionServiceCreateResponse(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: _partition_pb2.Partition - def __init__(self, partition: _Optional[_Union[_partition_pb2.Partition, _Mapping]] = ...) -> None: ... - -class PartitionServiceUpdateResponse(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: _partition_pb2.Partition - def __init__(self, partition: _Optional[_Union[_partition_pb2.Partition, _Mapping]] = ...) -> None: ... - -class PartitionServiceDeleteResponse(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: _partition_pb2.Partition - def __init__(self, partition: _Optional[_Union[_partition_pb2.Partition, _Mapping]] = ...) -> None: ... - -class PartitionServiceCapacityRequest(_message.Message): - __slots__ = ("id", "size", "project") - ID_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - id: str - size: str - project: str - def __init__(self, id: _Optional[str] = ..., size: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class PartitionServiceCapacityResponse(_message.Message): - __slots__ = ("partition_capacity",) - PARTITION_CAPACITY_FIELD_NUMBER: _ClassVar[int] - partition_capacity: _containers.RepeatedCompositeFieldContainer[PartitionCapacity] - def __init__(self, partition_capacity: _Optional[_Iterable[_Union[PartitionCapacity, _Mapping]]] = ...) -> None: ... - -class PartitionCapacity(_message.Message): - __slots__ = ("partition", "machine_size_capacities") - PARTITION_FIELD_NUMBER: _ClassVar[int] - MACHINE_SIZE_CAPACITIES_FIELD_NUMBER: _ClassVar[int] - partition: str - machine_size_capacities: _containers.RepeatedCompositeFieldContainer[MachineSizeCapacity] - def __init__(self, partition: _Optional[str] = ..., machine_size_capacities: _Optional[_Iterable[_Union[MachineSizeCapacity, _Mapping]]] = ...) -> None: ... - -class MachineSizeCapacity(_message.Message): - __slots__ = ("size", "total", "phoned_home", "waiting", "other", "other_machines", "allocated", "allocatable", "free", "unavailable", "faulty", "faulty_machines", "reservations", "used_reservations", "remaining_reservations") - SIZE_FIELD_NUMBER: _ClassVar[int] - TOTAL_FIELD_NUMBER: _ClassVar[int] - PHONED_HOME_FIELD_NUMBER: _ClassVar[int] - WAITING_FIELD_NUMBER: _ClassVar[int] - OTHER_FIELD_NUMBER: _ClassVar[int] - OTHER_MACHINES_FIELD_NUMBER: _ClassVar[int] - ALLOCATED_FIELD_NUMBER: _ClassVar[int] - ALLOCATABLE_FIELD_NUMBER: _ClassVar[int] - FREE_FIELD_NUMBER: _ClassVar[int] - UNAVAILABLE_FIELD_NUMBER: _ClassVar[int] - FAULTY_FIELD_NUMBER: _ClassVar[int] - FAULTY_MACHINES_FIELD_NUMBER: _ClassVar[int] - RESERVATIONS_FIELD_NUMBER: _ClassVar[int] - USED_RESERVATIONS_FIELD_NUMBER: _ClassVar[int] - REMAINING_RESERVATIONS_FIELD_NUMBER: _ClassVar[int] - size: str - total: int - phoned_home: int - waiting: int - other: int - other_machines: _containers.RepeatedScalarFieldContainer[str] - allocated: int - allocatable: int - free: int - unavailable: int - faulty: int - faulty_machines: _containers.RepeatedScalarFieldContainer[str] - reservations: int - used_reservations: int - remaining_reservations: int - def __init__(self, size: _Optional[str] = ..., total: _Optional[int] = ..., phoned_home: _Optional[int] = ..., waiting: _Optional[int] = ..., other: _Optional[int] = ..., other_machines: _Optional[_Iterable[str]] = ..., allocated: _Optional[int] = ..., allocatable: _Optional[int] = ..., free: _Optional[int] = ..., unavailable: _Optional[int] = ..., faulty: _Optional[int] = ..., faulty_machines: _Optional[_Iterable[str]] = ..., reservations: _Optional[int] = ..., used_reservations: _Optional[int] = ..., remaining_reservations: _Optional[int] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/project_connect.py b/python/metalstack/admin/v2/project_connect.py index 320e2bda..e3c7f64a 100644 --- a/python/metalstack/admin/v2/project_connect.py +++ b/python/metalstack/admin/v2/project_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/project.proto +# Generated from metalstack/admin/v2/project.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.project_pb2 as metalstack_dot_admin_dot_v2_dot_project__pb2 + +from .project_pb import ProjectServiceListRequest, ProjectServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ProjectService(Protocol): - async def list(self, request: metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: ProjectServiceListRequest, ctx: RequestContext[ProjectServiceListRequest, ProjectServiceListResponse]) -> ProjectServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ProjectServiceASGIApplication(ConnectASGIApplication[ProjectService]): - def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ProjectService | AsyncGenerator[ProjectService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="List", service_name="metalstack.admin.v2.ProjectService", - input=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -53,43 +69,46 @@ def path(self) -> str: class ProjectServiceClient(ConnectClient): async def list( self, - request: metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, + request: ProjectServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse: + ) -> ProjectServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.ProjectService", - input=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class ProjectServiceSync(Protocol): - def list(self, request: metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: ProjectServiceListRequest, ctx: RequestContext[ProjectServiceListRequest, ProjectServiceListResponse]) -> ProjectServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ProjectServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ProjectServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ProjectServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.ProjectService/List": EndpointSync.unary( method=MethodInfo( name="List", service_name="metalstack.admin.v2.ProjectService", - input=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -110,22 +129,20 @@ def path(self) -> str: class ProjectServiceClientSync(ConnectClientSync): def list( self, - request: metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, + request: ProjectServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse: + ) -> ProjectServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.ProjectService", - input=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/project_pb.py b/python/metalstack/admin/v2/project_pb.py new file mode 100644 index 00000000..943c225a --- /dev/null +++ b/python/metalstack/admin/v2/project_pb.py @@ -0,0 +1,102 @@ +# Generated from metalstack/admin/v2/project.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ...api.v2 import common_pb, project_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.project_pb import Project, ProjectQuery + + +_ProjectServiceListRequestFields: TypeAlias = Literal["query"] + +class ProjectServiceListRequest(Message[_ProjectServiceListRequestFields]): + """ + ProjectServiceListRequest is the request payload for listing projects. + + ```proto + message metalstack.admin.v2.ProjectServiceListRequest + ``` + + Attributes: + query: + Query for projects + + ```proto + optional metalstack.api.v2.ProjectQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: ProjectQuery | None = None, + ) -> None: + pass + + query: ProjectQuery | None + +_ProjectServiceListResponseFields: TypeAlias = Literal["projects"] + +class ProjectServiceListResponse(Message[_ProjectServiceListResponseFields]): + """ + ProjectServiceListResponse is the response payload for listing projects. + + ```proto + message metalstack.admin.v2.ProjectServiceListResponse + ``` + + Attributes: + projects: + Projects contains the list of projects + + ```proto + repeated metalstack.api.v2.Project projects = 1; + ``` + """ + + __slots__ = ("projects",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + projects: list[Project] | None = None, + ) -> None: + pass + + projects: list[Project] + + +_DESC = file_desc( + b'\n!metalstack/admin/v2/project.proto\x12\x13metalstack.admin.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/project.proto"a\n\x19ProjectServiceListRequest\x12:\n\x05query\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.ProjectQueryH\x00R\x05query\x88\x01\x01B\x08\n\x06_query"T\n\x1aProjectServiceListResponse\x126\n\x08projects\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.ProjectR\x08projects2\x85\x01\n\x0eProjectService\x12s\n\x04List\x12..metalstack.admin.v2.ProjectServiceListRequest\x1a/.metalstack.admin.v2.ProjectServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd0\x01\n\x17com.metalstack.admin.v2B\x0cProjectProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + common_pb.desc(), + project_pb.desc(), + ], + { + "ProjectServiceListRequest": ProjectServiceListRequest, + "ProjectServiceListResponse": ProjectServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/project.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/project_pb2.py b/python/metalstack/admin/v2/project_pb2.py deleted file mode 100644 index fa50b61b..00000000 --- a/python/metalstack/admin/v2/project_pb2.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/project.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/project.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import project_pb2 as metalstack_dot_api_dot_v2_dot_project__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/admin/v2/project.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/project.proto\"a\n\x19ProjectServiceListRequest\x12:\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.ProjectQueryH\x00R\x05query\x88\x01\x01\x42\x08\n\x06_query\"T\n\x1aProjectServiceListResponse\x12\x36\n\x08projects\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x08projects2\x85\x01\n\x0eProjectService\x12s\n\x04List\x12..metalstack.admin.v2.ProjectServiceListRequest\x1a/.metalstack.admin.v2.ProjectServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd0\x01\n\x17\x63om.metalstack.admin.v2B\x0cProjectProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.project_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\014ProjectProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_PROJECTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_PROJECTSERVICELISTREQUEST']._serialized_start=194 - _globals['_PROJECTSERVICELISTREQUEST']._serialized_end=291 - _globals['_PROJECTSERVICELISTRESPONSE']._serialized_start=293 - _globals['_PROJECTSERVICELISTRESPONSE']._serialized_end=377 - _globals['_PROJECTSERVICE']._serialized_start=380 - _globals['_PROJECTSERVICE']._serialized_end=513 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/project_pb2.pyi b/python/metalstack/admin/v2/project_pb2.pyi deleted file mode 100644 index 0d4a3650..00000000 --- a/python/metalstack/admin/v2/project_pb2.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import project_pb2 as _project_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ProjectServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _project_pb2.ProjectQuery - def __init__(self, query: _Optional[_Union[_project_pb2.ProjectQuery, _Mapping]] = ...) -> None: ... - -class ProjectServiceListResponse(_message.Message): - __slots__ = ("projects",) - PROJECTS_FIELD_NUMBER: _ClassVar[int] - projects: _containers.RepeatedCompositeFieldContainer[_project_pb2.Project] - def __init__(self, projects: _Optional[_Iterable[_Union[_project_pb2.Project, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/size_connect.py b/python/metalstack/admin/v2/size_connect.py index eaa6ec44..295138b7 100644 --- a/python/metalstack/admin/v2/size_connect.py +++ b/python/metalstack/admin/v2/size_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/size.proto +# Generated from metalstack/admin/v2/size.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.size_pb2 as metalstack_dot_admin_dot_v2_dot_size__pb2 + +from .size_pb import SizeServiceCreateRequest, SizeServiceCreateResponse, SizeServiceDeleteRequest, SizeServiceDeleteResponse, SizeServiceUpdateRequest, SizeServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: SizeServiceCreateRequest, ctx: RequestContext[SizeServiceCreateRequest, SizeServiceCreateResponse]) -> SizeServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: SizeServiceUpdateRequest, ctx: RequestContext[SizeServiceUpdateRequest, SizeServiceUpdateResponse]) -> SizeServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: SizeServiceDeleteRequest, ctx: RequestContext[SizeServiceDeleteRequest, SizeServiceDeleteResponse]) -> SizeServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeServiceASGIApplication(ConnectASGIApplication[SizeService]): - def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeService | AsyncGenerator[SizeService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,8 +53,8 @@ def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interc method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse, + input=SizeServiceCreateRequest, + output=SizeServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -47,8 +63,8 @@ def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interc method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse, + input=SizeServiceUpdateRequest, + output=SizeServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -57,8 +73,8 @@ def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interc method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse, + input=SizeServiceDeleteRequest, + output=SizeServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -79,18 +95,18 @@ def path(self) -> str: class SizeServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, + request: SizeServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse: + ) -> SizeServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse, + input=SizeServiceCreateRequest, + output=SizeServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -99,18 +115,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, + request: SizeServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse: + ) -> SizeServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse, + input=SizeServiceUpdateRequest, + output=SizeServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -119,47 +135,52 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, + request: SizeServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse: + ) -> SizeServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse, + input=SizeServiceDeleteRequest, + output=SizeServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class SizeServiceSync(Protocol): + def create(self, request: SizeServiceCreateRequest, ctx: RequestContext[SizeServiceCreateRequest, SizeServiceCreateResponse]) -> SizeServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: SizeServiceUpdateRequest, ctx: RequestContext[SizeServiceUpdateRequest, SizeServiceUpdateResponse]) -> SizeServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class SizeServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def delete(self, request: SizeServiceDeleteRequest, ctx: RequestContext[SizeServiceDeleteRequest, SizeServiceDeleteResponse]) -> SizeServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.SizeService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse, + input=SizeServiceCreateRequest, + output=SizeServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -168,8 +189,8 @@ def __init__(self, service: SizeServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse, + input=SizeServiceUpdateRequest, + output=SizeServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -178,8 +199,8 @@ def __init__(self, service: SizeServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse, + input=SizeServiceDeleteRequest, + output=SizeServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -200,62 +221,58 @@ def path(self) -> str: class SizeServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, + request: SizeServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse: + ) -> SizeServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceCreateResponse, + input=SizeServiceCreateRequest, + output=SizeServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, + request: SizeServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse: + ) -> SizeServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceUpdateResponse, + input=SizeServiceUpdateRequest, + output=SizeServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, + request: SizeServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse: + ) -> SizeServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeService", - input=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__pb2.SizeServiceDeleteResponse, + input=SizeServiceDeleteRequest, + output=SizeServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/size_imageconstraint_connect.py b/python/metalstack/admin/v2/size_imageconstraint_connect.py index 0c7f5803..5cba5d25 100644 --- a/python/metalstack/admin/v2/size_imageconstraint_connect.py +++ b/python/metalstack/admin/v2/size_imageconstraint_connect.py @@ -1,41 +1,57 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/size_imageconstraint.proto +# Generated from metalstack/admin/v2/size_imageconstraint.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.size_imageconstraint_pb2 as metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2 + +from .size_imageconstraint_pb import SizeImageConstraintServiceCreateRequest, SizeImageConstraintServiceCreateResponse, SizeImageConstraintServiceDeleteRequest, SizeImageConstraintServiceDeleteResponse, SizeImageConstraintServiceGetRequest, SizeImageConstraintServiceGetResponse, SizeImageConstraintServiceListRequest, SizeImageConstraintServiceListResponse, SizeImageConstraintServiceUpdateRequest, SizeImageConstraintServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeImageConstraintService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: SizeImageConstraintServiceCreateRequest, ctx: RequestContext[SizeImageConstraintServiceCreateRequest, SizeImageConstraintServiceCreateResponse]) -> SizeImageConstraintServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: SizeImageConstraintServiceUpdateRequest, ctx: RequestContext[SizeImageConstraintServiceUpdateRequest, SizeImageConstraintServiceUpdateResponse]) -> SizeImageConstraintServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: SizeImageConstraintServiceDeleteRequest, ctx: RequestContext[SizeImageConstraintServiceDeleteRequest, SizeImageConstraintServiceDeleteResponse]) -> SizeImageConstraintServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def get(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: SizeImageConstraintServiceGetRequest, ctx: RequestContext[SizeImageConstraintServiceGetRequest, SizeImageConstraintServiceGetResponse]) -> SizeImageConstraintServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: SizeImageConstraintServiceListRequest, ctx: RequestContext[SizeImageConstraintServiceListRequest, SizeImageConstraintServiceListResponse]) -> SizeImageConstraintServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeImageConstraintServiceASGIApplication(ConnectASGIApplication[SizeImageConstraintService]): - def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImageConstraintService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeImageConstraintService | AsyncGenerator[SizeImageConstraintService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -43,8 +59,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse, + input=SizeImageConstraintServiceCreateRequest, + output=SizeImageConstraintServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -53,8 +69,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse, + input=SizeImageConstraintServiceUpdateRequest, + output=SizeImageConstraintServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -63,8 +79,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse, + input=SizeImageConstraintServiceDeleteRequest, + output=SizeImageConstraintServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -73,8 +89,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse, + input=SizeImageConstraintServiceGetRequest, + output=SizeImageConstraintServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -83,8 +99,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse, + input=SizeImageConstraintServiceListRequest, + output=SizeImageConstraintServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -105,18 +121,18 @@ def path(self) -> str: class SizeImageConstraintServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, + request: SizeImageConstraintServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse: + ) -> SizeImageConstraintServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse, + input=SizeImageConstraintServiceCreateRequest, + output=SizeImageConstraintServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -125,18 +141,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, + request: SizeImageConstraintServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse: + ) -> SizeImageConstraintServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse, + input=SizeImageConstraintServiceUpdateRequest, + output=SizeImageConstraintServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -145,18 +161,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, + request: SizeImageConstraintServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse: + ) -> SizeImageConstraintServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse, + input=SizeImageConstraintServiceDeleteRequest, + output=SizeImageConstraintServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -165,18 +181,18 @@ async def delete( async def get( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, + request: SizeImageConstraintServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse: + ) -> SizeImageConstraintServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse, + input=SizeImageConstraintServiceGetRequest, + output=SizeImageConstraintServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -185,51 +201,58 @@ async def get( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, + request: SizeImageConstraintServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse: + ) -> SizeImageConstraintServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse, + input=SizeImageConstraintServiceListRequest, + output=SizeImageConstraintServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class SizeImageConstraintServiceSync(Protocol): + def create(self, request: SizeImageConstraintServiceCreateRequest, ctx: RequestContext[SizeImageConstraintServiceCreateRequest, SizeImageConstraintServiceCreateResponse]) -> SizeImageConstraintServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: SizeImageConstraintServiceUpdateRequest, ctx: RequestContext[SizeImageConstraintServiceUpdateRequest, SizeImageConstraintServiceUpdateResponse]) -> SizeImageConstraintServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: SizeImageConstraintServiceDeleteRequest, ctx: RequestContext[SizeImageConstraintServiceDeleteRequest, SizeImageConstraintServiceDeleteResponse]) -> SizeImageConstraintServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def get(self, request: SizeImageConstraintServiceGetRequest, ctx: RequestContext[SizeImageConstraintServiceGetRequest, SizeImageConstraintServiceGetResponse]) -> SizeImageConstraintServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class SizeImageConstraintServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def get(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: SizeImageConstraintServiceListRequest, ctx: RequestContext[SizeImageConstraintServiceListRequest, SizeImageConstraintServiceListResponse]) -> SizeImageConstraintServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeImageConstraintServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeImageConstraintServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.SizeImageConstraintService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse, + input=SizeImageConstraintServiceCreateRequest, + output=SizeImageConstraintServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -238,8 +261,8 @@ def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterab method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse, + input=SizeImageConstraintServiceUpdateRequest, + output=SizeImageConstraintServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -248,8 +271,8 @@ def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterab method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse, + input=SizeImageConstraintServiceDeleteRequest, + output=SizeImageConstraintServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -258,8 +281,8 @@ def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterab method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse, + input=SizeImageConstraintServiceGetRequest, + output=SizeImageConstraintServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -268,8 +291,8 @@ def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterab method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse, + input=SizeImageConstraintServiceListRequest, + output=SizeImageConstraintServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -290,102 +313,96 @@ def path(self) -> str: class SizeImageConstraintServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, + request: SizeImageConstraintServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse: + ) -> SizeImageConstraintServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceCreateResponse, + input=SizeImageConstraintServiceCreateRequest, + output=SizeImageConstraintServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, + request: SizeImageConstraintServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse: + ) -> SizeImageConstraintServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceUpdateResponse, + input=SizeImageConstraintServiceUpdateRequest, + output=SizeImageConstraintServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, + request: SizeImageConstraintServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse: + ) -> SizeImageConstraintServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceDeleteResponse, + input=SizeImageConstraintServiceDeleteRequest, + output=SizeImageConstraintServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def get( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, + request: SizeImageConstraintServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse: + ) -> SizeImageConstraintServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceGetResponse, + input=SizeImageConstraintServiceGetRequest, + output=SizeImageConstraintServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, + request: SizeImageConstraintServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse: + ) -> SizeImageConstraintServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeImageConstraintService", - input=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceListResponse, + input=SizeImageConstraintServiceListRequest, + output=SizeImageConstraintServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/size_imageconstraint_pb.py b/python/metalstack/admin/v2/size_imageconstraint_pb.py new file mode 100644 index 00000000..0111185f --- /dev/null +++ b/python/metalstack/admin/v2/size_imageconstraint_pb.py @@ -0,0 +1,434 @@ +# Generated from metalstack/admin/v2/size_imageconstraint.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, size_imageconstraint_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import Meta, UpdateMeta + from ...api.v2.size_imageconstraint_pb import ImageConstraint, SizeImageConstraint, SizeImageConstraintQuery + + +_SizeImageConstraintServiceCreateRequestFields: TypeAlias = Literal["size", "image_constraints", "meta", "name", "description"] + +class SizeImageConstraintServiceCreateRequest(Message[_SizeImageConstraintServiceCreateRequestFields]): + """ + SizeImageConstraintServiceCreateRequest is the request payload for creating a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceCreateRequest + ``` + + Attributes: + size: + Size of the constraint + + ```proto + string size = 1; + ``` + image_constraints: + ImageConstraints to apply to this size + + ```proto + repeated metalstack.api.v2.ImageConstraint image_constraints = 2; + ``` + meta: + Meta for this size image constraint + + ```proto + optional metalstack.api.v2.Meta meta = 3; + ``` + name: + Name of this size image constraint + + ```proto + optional string name = 4; + ``` + description: + Description of this size image constraint + + ```proto + optional string description = 5; + ``` + """ + + __slots__ = ("size", "image_constraints", "meta", "name", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + image_constraints: list[ImageConstraint] | None = None, + meta: Meta | None = None, + name: str | None = None, + description: str | None = None, + ) -> None: + pass + + size: str + image_constraints: list[ImageConstraint] + meta: Meta | None + name: str + description: str + +_SizeImageConstraintServiceCreateResponseFields: TypeAlias = Literal["size_image_constraint"] + +class SizeImageConstraintServiceCreateResponse(Message[_SizeImageConstraintServiceCreateResponseFields]): + """ + SizeImageConstraintServiceCreateResponse is the response payload for creating a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceCreateResponse + ``` + + Attributes: + size_image_constraint: + SizeImageConstraint contains the created constraint + + ```proto + optional metalstack.api.v2.SizeImageConstraint size_image_constraint = 1; + ``` + """ + + __slots__ = ("size_image_constraint",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_image_constraint: SizeImageConstraint | None = None, + ) -> None: + pass + + size_image_constraint: SizeImageConstraint | None + +_SizeImageConstraintServiceUpdateRequestFields: TypeAlias = Literal["size", "update_meta", "image_constraints", "name", "description"] + +class SizeImageConstraintServiceUpdateRequest(Message[_SizeImageConstraintServiceUpdateRequestFields]): + """ + SizeImageConstraintServiceUpdateRequest is the request payload for updating a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceUpdateRequest + ``` + + Attributes: + size: + Size of the image constraint to update + + ```proto + string size = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + image_constraints: + ImageConstraints to apply to this size + + ```proto + repeated metalstack.api.v2.ImageConstraint image_constraints = 3; + ``` + name: + Name of this size image constraint + + ```proto + optional string name = 4; + ``` + description: + Description of this size image constraint + + ```proto + optional string description = 5; + ``` + """ + + __slots__ = ("size", "update_meta", "image_constraints", "name", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + update_meta: UpdateMeta | None = None, + image_constraints: list[ImageConstraint] | None = None, + name: str | None = None, + description: str | None = None, + ) -> None: + pass + + size: str + update_meta: UpdateMeta | None + image_constraints: list[ImageConstraint] + name: str + description: str + +_SizeImageConstraintServiceUpdateResponseFields: TypeAlias = Literal["size_image_constraint"] + +class SizeImageConstraintServiceUpdateResponse(Message[_SizeImageConstraintServiceUpdateResponseFields]): + """ + SizeImageConstraintServiceUpdateResponse is the response payload for updating a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceUpdateResponse + ``` + + Attributes: + size_image_constraint: + SizeImageConstraint contains the updated constraint + + ```proto + optional metalstack.api.v2.SizeImageConstraint size_image_constraint = 1; + ``` + """ + + __slots__ = ("size_image_constraint",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_image_constraint: SizeImageConstraint | None = None, + ) -> None: + pass + + size_image_constraint: SizeImageConstraint | None + +_SizeImageConstraintServiceDeleteRequestFields: TypeAlias = Literal["size"] + +class SizeImageConstraintServiceDeleteRequest(Message[_SizeImageConstraintServiceDeleteRequestFields]): + """ + SizeImageConstraintServiceDeleteRequest is the request payload for deleting a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceDeleteRequest + ``` + + Attributes: + size: + Size of the constraint + + ```proto + string size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + ) -> None: + pass + + size: str + +_SizeImageConstraintServiceDeleteResponseFields: TypeAlias = Literal["size_image_constraint"] + +class SizeImageConstraintServiceDeleteResponse(Message[_SizeImageConstraintServiceDeleteResponseFields]): + """ + SizeImageConstraintServiceDeleteResponse is the response payload for deleting a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceDeleteResponse + ``` + + Attributes: + size_image_constraint: + SizeImageConstraint contains the deleted constraint + + ```proto + optional metalstack.api.v2.SizeImageConstraint size_image_constraint = 1; + ``` + """ + + __slots__ = ("size_image_constraint",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_image_constraint: SizeImageConstraint | None = None, + ) -> None: + pass + + size_image_constraint: SizeImageConstraint | None + +_SizeImageConstraintServiceGetRequestFields: TypeAlias = Literal["size"] + +class SizeImageConstraintServiceGetRequest(Message[_SizeImageConstraintServiceGetRequestFields]): + """ + SizeImageConstraintServiceGetRequest is the request payload for getting a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceGetRequest + ``` + + Attributes: + size: + Size of the constraint + + ```proto + string size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + ) -> None: + pass + + size: str + +_SizeImageConstraintServiceGetResponseFields: TypeAlias = Literal["size_image_constraint"] + +class SizeImageConstraintServiceGetResponse(Message[_SizeImageConstraintServiceGetResponseFields]): + """ + SizeImageConstraintServiceGetResponse is the response payload for getting a size image constraint. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceGetResponse + ``` + + Attributes: + size_image_constraint: + SizeImageConstraint contains the retrieved constraint + + ```proto + optional metalstack.api.v2.SizeImageConstraint size_image_constraint = 1; + ``` + """ + + __slots__ = ("size_image_constraint",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_image_constraint: SizeImageConstraint | None = None, + ) -> None: + pass + + size_image_constraint: SizeImageConstraint | None + +_SizeImageConstraintServiceListRequestFields: TypeAlias = Literal["query"] + +class SizeImageConstraintServiceListRequest(Message[_SizeImageConstraintServiceListRequestFields]): + """ + SizeImageConstraintServiceListRequest is the request payload for listing size image constraints. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceListRequest + ``` + + Attributes: + query: + Query for size image constraints + + ```proto + optional metalstack.api.v2.SizeImageConstraintQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: SizeImageConstraintQuery | None = None, + ) -> None: + pass + + query: SizeImageConstraintQuery | None + +_SizeImageConstraintServiceListResponseFields: TypeAlias = Literal["size_image_constraints"] + +class SizeImageConstraintServiceListResponse(Message[_SizeImageConstraintServiceListResponseFields]): + """ + SizeImageConstraintServiceListResponse is the response payload for listing size image constraints. + + ```proto + message metalstack.admin.v2.SizeImageConstraintServiceListResponse + ``` + + Attributes: + size_image_constraints: + SizeImageConstraints contains the list of constraints + + ```proto + repeated metalstack.api.v2.SizeImageConstraint size_image_constraints = 1; + ``` + """ + + __slots__ = ("size_image_constraints",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_image_constraints: list[SizeImageConstraint] | None = None, + ) -> None: + pass + + size_image_constraints: list[SizeImageConstraint] + + +_DESC = file_desc( + b'\n.metalstack/admin/v2/size_imageconstraint.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a,metalstack/api/v2/size_imageconstraint.proto"\xbb\x02\n\'SizeImageConstraintServiceCreateRequest\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12O\n\x11image_constraints\x18\x02 \x03(\x0b2".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12+\n\x04meta\x18\x03 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_description"\x86\x01\n(SizeImageConstraintServiceCreateResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b2&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint"\xd6\x02\n\'SizeImageConstraintServiceUpdateRequest\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12O\n\x11image_constraints\x18\x03 \x03(\x0b2".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_description"\x86\x01\n(SizeImageConstraintServiceUpdateResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b2&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint"J\n\'SizeImageConstraintServiceDeleteRequest\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\x86\x01\n(SizeImageConstraintServiceDeleteResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b2&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint"G\n$SizeImageConstraintServiceGetRequest\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\x83\x01\n%SizeImageConstraintServiceGetResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b2&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint"j\n%SizeImageConstraintServiceListRequest\x12A\n\x05query\x18\x01 \x01(\x0b2+.metalstack.api.v2.SizeImageConstraintQueryR\x05query"\x86\x01\n&SizeImageConstraintServiceListResponse\x12\\\n\x16size_image_constraints\x18\x01 \x03(\x0b2&.metalstack.api.v2.SizeImageConstraintR\x14sizeImageConstraints2\xee\x05\n\x1aSizeImageConstraintService\x12\x90\x01\n\x06Create\x12<.metalstack.admin.v2.SizeImageConstraintServiceCreateRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x90\x01\n\x06Update\x12<.metalstack.admin.v2.SizeImageConstraintServiceUpdateRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x90\x01\n\x06Delete\x12<.metalstack.admin.v2.SizeImageConstraintServiceDeleteRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x03Get\x129.metalstack.admin.v2.SizeImageConstraintServiceGetRequest\x1a:.metalstack.admin.v2.SizeImageConstraintServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12\x8b\x01\n\x04List\x12:.metalstack.admin.v2.SizeImageConstraintServiceListRequest\x1a;.metalstack.admin.v2.SizeImageConstraintServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xdc\x01\n\x17com.metalstack.admin.v2B\x18SizeImageconstraintProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + size_imageconstraint_pb.desc(), + ], + { + "SizeImageConstraintServiceCreateRequest": SizeImageConstraintServiceCreateRequest, + "SizeImageConstraintServiceCreateResponse": SizeImageConstraintServiceCreateResponse, + "SizeImageConstraintServiceUpdateRequest": SizeImageConstraintServiceUpdateRequest, + "SizeImageConstraintServiceUpdateResponse": SizeImageConstraintServiceUpdateResponse, + "SizeImageConstraintServiceDeleteRequest": SizeImageConstraintServiceDeleteRequest, + "SizeImageConstraintServiceDeleteResponse": SizeImageConstraintServiceDeleteResponse, + "SizeImageConstraintServiceGetRequest": SizeImageConstraintServiceGetRequest, + "SizeImageConstraintServiceGetResponse": SizeImageConstraintServiceGetResponse, + "SizeImageConstraintServiceListRequest": SizeImageConstraintServiceListRequest, + "SizeImageConstraintServiceListResponse": SizeImageConstraintServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/size_imageconstraint.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/size_imageconstraint_pb2.py b/python/metalstack/admin/v2/size_imageconstraint_pb2.py deleted file mode 100644 index 50305e65..00000000 --- a/python/metalstack/admin/v2/size_imageconstraint_pb2.py +++ /dev/null @@ -1,89 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/size_imageconstraint.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/size_imageconstraint.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import size_imageconstraint_pb2 as metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.metalstack/admin/v2/size_imageconstraint.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a,metalstack/api/v2/size_imageconstraint.proto\"\xbb\x02\n\'SizeImageConstraintServiceCreateRequest\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12O\n\x11image_constraints\x18\x02 \x03(\x0b\x32\".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12+\n\x04meta\x18\x03 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_description\"\x86\x01\n(SizeImageConstraintServiceCreateResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b\x32&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint\"\xd6\x02\n\'SizeImageConstraintServiceUpdateRequest\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12O\n\x11image_constraints\x18\x03 \x03(\x0b\x32\".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_description\"\x86\x01\n(SizeImageConstraintServiceUpdateResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b\x32&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint\"J\n\'SizeImageConstraintServiceDeleteRequest\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\"\x86\x01\n(SizeImageConstraintServiceDeleteResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b\x32&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint\"G\n$SizeImageConstraintServiceGetRequest\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\"\x83\x01\n%SizeImageConstraintServiceGetResponse\x12Z\n\x15size_image_constraint\x18\x01 \x01(\x0b\x32&.metalstack.api.v2.SizeImageConstraintR\x13sizeImageConstraint\"j\n%SizeImageConstraintServiceListRequest\x12\x41\n\x05query\x18\x01 \x01(\x0b\x32+.metalstack.api.v2.SizeImageConstraintQueryR\x05query\"\x86\x01\n&SizeImageConstraintServiceListResponse\x12\\\n\x16size_image_constraints\x18\x01 \x03(\x0b\x32&.metalstack.api.v2.SizeImageConstraintR\x14sizeImageConstraints2\xee\x05\n\x1aSizeImageConstraintService\x12\x90\x01\n\x06\x43reate\x12<.metalstack.admin.v2.SizeImageConstraintServiceCreateRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x90\x01\n\x06Update\x12<.metalstack.admin.v2.SizeImageConstraintServiceUpdateRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x90\x01\n\x06\x44\x65lete\x12<.metalstack.admin.v2.SizeImageConstraintServiceDeleteRequest\x1a=.metalstack.admin.v2.SizeImageConstraintServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x03Get\x12\x39.metalstack.admin.v2.SizeImageConstraintServiceGetRequest\x1a:.metalstack.admin.v2.SizeImageConstraintServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12\x8b\x01\n\x04List\x12:.metalstack.admin.v2.SizeImageConstraintServiceListRequest\x1a;.metalstack.admin.v2.SizeImageConstraintServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xdc\x01\n\x17\x63om.metalstack.admin.v2B\x18SizeImageconstraintProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.size_imageconstraint_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\030SizeImageconstraintProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETEREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETEREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICEGETREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICEGETREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST']._serialized_start=221 - _globals['_SIZEIMAGECONSTRAINTSERVICECREATEREQUEST']._serialized_end=536 - _globals['_SIZEIMAGECONSTRAINTSERVICECREATERESPONSE']._serialized_start=539 - _globals['_SIZEIMAGECONSTRAINTSERVICECREATERESPONSE']._serialized_end=673 - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST']._serialized_start=676 - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATEREQUEST']._serialized_end=1018 - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATERESPONSE']._serialized_start=1021 - _globals['_SIZEIMAGECONSTRAINTSERVICEUPDATERESPONSE']._serialized_end=1155 - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETEREQUEST']._serialized_start=1157 - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETEREQUEST']._serialized_end=1231 - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETERESPONSE']._serialized_start=1234 - _globals['_SIZEIMAGECONSTRAINTSERVICEDELETERESPONSE']._serialized_end=1368 - _globals['_SIZEIMAGECONSTRAINTSERVICEGETREQUEST']._serialized_start=1370 - _globals['_SIZEIMAGECONSTRAINTSERVICEGETREQUEST']._serialized_end=1441 - _globals['_SIZEIMAGECONSTRAINTSERVICEGETRESPONSE']._serialized_start=1444 - _globals['_SIZEIMAGECONSTRAINTSERVICEGETRESPONSE']._serialized_end=1575 - _globals['_SIZEIMAGECONSTRAINTSERVICELISTREQUEST']._serialized_start=1577 - _globals['_SIZEIMAGECONSTRAINTSERVICELISTREQUEST']._serialized_end=1683 - _globals['_SIZEIMAGECONSTRAINTSERVICELISTRESPONSE']._serialized_start=1686 - _globals['_SIZEIMAGECONSTRAINTSERVICELISTRESPONSE']._serialized_end=1820 - _globals['_SIZEIMAGECONSTRAINTSERVICE']._serialized_start=1823 - _globals['_SIZEIMAGECONSTRAINTSERVICE']._serialized_end=2573 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/size_imageconstraint_pb2.pyi b/python/metalstack/admin/v2/size_imageconstraint_pb2.pyi deleted file mode 100644 index 4f92b929..00000000 --- a/python/metalstack/admin/v2/size_imageconstraint_pb2.pyi +++ /dev/null @@ -1,87 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import size_imageconstraint_pb2 as _size_imageconstraint_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeImageConstraintServiceCreateRequest(_message.Message): - __slots__ = ("size", "image_constraints", "meta", "name", "description") - SIZE_FIELD_NUMBER: _ClassVar[int] - IMAGE_CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - size: str - image_constraints: _containers.RepeatedCompositeFieldContainer[_size_imageconstraint_pb2.ImageConstraint] - meta: _common_pb2.Meta - name: str - description: str - def __init__(self, size: _Optional[str] = ..., image_constraints: _Optional[_Iterable[_Union[_size_imageconstraint_pb2.ImageConstraint, _Mapping]]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintServiceCreateResponse(_message.Message): - __slots__ = ("size_image_constraint",) - SIZE_IMAGE_CONSTRAINT_FIELD_NUMBER: _ClassVar[int] - size_image_constraint: _size_imageconstraint_pb2.SizeImageConstraint - def __init__(self, size_image_constraint: _Optional[_Union[_size_imageconstraint_pb2.SizeImageConstraint, _Mapping]] = ...) -> None: ... - -class SizeImageConstraintServiceUpdateRequest(_message.Message): - __slots__ = ("size", "update_meta", "image_constraints", "name", "description") - SIZE_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - IMAGE_CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - size: str - update_meta: _common_pb2.UpdateMeta - image_constraints: _containers.RepeatedCompositeFieldContainer[_size_imageconstraint_pb2.ImageConstraint] - name: str - description: str - def __init__(self, size: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., image_constraints: _Optional[_Iterable[_Union[_size_imageconstraint_pb2.ImageConstraint, _Mapping]]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintServiceUpdateResponse(_message.Message): - __slots__ = ("size_image_constraint",) - SIZE_IMAGE_CONSTRAINT_FIELD_NUMBER: _ClassVar[int] - size_image_constraint: _size_imageconstraint_pb2.SizeImageConstraint - def __init__(self, size_image_constraint: _Optional[_Union[_size_imageconstraint_pb2.SizeImageConstraint, _Mapping]] = ...) -> None: ... - -class SizeImageConstraintServiceDeleteRequest(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: str - def __init__(self, size: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintServiceDeleteResponse(_message.Message): - __slots__ = ("size_image_constraint",) - SIZE_IMAGE_CONSTRAINT_FIELD_NUMBER: _ClassVar[int] - size_image_constraint: _size_imageconstraint_pb2.SizeImageConstraint - def __init__(self, size_image_constraint: _Optional[_Union[_size_imageconstraint_pb2.SizeImageConstraint, _Mapping]] = ...) -> None: ... - -class SizeImageConstraintServiceGetRequest(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: str - def __init__(self, size: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintServiceGetResponse(_message.Message): - __slots__ = ("size_image_constraint",) - SIZE_IMAGE_CONSTRAINT_FIELD_NUMBER: _ClassVar[int] - size_image_constraint: _size_imageconstraint_pb2.SizeImageConstraint - def __init__(self, size_image_constraint: _Optional[_Union[_size_imageconstraint_pb2.SizeImageConstraint, _Mapping]] = ...) -> None: ... - -class SizeImageConstraintServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _size_imageconstraint_pb2.SizeImageConstraintQuery - def __init__(self, query: _Optional[_Union[_size_imageconstraint_pb2.SizeImageConstraintQuery, _Mapping]] = ...) -> None: ... - -class SizeImageConstraintServiceListResponse(_message.Message): - __slots__ = ("size_image_constraints",) - SIZE_IMAGE_CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - size_image_constraints: _containers.RepeatedCompositeFieldContainer[_size_imageconstraint_pb2.SizeImageConstraint] - def __init__(self, size_image_constraints: _Optional[_Iterable[_Union[_size_imageconstraint_pb2.SizeImageConstraint, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/size_pb.py b/python/metalstack/admin/v2/size_pb.py new file mode 100644 index 00000000..c866df53 --- /dev/null +++ b/python/metalstack/admin/v2/size_pb.py @@ -0,0 +1,278 @@ +# Generated from metalstack/admin/v2/size.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, size_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import UpdateLabels, UpdateMeta + from ...api.v2.size_pb import Size, SizeConstraint + + +_SizeServiceCreateRequestFields: TypeAlias = Literal["size"] + +class SizeServiceCreateRequest(Message[_SizeServiceCreateRequestFields]): + """ + SizeServiceCreateRequest is the request payload for creating a size. + + ```proto + message metalstack.admin.v2.SizeServiceCreateRequest + ``` + + Attributes: + size: + Size is the size to create + + ```proto + optional metalstack.api.v2.Size size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: Size | None = None, + ) -> None: + pass + + size: Size | None + +_SizeServiceCreateResponseFields: TypeAlias = Literal["size"] + +class SizeServiceCreateResponse(Message[_SizeServiceCreateResponseFields]): + """ + SizeServiceCreateResponse is the response payload for creating a size. + + ```proto + message metalstack.admin.v2.SizeServiceCreateResponse + ``` + + Attributes: + size: + Size contains the created size + + ```proto + optional metalstack.api.v2.Size size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: Size | None = None, + ) -> None: + pass + + size: Size | None + +_SizeServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "name", "description", "constraints", "labels"] + +class SizeServiceUpdateRequest(Message[_SizeServiceUpdateRequestFields]): + """ + SizeServiceUpdateRequest is the request payload for updating a size. + + ```proto + message metalstack.admin.v2.SizeServiceUpdateRequest + ``` + + Attributes: + id: + Id of this size + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + name: + Name of this size + + ```proto + optional string name = 3; + ``` + description: + Description of this size + + ```proto + optional string description = 4; + ``` + constraints: + Constraints which must match that a specific machine is considered of this size + + ```proto + repeated metalstack.api.v2.SizeConstraint constraints = 5; + ``` + labels: + Labels to update on this size + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 6; + ``` + """ + + __slots__ = ("id", "update_meta", "name", "description", "constraints", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + name: str | None = None, + description: str | None = None, + constraints: list[SizeConstraint] | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + name: str + description: str + constraints: list[SizeConstraint] + labels: UpdateLabels | None + +_SizeServiceUpdateResponseFields: TypeAlias = Literal["size"] + +class SizeServiceUpdateResponse(Message[_SizeServiceUpdateResponseFields]): + """ + SizeServiceUpdateResponse is the response payload for updating a size. + + ```proto + message metalstack.admin.v2.SizeServiceUpdateResponse + ``` + + Attributes: + size: + Size contains the updated size + + ```proto + optional metalstack.api.v2.Size size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: Size | None = None, + ) -> None: + pass + + size: Size | None + +_SizeServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class SizeServiceDeleteRequest(Message[_SizeServiceDeleteRequestFields]): + """ + SizeServiceDeleteRequest is the request payload for deleting a size. + + ```proto + message metalstack.admin.v2.SizeServiceDeleteRequest + ``` + + Attributes: + id: + ID of the size to delete + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_SizeServiceDeleteResponseFields: TypeAlias = Literal["size"] + +class SizeServiceDeleteResponse(Message[_SizeServiceDeleteResponseFields]): + """ + SizeServiceDeleteResponse is the response payload for deleting a size. + + ```proto + message metalstack.admin.v2.SizeServiceDeleteResponse + ``` + + Attributes: + size: + Size contains the deleted size + + ```proto + optional metalstack.api.v2.Size size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: Size | None = None, + ) -> None: + pass + + size: Size | None + + +_DESC = file_desc( + b'\n\x1emetalstack/admin/v2/size.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1cmetalstack/api/v2/size.proto"G\n\x18SizeServiceCreateRequest\x12+\n\x04size\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size"H\n\x19SizeServiceCreateResponse\x12+\n\x04size\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size"\x80\x03\n\x18SizeServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12C\n\x0bconstraints\x18\x05 \x03(\x0b2!.metalstack.api.v2.SizeConstraintR\x0bconstraints\x12<\n\x06labels\x18\x06 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels"H\n\x19SizeServiceUpdateResponse\x12+\n\x04size\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size"7\n\x18SizeServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"H\n\x19SizeServiceDeleteResponse\x12+\n\x04size\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size2\xe9\x02\n\x0bSizeService\x12r\n\x06Create\x12-.metalstack.admin.v2.SizeServiceCreateRequest\x1a..metalstack.admin.v2.SizeServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06Update\x12-.metalstack.admin.v2.SizeServiceUpdateRequest\x1a..metalstack.admin.v2.SizeServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06Delete\x12-.metalstack.admin.v2.SizeServiceDeleteRequest\x1a..metalstack.admin.v2.SizeServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01B\xcd\x01\n\x17com.metalstack.admin.v2B\tSizeProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + size_pb.desc(), + ], + { + "SizeServiceCreateRequest": SizeServiceCreateRequest, + "SizeServiceCreateResponse": SizeServiceCreateResponse, + "SizeServiceUpdateRequest": SizeServiceUpdateRequest, + "SizeServiceUpdateResponse": SizeServiceUpdateResponse, + "SizeServiceDeleteRequest": SizeServiceDeleteRequest, + "SizeServiceDeleteResponse": SizeServiceDeleteResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/size.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/size_pb2.py b/python/metalstack/admin/v2/size_pb2.py deleted file mode 100644 index eb35bb9c..00000000 --- a/python/metalstack/admin/v2/size_pb2.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/size.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/size.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import size_pb2 as metalstack_dot_api_dot_v2_dot_size__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/admin/v2/size.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1cmetalstack/api/v2/size.proto\"G\n\x18SizeServiceCreateRequest\x12+\n\x04size\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size\"H\n\x19SizeServiceCreateResponse\x12+\n\x04size\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size\"\x80\x03\n\x18SizeServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x43\n\x0b\x63onstraints\x18\x05 \x03(\x0b\x32!.metalstack.api.v2.SizeConstraintR\x0b\x63onstraints\x12<\n\x06labels\x18\x06 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels\"H\n\x19SizeServiceUpdateResponse\x12+\n\x04size\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size\"7\n\x18SizeServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"H\n\x19SizeServiceDeleteResponse\x12+\n\x04size\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size2\xe9\x02\n\x0bSizeService\x12r\n\x06\x43reate\x12-.metalstack.admin.v2.SizeServiceCreateRequest\x1a..metalstack.admin.v2.SizeServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06Update\x12-.metalstack.admin.v2.SizeServiceUpdateRequest\x1a..metalstack.admin.v2.SizeServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06\x44\x65lete\x12-.metalstack.admin.v2.SizeServiceDeleteRequest\x1a..metalstack.admin.v2.SizeServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x42\xcd\x01\n\x17\x63om.metalstack.admin.v2B\tSizeProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.size_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\tSizeProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_SIZESERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZESERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZESERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZESERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_SIZESERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZESERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_SIZESERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZESERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_SIZESERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZESERVICECREATEREQUEST']._serialized_start=188 - _globals['_SIZESERVICECREATEREQUEST']._serialized_end=259 - _globals['_SIZESERVICECREATERESPONSE']._serialized_start=261 - _globals['_SIZESERVICECREATERESPONSE']._serialized_end=333 - _globals['_SIZESERVICEUPDATEREQUEST']._serialized_start=336 - _globals['_SIZESERVICEUPDATEREQUEST']._serialized_end=720 - _globals['_SIZESERVICEUPDATERESPONSE']._serialized_start=722 - _globals['_SIZESERVICEUPDATERESPONSE']._serialized_end=794 - _globals['_SIZESERVICEDELETEREQUEST']._serialized_start=796 - _globals['_SIZESERVICEDELETEREQUEST']._serialized_end=851 - _globals['_SIZESERVICEDELETERESPONSE']._serialized_start=853 - _globals['_SIZESERVICEDELETERESPONSE']._serialized_end=925 - _globals['_SIZESERVICE']._serialized_start=928 - _globals['_SIZESERVICE']._serialized_end=1289 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/size_pb2.pyi b/python/metalstack/admin/v2/size_pb2.pyi deleted file mode 100644 index 28e9a10b..00000000 --- a/python/metalstack/admin/v2/size_pb2.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import size_pb2 as _size_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeServiceCreateRequest(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: _size_pb2.Size - def __init__(self, size: _Optional[_Union[_size_pb2.Size, _Mapping]] = ...) -> None: ... - -class SizeServiceCreateResponse(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: _size_pb2.Size - def __init__(self, size: _Optional[_Union[_size_pb2.Size, _Mapping]] = ...) -> None: ... - -class SizeServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "name", "description", "constraints", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - name: str - description: str - constraints: _containers.RepeatedCompositeFieldContainer[_size_pb2.SizeConstraint] - labels: _common_pb2.UpdateLabels - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., constraints: _Optional[_Iterable[_Union[_size_pb2.SizeConstraint, _Mapping]]] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class SizeServiceUpdateResponse(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: _size_pb2.Size - def __init__(self, size: _Optional[_Union[_size_pb2.Size, _Mapping]] = ...) -> None: ... - -class SizeServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class SizeServiceDeleteResponse(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: _size_pb2.Size - def __init__(self, size: _Optional[_Union[_size_pb2.Size, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/size_reservation_connect.py b/python/metalstack/admin/v2/size_reservation_connect.py index a2dbf4be..19d908ce 100644 --- a/python/metalstack/admin/v2/size_reservation_connect.py +++ b/python/metalstack/admin/v2/size_reservation_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/size_reservation.proto +# Generated from metalstack/admin/v2/size_reservation.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.size_reservation_pb2 as metalstack_dot_admin_dot_v2_dot_size__reservation__pb2 + +from .size_reservation_pb import SizeReservationServiceCreateRequest, SizeReservationServiceCreateResponse, SizeReservationServiceDeleteRequest, SizeReservationServiceDeleteResponse, SizeReservationServiceListRequest, SizeReservationServiceListResponse, SizeReservationServiceUpdateRequest, SizeReservationServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeReservationService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: SizeReservationServiceCreateRequest, ctx: RequestContext[SizeReservationServiceCreateRequest, SizeReservationServiceCreateResponse]) -> SizeReservationServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: SizeReservationServiceUpdateRequest, ctx: RequestContext[SizeReservationServiceUpdateRequest, SizeReservationServiceUpdateResponse]) -> SizeReservationServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: SizeReservationServiceDeleteRequest, ctx: RequestContext[SizeReservationServiceDeleteRequest, SizeReservationServiceDeleteResponse]) -> SizeReservationServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: SizeReservationServiceListRequest, ctx: RequestContext[SizeReservationServiceListRequest, SizeReservationServiceListResponse]) -> SizeReservationServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeReservationServiceASGIApplication(ConnectASGIApplication[SizeReservationService]): - def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeReservationService | AsyncGenerator[SizeReservationService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse, + input=SizeReservationServiceCreateRequest, + output=SizeReservationServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -50,8 +66,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse, + input=SizeReservationServiceUpdateRequest, + output=SizeReservationServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -60,8 +76,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse, + input=SizeReservationServiceDeleteRequest, + output=SizeReservationServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -70,8 +86,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -92,18 +108,18 @@ def path(self) -> str: class SizeReservationServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, + request: SizeReservationServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse: + ) -> SizeReservationServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse, + input=SizeReservationServiceCreateRequest, + output=SizeReservationServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def create( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, + request: SizeReservationServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse: + ) -> SizeReservationServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse, + input=SizeReservationServiceUpdateRequest, + output=SizeReservationServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, + request: SizeReservationServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse: + ) -> SizeReservationServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse, + input=SizeReservationServiceDeleteRequest, + output=SizeReservationServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def delete( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, + request: SizeReservationServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: + ) -> SizeReservationServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class SizeReservationServiceSync(Protocol): + def create(self, request: SizeReservationServiceCreateRequest, ctx: RequestContext[SizeReservationServiceCreateRequest, SizeReservationServiceCreateResponse]) -> SizeReservationServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: SizeReservationServiceUpdateRequest, ctx: RequestContext[SizeReservationServiceUpdateRequest, SizeReservationServiceUpdateResponse]) -> SizeReservationServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: SizeReservationServiceDeleteRequest, ctx: RequestContext[SizeReservationServiceDeleteRequest, SizeReservationServiceDeleteResponse]) -> SizeReservationServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class SizeReservationServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: SizeReservationServiceListRequest, ctx: RequestContext[SizeReservationServiceListRequest, SizeReservationServiceListResponse]) -> SizeReservationServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeReservationServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeReservationServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.SizeReservationService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse, + input=SizeReservationServiceCreateRequest, + output=SizeReservationServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -203,8 +225,8 @@ def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[I method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse, + input=SizeReservationServiceUpdateRequest, + output=SizeReservationServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -213,8 +235,8 @@ def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[I method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse, + input=SizeReservationServiceDeleteRequest, + output=SizeReservationServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -223,8 +245,8 @@ def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[I method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -245,82 +267,77 @@ def path(self) -> str: class SizeReservationServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, + request: SizeReservationServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse: + ) -> SizeReservationServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceCreateResponse, + input=SizeReservationServiceCreateRequest, + output=SizeReservationServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, + request: SizeReservationServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse: + ) -> SizeReservationServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceUpdateResponse, + input=SizeReservationServiceUpdateRequest, + output=SizeReservationServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, + request: SizeReservationServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse: + ) -> SizeReservationServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceDeleteResponse, + input=SizeReservationServiceDeleteRequest, + output=SizeReservationServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, + request: SizeReservationServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: + ) -> SizeReservationServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SizeReservationService", - input=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/size_reservation_pb.py b/python/metalstack/admin/v2/size_reservation_pb.py new file mode 100644 index 00000000..60536025 --- /dev/null +++ b/python/metalstack/admin/v2/size_reservation_pb.py @@ -0,0 +1,352 @@ +# Generated from metalstack/admin/v2/size_reservation.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, size_reservation_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import UpdateLabels, UpdateMeta + from ...api.v2.size_reservation_pb import SizeReservation, SizeReservationQuery + + +_SizeReservationServiceCreateRequestFields: TypeAlias = Literal["size_reservation"] + +class SizeReservationServiceCreateRequest(Message[_SizeReservationServiceCreateRequestFields]): + """ + SizeReservationServiceCreateRequest is the request payload for creating a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceCreateRequest + ``` + + Attributes: + size_reservation: + SizeReservation is the size reservation to create + + ```proto + optional metalstack.api.v2.SizeReservation size_reservation = 1; + ``` + """ + + __slots__ = ("size_reservation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservation: SizeReservation | None = None, + ) -> None: + pass + + size_reservation: SizeReservation | None + +_SizeReservationServiceCreateResponseFields: TypeAlias = Literal["size_reservation"] + +class SizeReservationServiceCreateResponse(Message[_SizeReservationServiceCreateResponseFields]): + """ + SizeReservationServiceCreateResponse is the response payload for creating a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceCreateResponse + ``` + + Attributes: + size_reservation: + SizeReservation contains the created reservation + + ```proto + optional metalstack.api.v2.SizeReservation size_reservation = 1; + ``` + """ + + __slots__ = ("size_reservation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservation: SizeReservation | None = None, + ) -> None: + pass + + size_reservation: SizeReservation | None + +_SizeReservationServiceUpdateRequestFields: TypeAlias = Literal["id", "name", "description", "update_meta", "partitions", "amount", "labels"] + +class SizeReservationServiceUpdateRequest(Message[_SizeReservationServiceUpdateRequestFields]): + """ + SizeReservationServiceUpdateRequest is the request payload for updating a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceUpdateRequest + ``` + + Attributes: + id: + Id of this size reservation + + ```proto + string id = 1; + ``` + name: + Name of this size reservation + + ```proto + optional string name = 2; + ``` + description: + Description of this size reservation + + ```proto + optional string description = 3; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 4; + ``` + partitions: + Partition ids of this size reservation + + ```proto + repeated string partitions = 5; + ``` + amount: + Amount of reservations of this size reservation + + ```proto + optional int32 amount = 6; + ``` + labels: + Labels to update of this size reservation + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 7; + ``` + """ + + __slots__ = ("id", "name", "description", "update_meta", "partitions", "amount", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + name: str | None = None, + description: str | None = None, + update_meta: UpdateMeta | None = None, + partitions: list[str] | None = None, + amount: int | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + id: str + name: str + description: str + update_meta: UpdateMeta | None + partitions: list[str] + amount: int + labels: UpdateLabels | None + +_SizeReservationServiceUpdateResponseFields: TypeAlias = Literal["size_reservation"] + +class SizeReservationServiceUpdateResponse(Message[_SizeReservationServiceUpdateResponseFields]): + """ + SizeReservationServiceUpdateResponse is the response payload for updating a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceUpdateResponse + ``` + + Attributes: + size_reservation: + SizeReservation contains the updated reservation + + ```proto + optional metalstack.api.v2.SizeReservation size_reservation = 1; + ``` + """ + + __slots__ = ("size_reservation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservation: SizeReservation | None = None, + ) -> None: + pass + + size_reservation: SizeReservation | None + +_SizeReservationServiceDeleteRequestFields: TypeAlias = Literal["id"] + +class SizeReservationServiceDeleteRequest(Message[_SizeReservationServiceDeleteRequestFields]): + """ + SizeReservationServiceDeleteRequest is the request payload for deleting a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceDeleteRequest + ``` + + Attributes: + id: + ID of the size reservation to delete + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_SizeReservationServiceDeleteResponseFields: TypeAlias = Literal["size_reservation"] + +class SizeReservationServiceDeleteResponse(Message[_SizeReservationServiceDeleteResponseFields]): + """ + SizeReservationServiceDeleteResponse is the response payload for deleting a size reservation. + + ```proto + message metalstack.admin.v2.SizeReservationServiceDeleteResponse + ``` + + Attributes: + size_reservation: + SizeReservation contains the deleted reservation + + ```proto + optional metalstack.api.v2.SizeReservation size_reservation = 1; + ``` + """ + + __slots__ = ("size_reservation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservation: SizeReservation | None = None, + ) -> None: + pass + + size_reservation: SizeReservation | None + +_SizeReservationServiceListRequestFields: TypeAlias = Literal["query"] + +class SizeReservationServiceListRequest(Message[_SizeReservationServiceListRequestFields]): + """ + SizeReservationServiceListRequest is the request payload for listing size reservations. + + ```proto + message metalstack.admin.v2.SizeReservationServiceListRequest + ``` + + Attributes: + query: + Query for size reservations + + ```proto + optional metalstack.api.v2.SizeReservationQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: SizeReservationQuery | None = None, + ) -> None: + pass + + query: SizeReservationQuery | None + +_SizeReservationServiceListResponseFields: TypeAlias = Literal["size_reservations"] + +class SizeReservationServiceListResponse(Message[_SizeReservationServiceListResponseFields]): + """ + SizeReservationServiceListResponse is the response payload for listing size reservations. + + ```proto + message metalstack.admin.v2.SizeReservationServiceListResponse + ``` + + Attributes: + size_reservations: + SizeReservations contains the list of reservations + + ```proto + repeated metalstack.api.v2.SizeReservation size_reservations = 1; + ``` + """ + + __slots__ = ("size_reservations",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservations: list[SizeReservation] | None = None, + ) -> None: + pass + + size_reservations: list[SizeReservation] + + +_DESC = file_desc( + b'\n*metalstack/admin/v2/size_reservation.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a(metalstack/api/v2/size_reservation.proto"t\n#SizeReservationServiceCreateRequest\x12M\n\x10size_reservation\x18\x01 \x01(\x0b2".metalstack.api.v2.SizeReservationR\x0fsizeReservation"u\n$SizeReservationServiceCreateResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b2".metalstack.api.v2.SizeReservationR\x0fsizeReservation"\xaa\x03\n#SizeReservationServiceUpdateRequest\x12\x18\n\x02id\x18\x01 \x01(\tR\x02idB\x08\xbaH\x05r\x03\xb0\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12F\n\x0bupdate_meta\x18\x04 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x124\n\npartitions\x18\x05 \x03(\tR\npartitionsB\x14\xbaH\x11\x92\x01\x0e\x08\x01\x18\x01"\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12$\n\x06amount\x18\x06 \x01(\x05H\x02R\x06amountB\x07\xbaH\x04\x1a\x02 \x00\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_amountB\t\n\x07_labels"u\n$SizeReservationServiceUpdateResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b2".metalstack.api.v2.SizeReservationR\x0fsizeReservation"?\n#SizeReservationServiceDeleteRequest\x12\x18\n\x02id\x18\x01 \x01(\tR\x02idB\x08\xbaH\x05r\x03\xb0\x01\x01"u\n$SizeReservationServiceDeleteResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b2".metalstack.api.v2.SizeReservationR\x0fsizeReservation"b\n!SizeReservationServiceListRequest\x12=\n\x05query\x18\x01 \x01(\x0b2\'.metalstack.api.v2.SizeReservationQueryR\x05query"u\n"SizeReservationServiceListResponse\x12O\n\x11size_reservations\x18\x01 \x03(\x0b2".metalstack.api.v2.SizeReservationR\x10sizeReservations2\xbf\x04\n\x16SizeReservationService\x12\x88\x01\n\x06Create\x128.metalstack.admin.v2.SizeReservationServiceCreateRequest\x1a9.metalstack.admin.v2.SizeReservationServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x06Update\x128.metalstack.admin.v2.SizeReservationServiceUpdateRequest\x1a9.metalstack.admin.v2.SizeReservationServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x06Delete\x128.metalstack.admin.v2.SizeReservationServiceDeleteRequest\x1a9.metalstack.admin.v2.SizeReservationServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x04List\x126.metalstack.admin.v2.SizeReservationServiceListRequest\x1a7.metalstack.admin.v2.SizeReservationServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xd8\x01\n\x17com.metalstack.admin.v2B\x14SizeReservationProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + size_reservation_pb.desc(), + ], + { + "SizeReservationServiceCreateRequest": SizeReservationServiceCreateRequest, + "SizeReservationServiceCreateResponse": SizeReservationServiceCreateResponse, + "SizeReservationServiceUpdateRequest": SizeReservationServiceUpdateRequest, + "SizeReservationServiceUpdateResponse": SizeReservationServiceUpdateResponse, + "SizeReservationServiceDeleteRequest": SizeReservationServiceDeleteRequest, + "SizeReservationServiceDeleteResponse": SizeReservationServiceDeleteResponse, + "SizeReservationServiceListRequest": SizeReservationServiceListRequest, + "SizeReservationServiceListResponse": SizeReservationServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/size_reservation.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/size_reservation_pb2.py b/python/metalstack/admin/v2/size_reservation_pb2.py deleted file mode 100644 index af4e9afb..00000000 --- a/python/metalstack/admin/v2/size_reservation_pb2.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/size_reservation.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/size_reservation.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import size_reservation_pb2 as metalstack_dot_api_dot_v2_dot_size__reservation__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n*metalstack/admin/v2/size_reservation.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a(metalstack/api/v2/size_reservation.proto\"t\n#SizeReservationServiceCreateRequest\x12M\n\x10size_reservation\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.SizeReservationR\x0fsizeReservation\"u\n$SizeReservationServiceCreateResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.SizeReservationR\x0fsizeReservation\"\xaa\x03\n#SizeReservationServiceUpdateRequest\x12\x18\n\x02id\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x02id\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x46\n\x0bupdate_meta\x18\x04 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\x34\n\npartitions\x18\x05 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x08\x01\x18\x01\"\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\npartitions\x12$\n\x06\x61mount\x18\x06 \x01(\x05\x42\x07\xbaH\x04\x1a\x02 \x00H\x02R\x06\x61mount\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_amountB\t\n\x07_labels\"u\n$SizeReservationServiceUpdateResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.SizeReservationR\x0fsizeReservation\"?\n#SizeReservationServiceDeleteRequest\x12\x18\n\x02id\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x02id\"u\n$SizeReservationServiceDeleteResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.SizeReservationR\x0fsizeReservation\"b\n!SizeReservationServiceListRequest\x12=\n\x05query\x18\x01 \x01(\x0b\x32\'.metalstack.api.v2.SizeReservationQueryR\x05query\"u\n\"SizeReservationServiceListResponse\x12O\n\x11size_reservations\x18\x01 \x03(\x0b\x32\".metalstack.api.v2.SizeReservationR\x10sizeReservations2\xbf\x04\n\x16SizeReservationService\x12\x88\x01\n\x06\x43reate\x12\x38.metalstack.admin.v2.SizeReservationServiceCreateRequest\x1a\x39.metalstack.admin.v2.SizeReservationServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x06Update\x12\x38.metalstack.admin.v2.SizeReservationServiceUpdateRequest\x1a\x39.metalstack.admin.v2.SizeReservationServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x06\x44\x65lete\x12\x38.metalstack.admin.v2.SizeReservationServiceDeleteRequest\x1a\x39.metalstack.admin.v2.SizeReservationServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x04List\x12\x36.metalstack.admin.v2.SizeReservationServiceListRequest\x1a\x37.metalstack.admin.v2.SizeReservationServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xd8\x01\n\x17\x63om.metalstack.admin.v2B\x14SizeReservationProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.size_reservation_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\024SizeReservationProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['partitions']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['partitions']._serialized_options = b'\272H\021\222\001\016\010\001\030\001\"\010r\006\320\263\256\261\002\001' - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['amount']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST'].fields_by_name['amount']._serialized_options = b'\272H\004\032\002 \000' - _globals['_SIZERESERVATIONSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SIZERESERVATIONSERVICECREATEREQUEST']._serialized_start=212 - _globals['_SIZERESERVATIONSERVICECREATEREQUEST']._serialized_end=328 - _globals['_SIZERESERVATIONSERVICECREATERESPONSE']._serialized_start=330 - _globals['_SIZERESERVATIONSERVICECREATERESPONSE']._serialized_end=447 - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST']._serialized_start=450 - _globals['_SIZERESERVATIONSERVICEUPDATEREQUEST']._serialized_end=876 - _globals['_SIZERESERVATIONSERVICEUPDATERESPONSE']._serialized_start=878 - _globals['_SIZERESERVATIONSERVICEUPDATERESPONSE']._serialized_end=995 - _globals['_SIZERESERVATIONSERVICEDELETEREQUEST']._serialized_start=997 - _globals['_SIZERESERVATIONSERVICEDELETEREQUEST']._serialized_end=1060 - _globals['_SIZERESERVATIONSERVICEDELETERESPONSE']._serialized_start=1062 - _globals['_SIZERESERVATIONSERVICEDELETERESPONSE']._serialized_end=1179 - _globals['_SIZERESERVATIONSERVICELISTREQUEST']._serialized_start=1181 - _globals['_SIZERESERVATIONSERVICELISTREQUEST']._serialized_end=1279 - _globals['_SIZERESERVATIONSERVICELISTRESPONSE']._serialized_start=1281 - _globals['_SIZERESERVATIONSERVICELISTRESPONSE']._serialized_end=1398 - _globals['_SIZERESERVATIONSERVICE']._serialized_start=1401 - _globals['_SIZERESERVATIONSERVICE']._serialized_end=1976 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/size_reservation_pb2.pyi b/python/metalstack/admin/v2/size_reservation_pb2.pyi deleted file mode 100644 index 0bc8ad94..00000000 --- a/python/metalstack/admin/v2/size_reservation_pb2.pyi +++ /dev/null @@ -1,71 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import size_reservation_pb2 as _size_reservation_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeReservationServiceCreateRequest(_message.Message): - __slots__ = ("size_reservation",) - SIZE_RESERVATION_FIELD_NUMBER: _ClassVar[int] - size_reservation: _size_reservation_pb2.SizeReservation - def __init__(self, size_reservation: _Optional[_Union[_size_reservation_pb2.SizeReservation, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceCreateResponse(_message.Message): - __slots__ = ("size_reservation",) - SIZE_RESERVATION_FIELD_NUMBER: _ClassVar[int] - size_reservation: _size_reservation_pb2.SizeReservation - def __init__(self, size_reservation: _Optional[_Union[_size_reservation_pb2.SizeReservation, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceUpdateRequest(_message.Message): - __slots__ = ("id", "name", "description", "update_meta", "partitions", "amount", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - name: str - description: str - update_meta: _common_pb2.UpdateMeta - partitions: _containers.RepeatedScalarFieldContainer[str] - amount: int - labels: _common_pb2.UpdateLabels - def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., partitions: _Optional[_Iterable[str]] = ..., amount: _Optional[int] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceUpdateResponse(_message.Message): - __slots__ = ("size_reservation",) - SIZE_RESERVATION_FIELD_NUMBER: _ClassVar[int] - size_reservation: _size_reservation_pb2.SizeReservation - def __init__(self, size_reservation: _Optional[_Union[_size_reservation_pb2.SizeReservation, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceDeleteRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class SizeReservationServiceDeleteResponse(_message.Message): - __slots__ = ("size_reservation",) - SIZE_RESERVATION_FIELD_NUMBER: _ClassVar[int] - size_reservation: _size_reservation_pb2.SizeReservation - def __init__(self, size_reservation: _Optional[_Union[_size_reservation_pb2.SizeReservation, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _size_reservation_pb2.SizeReservationQuery - def __init__(self, query: _Optional[_Union[_size_reservation_pb2.SizeReservationQuery, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceListResponse(_message.Message): - __slots__ = ("size_reservations",) - SIZE_RESERVATIONS_FIELD_NUMBER: _ClassVar[int] - size_reservations: _containers.RepeatedCompositeFieldContainer[_size_reservation_pb2.SizeReservation] - def __init__(self, size_reservations: _Optional[_Iterable[_Union[_size_reservation_pb2.SizeReservation, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/switch_connect.py b/python/metalstack/admin/v2/switch_connect.py index e67303ca..40b15ffc 100644 --- a/python/metalstack/admin/v2/switch_connect.py +++ b/python/metalstack/admin/v2/switch_connect.py @@ -1,47 +1,63 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/switch.proto +# Generated from metalstack/admin/v2/switch.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.switch_pb2 as metalstack_dot_admin_dot_v2_dot_switch__pb2 + +from .switch_pb import SwitchServiceConnectedMachinesRequest, SwitchServiceConnectedMachinesResponse, SwitchServiceDeleteRequest, SwitchServiceDeleteResponse, SwitchServiceGetRequest, SwitchServiceGetResponse, SwitchServiceListRequest, SwitchServiceListResponse, SwitchServiceMigrateRequest, SwitchServiceMigrateResponse, SwitchServicePortRequest, SwitchServicePortResponse, SwitchServiceUpdateRequest, SwitchServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SwitchService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: SwitchServiceGetRequest, ctx: RequestContext[SwitchServiceGetRequest, SwitchServiceGetResponse]) -> SwitchServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: SwitchServiceListRequest, ctx: RequestContext[SwitchServiceListRequest, SwitchServiceListResponse]) -> SwitchServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: SwitchServiceUpdateRequest, ctx: RequestContext[SwitchServiceUpdateRequest, SwitchServiceUpdateResponse]) -> SwitchServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: SwitchServiceDeleteRequest, ctx: RequestContext[SwitchServiceDeleteRequest, SwitchServiceDeleteResponse]) -> SwitchServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def migrate(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def migrate(self, request: SwitchServiceMigrateRequest, ctx: RequestContext[SwitchServiceMigrateRequest, SwitchServiceMigrateResponse]) -> SwitchServiceMigrateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def port(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def port(self, request: SwitchServicePortRequest, ctx: RequestContext[SwitchServicePortRequest, SwitchServicePortResponse]) -> SwitchServicePortResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def connected_machines(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def connected_machines(self, request: SwitchServiceConnectedMachinesRequest, ctx: RequestContext[SwitchServiceConnectedMachinesRequest, SwitchServiceConnectedMachinesResponse]) -> SwitchServiceConnectedMachinesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SwitchServiceASGIApplication(ConnectASGIApplication[SwitchService]): - def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SwitchService | AsyncGenerator[SwitchService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -49,8 +65,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -59,8 +75,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="List", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse, + input=SwitchServiceListRequest, + output=SwitchServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -69,8 +85,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse, + input=SwitchServiceUpdateRequest, + output=SwitchServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -79,8 +95,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse, + input=SwitchServiceDeleteRequest, + output=SwitchServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -89,8 +105,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Migrate", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse, + input=SwitchServiceMigrateRequest, + output=SwitchServiceMigrateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.migrate, @@ -99,8 +115,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Port", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse, + input=SwitchServicePortRequest, + output=SwitchServicePortResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.port, @@ -109,8 +125,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="ConnectedMachines", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse, + input=SwitchServiceConnectedMachinesRequest, + output=SwitchServiceConnectedMachinesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.connected_machines, @@ -131,18 +147,18 @@ def path(self) -> str: class SwitchServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, + request: SwitchServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: + ) -> SwitchServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -151,18 +167,18 @@ async def get( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, + request: SwitchServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse: + ) -> SwitchServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse, + input=SwitchServiceListRequest, + output=SwitchServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -171,18 +187,18 @@ async def list( async def update( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, + request: SwitchServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse: + ) -> SwitchServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse, + input=SwitchServiceUpdateRequest, + output=SwitchServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -191,18 +207,18 @@ async def update( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, + request: SwitchServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse: + ) -> SwitchServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse, + input=SwitchServiceDeleteRequest, + output=SwitchServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -211,18 +227,18 @@ async def delete( async def migrate( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, + request: SwitchServiceMigrateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse: + ) -> SwitchServiceMigrateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Migrate", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse, + input=SwitchServiceMigrateRequest, + output=SwitchServiceMigrateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -231,18 +247,18 @@ async def migrate( async def port( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, + request: SwitchServicePortRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse: + ) -> SwitchServicePortResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Port", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse, + input=SwitchServicePortRequest, + output=SwitchServicePortResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -251,55 +267,64 @@ async def port( async def connected_machines( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, + request: SwitchServiceConnectedMachinesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse: + ) -> SwitchServiceConnectedMachinesResponse: return await self.execute_unary( request=request, method=MethodInfo( name="ConnectedMachines", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse, + input=SwitchServiceConnectedMachinesRequest, + output=SwitchServiceConnectedMachinesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class SwitchServiceSync(Protocol): + def get(self, request: SwitchServiceGetRequest, ctx: RequestContext[SwitchServiceGetRequest, SwitchServiceGetResponse]) -> SwitchServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: SwitchServiceListRequest, ctx: RequestContext[SwitchServiceListRequest, SwitchServiceListResponse]) -> SwitchServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: SwitchServiceUpdateRequest, ctx: RequestContext[SwitchServiceUpdateRequest, SwitchServiceUpdateResponse]) -> SwitchServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: SwitchServiceDeleteRequest, ctx: RequestContext[SwitchServiceDeleteRequest, SwitchServiceDeleteResponse]) -> SwitchServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class SwitchServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def migrate(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def port(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def connected_machines(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def migrate(self, request: SwitchServiceMigrateRequest, ctx: RequestContext[SwitchServiceMigrateRequest, SwitchServiceMigrateResponse]) -> SwitchServiceMigrateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def port(self, request: SwitchServicePortRequest, ctx: RequestContext[SwitchServicePortRequest, SwitchServicePortResponse]) -> SwitchServicePortResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def connected_machines(self, request: SwitchServiceConnectedMachinesRequest, ctx: RequestContext[SwitchServiceConnectedMachinesRequest, SwitchServiceConnectedMachinesResponse]) -> SwitchServiceConnectedMachinesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SwitchServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SwitchServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SwitchServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.SwitchService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -308,8 +333,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="List", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse, + input=SwitchServiceListRequest, + output=SwitchServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -318,8 +343,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse, + input=SwitchServiceUpdateRequest, + output=SwitchServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -328,8 +353,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse, + input=SwitchServiceDeleteRequest, + output=SwitchServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -338,8 +363,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Migrate", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse, + input=SwitchServiceMigrateRequest, + output=SwitchServiceMigrateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.migrate, @@ -348,8 +373,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Port", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse, + input=SwitchServicePortRequest, + output=SwitchServicePortResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.port, @@ -358,8 +383,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="ConnectedMachines", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse, + input=SwitchServiceConnectedMachinesRequest, + output=SwitchServiceConnectedMachinesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.connected_machines, @@ -380,142 +405,134 @@ def path(self) -> str: class SwitchServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, + request: SwitchServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: + ) -> SwitchServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, + request: SwitchServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse: + ) -> SwitchServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceListResponse, + input=SwitchServiceListRequest, + output=SwitchServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, + request: SwitchServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse: + ) -> SwitchServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceUpdateResponse, + input=SwitchServiceUpdateRequest, + output=SwitchServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, + request: SwitchServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse: + ) -> SwitchServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceDeleteResponse, + input=SwitchServiceDeleteRequest, + output=SwitchServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def migrate( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, + request: SwitchServiceMigrateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse: + ) -> SwitchServiceMigrateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Migrate", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceMigrateResponse, + input=SwitchServiceMigrateRequest, + output=SwitchServiceMigrateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def port( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, + request: SwitchServicePortRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse: + ) -> SwitchServicePortResponse: return self.execute_unary( request=request, method=MethodInfo( name="Port", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse, + input=SwitchServicePortRequest, + output=SwitchServicePortResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def connected_machines( self, - request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, + request: SwitchServiceConnectedMachinesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse: + ) -> SwitchServiceConnectedMachinesResponse: return self.execute_unary( request=request, method=MethodInfo( name="ConnectedMachines", service_name="metalstack.admin.v2.SwitchService", - input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, - output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse, + input=SwitchServiceConnectedMachinesRequest, + output=SwitchServiceConnectedMachinesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/switch_pb.py b/python/metalstack/admin/v2/switch_pb.py new file mode 100644 index 00000000..c846b581 --- /dev/null +++ b/python/metalstack/admin/v2/switch_pb.py @@ -0,0 +1,620 @@ +# Generated from metalstack/admin/v2/switch.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, machine_pb, predefined_rules_pb, switch_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from ...api.v2.common_pb import UpdateMeta + from ...api.v2.machine_pb import MachineQuery + from ...api.v2.switch_pb import Switch, SwitchNic, SwitchOS, SwitchPortStatus, SwitchQuery, SwitchReplaceMode, SwitchWithMachines + + +_SwitchServiceGetRequestFields: TypeAlias = Literal["id"] + +class SwitchServiceGetRequest(Message[_SwitchServiceGetRequestFields]): + """ + SwitchServiceGetRequest is the request payload for getting a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceGetRequest + ``` + + Attributes: + id: + Id of the switch to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_SwitchServiceGetResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceGetResponse(Message[_SwitchServiceGetResponseFields]): + """ + SwitchServiceGetResponse is the response payload for getting a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceGetResponse + ``` + + Attributes: + switch: + Switch contains the requested switch + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceListRequestFields: TypeAlias = Literal["query"] + +class SwitchServiceListRequest(Message[_SwitchServiceListRequestFields]): + """ + SwitchServiceListRequest is the request payload for listing switches. + + ```proto + message metalstack.admin.v2.SwitchServiceListRequest + ``` + + Attributes: + query: + Query to filter the results + + ```proto + optional metalstack.api.v2.SwitchQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: SwitchQuery | None = None, + ) -> None: + pass + + query: SwitchQuery | None + +_SwitchServiceListResponseFields: TypeAlias = Literal["switches"] + +class SwitchServiceListResponse(Message[_SwitchServiceListResponseFields]): + """ + SwitchServiceListResponse is the response payload for listing switches. + + ```proto + message metalstack.admin.v2.SwitchServiceListResponse + ``` + + Attributes: + switches: + Switches that match the request query + + ```proto + repeated metalstack.api.v2.Switch switches = 1; + ``` + """ + + __slots__ = ("switches",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switches: list[Switch] | None = None, + ) -> None: + pass + + switches: list[Switch] + +_SwitchServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "updated_at", "description", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os"] + +class SwitchServiceUpdateRequest(Message[_SwitchServiceUpdateRequestFields]): + """ + SwitchServiceUpdateRequest is the request payload for updating a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceUpdateRequest + ``` + + Attributes: + id: + ID of the switch + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + updated_at: + UpdatedAt is the date when this entity was updated + Must be part of the update request to ensure optimistic locking + + ```proto + optional google.protobuf.Timestamp updated_at = 3; + ``` + description: + Description of the switch + + ```proto + optional string description = 4; + ``` + replace_mode: + ReplaceMode is used to mark a switch ready for replacement + + ```proto + optional metalstack.api.v2.SwitchReplaceMode replace_mode = 5; + ``` + management_ip: + ManagementIp is the switch's IP for management access + + ```proto + optional string management_ip = 6; + ``` + management_user: + ManagementUser is the user name to use for management access + + ```proto + optional string management_user = 7; + ``` + console_command: + ConsoleCommand is the command for accessing the switch's console + + ```proto + optional string console_command = 8; + ``` + nics: + Nics are the front panel ports of the switch + + ```proto + repeated metalstack.api.v2.SwitchNic nics = 9; + ``` + os: + SwitchOs is the OS running on the switch + + ```proto + optional metalstack.api.v2.SwitchOS os = 10; + ``` + """ + + __slots__ = ("id", "update_meta", "updated_at", "description", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + updated_at: Timestamp | None = None, + description: str | None = None, + replace_mode: SwitchReplaceMode | None = None, + management_ip: str | None = None, + management_user: str | None = None, + console_command: str | None = None, + nics: list[SwitchNic] | None = None, + os: SwitchOS | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + updated_at: Timestamp | None + description: str + replace_mode: SwitchReplaceMode + management_ip: str + management_user: str + console_command: str + nics: list[SwitchNic] + os: SwitchOS | None + +_SwitchServiceUpdateResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceUpdateResponse(Message[_SwitchServiceUpdateResponseFields]): + """ + SwitchServiceUpdateResponse is the response payload for updating a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceUpdateResponse + ``` + + Attributes: + switch: + Switch contains the updated switch + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceDeleteRequestFields: TypeAlias = Literal["id", "force"] + +class SwitchServiceDeleteRequest(Message[_SwitchServiceDeleteRequestFields]): + """ + SwitchServiceDeleteRequest is the request payload for deleting a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceDeleteRequest + ``` + + Attributes: + id: + Id of the switch + + ```proto + string id = 1; + ``` + force: + Force will allow switch deletion despite existing machine connections + + ```proto + bool force = 2; + ``` + """ + + __slots__ = ("id", "force") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + force: bool = False, + ) -> None: + pass + + id: str + force: bool + +_SwitchServiceDeleteResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceDeleteResponse(Message[_SwitchServiceDeleteResponseFields]): + """ + SwitchServiceDeleteResponse is the response payload for deleting a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceDeleteResponse + ``` + + Attributes: + switch: + Switch contains the deleted switch + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceMigrateRequestFields: TypeAlias = Literal["old_switch", "new_switch"] + +class SwitchServiceMigrateRequest(Message[_SwitchServiceMigrateRequestFields]): + """ + SwitchServiceMigrateRequest is the request payload for migrating a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceMigrateRequest + ``` + + Attributes: + old_switch: + OldSwitch is the switch to migrate away from + + ```proto + string old_switch = 1; + ``` + new_switch: + NewSwitch is the switch to migrate to + + ```proto + string new_switch = 2; + ``` + """ + + __slots__ = ("old_switch", "new_switch") + + if TYPE_CHECKING: + + def __init__( + self, + *, + old_switch: str = "", + new_switch: str = "", + ) -> None: + pass + + old_switch: str + new_switch: str + +_SwitchServiceMigrateResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceMigrateResponse(Message[_SwitchServiceMigrateResponseFields]): + """ + SwitchServiceMigrateResponse is the response payload for migrating a switch. + + ```proto + message metalstack.admin.v2.SwitchServiceMigrateResponse + ``` + + Attributes: + switch: + Switch contains the switch that was migrated to + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServicePortRequestFields: TypeAlias = Literal["id", "nic_name", "status"] + +class SwitchServicePortRequest(Message[_SwitchServicePortRequestFields]): + """ + SwitchServicePortRequest is the request payload for setting the port status of a switch port. + + ```proto + message metalstack.admin.v2.SwitchServicePortRequest + ``` + + Attributes: + id: + Id of the switch + + ```proto + string id = 1; + ``` + nic_name: + NicName of the port whose status should be changed + + ```proto + string nic_name = 2; + ``` + status: + Status that the port should have + + ```proto + metalstack.api.v2.SwitchPortStatus status = 3; + ``` + """ + + __slots__ = ("id", "nic_name", "status") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + nic_name: str = "", + status: SwitchPortStatus | None = None, + ) -> None: + pass + + id: str + nic_name: str + status: SwitchPortStatus + +_SwitchServicePortResponseFields: TypeAlias = Literal["switch"] + +class SwitchServicePortResponse(Message[_SwitchServicePortResponseFields]): + """ + SwitchServicePortResponse is the response payload for setting the port status of a switch port. + + ```proto + message metalstack.admin.v2.SwitchServicePortResponse + ``` + + Attributes: + switch: + Switch after the port status toggle + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceConnectedMachinesRequestFields: TypeAlias = Literal["query", "machine_query"] + +class SwitchServiceConnectedMachinesRequest(Message[_SwitchServiceConnectedMachinesRequestFields]): + """ + SwitchServiceConnectedMachinesRequest is the request payload for listing switches with machine connections. + + ```proto + message metalstack.admin.v2.SwitchServiceConnectedMachinesRequest + ``` + + Attributes: + query: + Query to filter the switch results + + ```proto + optional metalstack.api.v2.SwitchQuery query = 1; + ``` + machine_query: + MachineQuery to filter the machine results + + ```proto + optional metalstack.api.v2.MachineQuery machine_query = 2; + ``` + """ + + __slots__ = ("query", "machine_query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: SwitchQuery | None = None, + machine_query: MachineQuery | None = None, + ) -> None: + pass + + query: SwitchQuery | None + machine_query: MachineQuery | None + +_SwitchServiceConnectedMachinesResponseFields: TypeAlias = Literal["switches_with_machines"] + +class SwitchServiceConnectedMachinesResponse(Message[_SwitchServiceConnectedMachinesResponseFields]): + """ + SwitchServiceConnectedMachinesResponse is the response payload for listing switches with machine connections. + + ```proto + message metalstack.admin.v2.SwitchServiceConnectedMachinesResponse + ``` + + Attributes: + switches_with_machines: + SwitchesWithMachines contains all switches with their machine connections + + ```proto + repeated metalstack.api.v2.SwitchWithMachines switches_with_machines = 1; + ``` + """ + + __slots__ = ("switches_with_machines",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switches_with_machines: list[SwitchWithMachines] | None = None, + ) -> None: + pass + + switches_with_machines: list[SwitchWithMachines] + + +_DESC = file_desc( + b'\n metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01"M\n\x18SwitchServiceGetResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"P\n\x18SwitchServiceListRequest\x124\n\x05query\x18\x01 \x01(\x0b2\x1e.metalstack.api.v2.SwitchQueryR\x05query"R\n\x19SwitchServiceListResponse\x125\n\x08switches\x18\x01 \x03(\x0b2\x19.metalstack.api.v2.SwitchR\x08switches"\xb9\x05\n\x1aSwitchServiceUpdateRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x129\n\nupdated_at\x18\x03 \x01(\x0b2\x1a.google.protobuf.TimestampR\tupdatedAt\x122\n\x0bdescription\x18\x04 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12V\n\x0creplace_mode\x18\x05 \x01(\x0e2$.metalstack.api.v2.SwitchReplaceModeH\x01R\x0breplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x121\n\rmanagement_ip\x18\x06 \x01(\tH\x02R\x0cmanagementIpB\x07\xbaH\x04r\x02p\x01\x88\x01\x01\x129\n\x0fmanagement_user\x18\x07 \x01(\tH\x03R\x0emanagementUserB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x129\n\x0fconsole_command\x18\x08 \x01(\tH\x04R\x0econsoleCommandB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x120\n\x04nics\x18\t \x03(\x0b2\x1c.metalstack.api.v2.SwitchNicR\x04nics\x120\n\x02os\x18\n \x01(\x0b2\x1b.metalstack.api.v2.SwitchOSH\x05R\x02os\x88\x01\x01B\x0e\n\x0c_descriptionB\x0f\n\r_replace_modeB\x10\n\x0e_management_ipB\x12\n\x10_management_userB\x12\n\x10_console_commandB\x05\n\x03_os"P\n\x1bSwitchServiceUpdateResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"Q\n\x1aSwitchServiceDeleteRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x12\x14\n\x05force\x18\x02 \x01(\x08R\x05force"P\n\x1bSwitchServiceDeleteResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"y\n\x1bSwitchServiceMigrateRequest\x12,\n\nold_switch\x18\x01 \x01(\tR\toldSwitchB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x12,\n\nnew_switch\x18\x02 \x01(\tR\tnewSwitchB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01"Q\n\x1cSwitchServiceMigrateResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"\xa8\x01\n\x18SwitchServicePortRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x12&\n\x08nic_name\x18\x02 \x01(\tR\x07nicNameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12E\n\x06status\x18\x03 \x01(\x0e2#.metalstack.api.v2.SwitchPortStatusR\x06statusB\x08\xbaH\x05\x82\x01\x02\x10\x01"N\n\x19SwitchServicePortResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"\xa3\x01\n%SwitchServiceConnectedMachinesRequest\x124\n\x05query\x18\x01 \x01(\x0b2\x1e.metalstack.api.v2.SwitchQueryR\x05query\x12D\n\rmachine_query\x18\x02 \x01(\x0b2\x1f.metalstack.api.v2.MachineQueryR\x0cmachineQuery"\x85\x01\n&SwitchServiceConnectedMachinesResponse\x12[\n\x16switches_with_machines\x18\x01 \x03(\x0b2%.metalstack.api.v2.SwitchWithMachinesR\x14switchesWithMachines2\xea\x06\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.admin.v2.SwitchServiceGetRequest\x1a-.metalstack.admin.v2.SwitchServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12-.metalstack.admin.v2.SwitchServiceListRequest\x1a..metalstack.admin.v2.SwitchServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12v\n\x06Update\x12/.metalstack.admin.v2.SwitchServiceUpdateRequest\x1a0.metalstack.admin.v2.SwitchServiceUpdateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12v\n\x06Delete\x12/.metalstack.admin.v2.SwitchServiceDeleteRequest\x1a0.metalstack.admin.v2.SwitchServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x07Migrate\x120.metalstack.admin.v2.SwitchServiceMigrateRequest\x1a1.metalstack.admin.v2.SwitchServiceMigrateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12p\n\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x98\x01\n\x11ConnectedMachines\x12:.metalstack.admin.v2.SwitchServiceConnectedMachinesRequest\x1a;.metalstack.admin.v2.SwitchServiceConnectedMachinesResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xcf\x01\n\x17com.metalstack.admin.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + machine_pb.desc(), + predefined_rules_pb.desc(), + switch_pb.desc(), + ], + { + "SwitchServiceGetRequest": SwitchServiceGetRequest, + "SwitchServiceGetResponse": SwitchServiceGetResponse, + "SwitchServiceListRequest": SwitchServiceListRequest, + "SwitchServiceListResponse": SwitchServiceListResponse, + "SwitchServiceUpdateRequest": SwitchServiceUpdateRequest, + "SwitchServiceUpdateResponse": SwitchServiceUpdateResponse, + "SwitchServiceDeleteRequest": SwitchServiceDeleteRequest, + "SwitchServiceDeleteResponse": SwitchServiceDeleteResponse, + "SwitchServiceMigrateRequest": SwitchServiceMigrateRequest, + "SwitchServiceMigrateResponse": SwitchServiceMigrateResponse, + "SwitchServicePortRequest": SwitchServicePortRequest, + "SwitchServicePortResponse": SwitchServicePortResponse, + "SwitchServiceConnectedMachinesRequest": SwitchServiceConnectedMachinesRequest, + "SwitchServiceConnectedMachinesResponse": SwitchServiceConnectedMachinesResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/switch.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/switch_pb2.py b/python/metalstack/admin/v2/switch_pb2.py deleted file mode 100644 index f692db69..00000000 --- a/python/metalstack/admin/v2/switch_pb2.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/switch.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/switch.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import switch_pb2 as metalstack_dot_api_dot_v2_dot_switch__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\"M\n\x18SwitchServiceGetResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"P\n\x18SwitchServiceListRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.SwitchQueryR\x05query\"R\n\x19SwitchServiceListResponse\x12\x35\n\x08switches\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.SwitchR\x08switches\"\xb9\x05\n\x1aSwitchServiceUpdateRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12V\n\x0creplace_mode\x18\x05 \x01(\x0e\x32$.metalstack.api.v2.SwitchReplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\x0breplaceMode\x88\x01\x01\x12\x31\n\rmanagement_ip\x18\x06 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x02R\x0cmanagementIp\x88\x01\x01\x12\x39\n\x0fmanagement_user\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x0emanagementUser\x88\x01\x01\x12\x39\n\x0f\x63onsole_command\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x04R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\t \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12\x30\n\x02os\x18\n \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSH\x05R\x02os\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0f\n\r_replace_modeB\x10\n\x0e_management_ipB\x12\n\x10_management_userB\x12\n\x10_console_commandB\x05\n\x03_os\"P\n\x1bSwitchServiceUpdateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"Q\n\x1aSwitchServiceDeleteRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x14\n\x05\x66orce\x18\x02 \x01(\x08R\x05\x66orce\"P\n\x1bSwitchServiceDeleteResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"y\n\x1bSwitchServiceMigrateRequest\x12,\n\nold_switch\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\toldSwitch\x12,\n\nnew_switch\x18\x02 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\tnewSwitch\"Q\n\x1cSwitchServiceMigrateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xa8\x01\n\x18SwitchServicePortRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12&\n\x08nic_name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07nicName\x12\x45\n\x06status\x18\x03 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06status\"N\n\x19SwitchServicePortResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xa3\x01\n%SwitchServiceConnectedMachinesRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.SwitchQueryR\x05query\x12\x44\n\rmachine_query\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x0cmachineQuery\"\x85\x01\n&SwitchServiceConnectedMachinesResponse\x12[\n\x16switches_with_machines\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.SwitchWithMachinesR\x14switchesWithMachines2\xea\x06\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.admin.v2.SwitchServiceGetRequest\x1a-.metalstack.admin.v2.SwitchServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12-.metalstack.admin.v2.SwitchServiceListRequest\x1a..metalstack.admin.v2.SwitchServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12v\n\x06Update\x12/.metalstack.admin.v2.SwitchServiceUpdateRequest\x1a\x30.metalstack.admin.v2.SwitchServiceUpdateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12v\n\x06\x44\x65lete\x12/.metalstack.admin.v2.SwitchServiceDeleteRequest\x1a\x30.metalstack.admin.v2.SwitchServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12y\n\x07Migrate\x12\x30.metalstack.admin.v2.SwitchServiceMigrateRequest\x1a\x31.metalstack.admin.v2.SwitchServiceMigrateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12p\n\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x98\x01\n\x11\x43onnectedMachines\x12:.metalstack.admin.v2.SwitchServiceConnectedMachinesRequest\x1a;.metalstack.admin.v2.SwitchServiceConnectedMachinesResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xcf\x01\n\x17\x63om.metalstack.admin.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.switch_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\013SwitchProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_SWITCHSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['replace_mode']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['replace_mode']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['management_ip']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['management_ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['management_user']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['management_user']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['console_command']._loaded_options = None - _globals['_SWITCHSERVICEUPDATEREQUEST'].fields_by_name['console_command']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SWITCHSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEMIGRATEREQUEST'].fields_by_name['old_switch']._loaded_options = None - _globals['_SWITCHSERVICEMIGRATEREQUEST'].fields_by_name['old_switch']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEMIGRATEREQUEST'].fields_by_name['new_switch']._loaded_options = None - _globals['_SWITCHSERVICEMIGRATEREQUEST'].fields_by_name['new_switch']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['nic_name']._loaded_options = None - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['nic_name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['status']._loaded_options = None - _globals['_SWITCHSERVICEPORTREQUEST'].fields_by_name['status']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCHSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SWITCHSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SWITCHSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Update']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SWITCHSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SWITCHSERVICE'].methods_by_name['Migrate']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Migrate']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SWITCHSERVICE'].methods_by_name['Port']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Port']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_SWITCHSERVICE'].methods_by_name['ConnectedMachines']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['ConnectedMachines']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002' - _globals['_SWITCHSERVICEGETREQUEST']._serialized_start=258 - _globals['_SWITCHSERVICEGETREQUEST']._serialized_end=314 - _globals['_SWITCHSERVICEGETRESPONSE']._serialized_start=316 - _globals['_SWITCHSERVICEGETRESPONSE']._serialized_end=393 - _globals['_SWITCHSERVICELISTREQUEST']._serialized_start=395 - _globals['_SWITCHSERVICELISTREQUEST']._serialized_end=475 - _globals['_SWITCHSERVICELISTRESPONSE']._serialized_start=477 - _globals['_SWITCHSERVICELISTRESPONSE']._serialized_end=559 - _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_start=562 - _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_end=1259 - _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_start=1261 - _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_end=1341 - _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_start=1343 - _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_end=1424 - _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_start=1426 - _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_end=1506 - _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_start=1508 - _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_end=1629 - _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_start=1631 - _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_end=1712 - _globals['_SWITCHSERVICEPORTREQUEST']._serialized_start=1715 - _globals['_SWITCHSERVICEPORTREQUEST']._serialized_end=1883 - _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_start=1885 - _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_end=1963 - _globals['_SWITCHSERVICECONNECTEDMACHINESREQUEST']._serialized_start=1966 - _globals['_SWITCHSERVICECONNECTEDMACHINESREQUEST']._serialized_end=2129 - _globals['_SWITCHSERVICECONNECTEDMACHINESRESPONSE']._serialized_start=2132 - _globals['_SWITCHSERVICECONNECTEDMACHINESRESPONSE']._serialized_end=2265 - _globals['_SWITCHSERVICE']._serialized_start=2268 - _globals['_SWITCHSERVICE']._serialized_end=3142 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/switch_pb2.pyi b/python/metalstack/admin/v2/switch_pb2.pyi deleted file mode 100644 index 3fe369a6..00000000 --- a/python/metalstack/admin/v2/switch_pb2.pyi +++ /dev/null @@ -1,127 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import switch_pb2 as _switch_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SwitchServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class SwitchServiceGetResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _switch_pb2.SwitchQuery - def __init__(self, query: _Optional[_Union[_switch_pb2.SwitchQuery, _Mapping]] = ...) -> None: ... - -class SwitchServiceListResponse(_message.Message): - __slots__ = ("switches",) - SWITCHES_FIELD_NUMBER: _ClassVar[int] - switches: _containers.RepeatedCompositeFieldContainer[_switch_pb2.Switch] - def __init__(self, switches: _Optional[_Iterable[_Union[_switch_pb2.Switch, _Mapping]]] = ...) -> None: ... - -class SwitchServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "updated_at", "description", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - REPLACE_MODE_FIELD_NUMBER: _ClassVar[int] - MANAGEMENT_IP_FIELD_NUMBER: _ClassVar[int] - MANAGEMENT_USER_FIELD_NUMBER: _ClassVar[int] - CONSOLE_COMMAND_FIELD_NUMBER: _ClassVar[int] - NICS_FIELD_NUMBER: _ClassVar[int] - OS_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - updated_at: _timestamp_pb2.Timestamp - description: str - replace_mode: _switch_pb2.SwitchReplaceMode - management_ip: str - management_user: str - console_command: str - nics: _containers.RepeatedCompositeFieldContainer[_switch_pb2.SwitchNic] - os: _switch_pb2.SwitchOS - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., updated_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., description: _Optional[str] = ..., replace_mode: _Optional[_Union[_switch_pb2.SwitchReplaceMode, str]] = ..., management_ip: _Optional[str] = ..., management_user: _Optional[str] = ..., console_command: _Optional[str] = ..., nics: _Optional[_Iterable[_Union[_switch_pb2.SwitchNic, _Mapping]]] = ..., os: _Optional[_Union[_switch_pb2.SwitchOS, _Mapping]] = ...) -> None: ... - -class SwitchServiceUpdateResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceDeleteRequest(_message.Message): - __slots__ = ("id", "force") - ID_FIELD_NUMBER: _ClassVar[int] - FORCE_FIELD_NUMBER: _ClassVar[int] - id: str - force: bool - def __init__(self, id: _Optional[str] = ..., force: _Optional[bool] = ...) -> None: ... - -class SwitchServiceDeleteResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceMigrateRequest(_message.Message): - __slots__ = ("old_switch", "new_switch") - OLD_SWITCH_FIELD_NUMBER: _ClassVar[int] - NEW_SWITCH_FIELD_NUMBER: _ClassVar[int] - old_switch: str - new_switch: str - def __init__(self, old_switch: _Optional[str] = ..., new_switch: _Optional[str] = ...) -> None: ... - -class SwitchServiceMigrateResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServicePortRequest(_message.Message): - __slots__ = ("id", "nic_name", "status") - ID_FIELD_NUMBER: _ClassVar[int] - NIC_NAME_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - id: str - nic_name: str - status: _switch_pb2.SwitchPortStatus - def __init__(self, id: _Optional[str] = ..., nic_name: _Optional[str] = ..., status: _Optional[_Union[_switch_pb2.SwitchPortStatus, str]] = ...) -> None: ... - -class SwitchServicePortResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceConnectedMachinesRequest(_message.Message): - __slots__ = ("query", "machine_query") - QUERY_FIELD_NUMBER: _ClassVar[int] - MACHINE_QUERY_FIELD_NUMBER: _ClassVar[int] - query: _switch_pb2.SwitchQuery - machine_query: _machine_pb2.MachineQuery - def __init__(self, query: _Optional[_Union[_switch_pb2.SwitchQuery, _Mapping]] = ..., machine_query: _Optional[_Union[_machine_pb2.MachineQuery, _Mapping]] = ...) -> None: ... - -class SwitchServiceConnectedMachinesResponse(_message.Message): - __slots__ = ("switches_with_machines",) - SWITCHES_WITH_MACHINES_FIELD_NUMBER: _ClassVar[int] - switches_with_machines: _containers.RepeatedCompositeFieldContainer[_switch_pb2.SwitchWithMachines] - def __init__(self, switches_with_machines: _Optional[_Iterable[_Union[_switch_pb2.SwitchWithMachines, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/task_connect.py b/python/metalstack/admin/v2/task_connect.py index 27ce8fb6..7e46e21e 100644 --- a/python/metalstack/admin/v2/task_connect.py +++ b/python/metalstack/admin/v2/task_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/task.proto +# Generated from metalstack/admin/v2/task.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.task_pb2 as metalstack_dot_admin_dot_v2_dot_task__pb2 + +from .task_pb import TaskServiceDeleteRequest, TaskServiceDeleteResponse, TaskServiceGetRequest, TaskServiceGetResponse, TaskServiceListRequest, TaskServiceListResponse, TaskServiceQueuesRequest, TaskServiceQueuesResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class TaskService(Protocol): - async def get(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: TaskServiceGetRequest, ctx: RequestContext[TaskServiceGetRequest, TaskServiceGetResponse]) -> TaskServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: TaskServiceDeleteRequest, ctx: RequestContext[TaskServiceDeleteRequest, TaskServiceDeleteResponse]) -> TaskServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def queues(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def queues(self, request: TaskServiceQueuesRequest, ctx: RequestContext[TaskServiceQueuesRequest, TaskServiceQueuesResponse]) -> TaskServiceQueuesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: TaskServiceListRequest, ctx: RequestContext[TaskServiceListRequest, TaskServiceListResponse]) -> TaskServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TaskServiceASGIApplication(ConnectASGIApplication[TaskService]): - def __init__(self, service: TaskService | AsyncGenerator[TaskService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TaskService | AsyncGenerator[TaskService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: TaskService | AsyncGenerator[TaskService], *, interc method=MethodInfo( name="Get", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse, + input=TaskServiceGetRequest, + output=TaskServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -50,8 +66,8 @@ def __init__(self, service: TaskService | AsyncGenerator[TaskService], *, interc method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse, + input=TaskServiceDeleteRequest, + output=TaskServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -60,8 +76,8 @@ def __init__(self, service: TaskService | AsyncGenerator[TaskService], *, interc method=MethodInfo( name="Queues", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse, + input=TaskServiceQueuesRequest, + output=TaskServiceQueuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.queues, @@ -70,8 +86,8 @@ def __init__(self, service: TaskService | AsyncGenerator[TaskService], *, interc method=MethodInfo( name="List", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse, + input=TaskServiceListRequest, + output=TaskServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -92,18 +108,18 @@ def path(self) -> str: class TaskServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, + request: TaskServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse: + ) -> TaskServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse, + input=TaskServiceGetRequest, + output=TaskServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def get( async def delete( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, + request: TaskServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse: + ) -> TaskServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse, + input=TaskServiceDeleteRequest, + output=TaskServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def delete( async def queues( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, + request: TaskServiceQueuesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse: + ) -> TaskServiceQueuesResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Queues", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse, + input=TaskServiceQueuesRequest, + output=TaskServiceQueuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def queues( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, + request: TaskServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse: + ) -> TaskServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse, + input=TaskServiceListRequest, + output=TaskServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class TaskServiceSync(Protocol): + def get(self, request: TaskServiceGetRequest, ctx: RequestContext[TaskServiceGetRequest, TaskServiceGetResponse]) -> TaskServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: TaskServiceDeleteRequest, ctx: RequestContext[TaskServiceDeleteRequest, TaskServiceDeleteResponse]) -> TaskServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def queues(self, request: TaskServiceQueuesRequest, ctx: RequestContext[TaskServiceQueuesRequest, TaskServiceQueuesResponse]) -> TaskServiceQueuesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class TaskServiceSync(Protocol): - def get(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def queues(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: TaskServiceListRequest, ctx: RequestContext[TaskServiceListRequest, TaskServiceListResponse]) -> TaskServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TaskServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TaskServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TaskServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.TaskService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse, + input=TaskServiceGetRequest, + output=TaskServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -203,8 +225,8 @@ def __init__(self, service: TaskServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse, + input=TaskServiceDeleteRequest, + output=TaskServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -213,8 +235,8 @@ def __init__(self, service: TaskServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Queues", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse, + input=TaskServiceQueuesRequest, + output=TaskServiceQueuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.queues, @@ -223,8 +245,8 @@ def __init__(self, service: TaskServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="List", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse, + input=TaskServiceListRequest, + output=TaskServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -245,82 +267,77 @@ def path(self) -> str: class TaskServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, + request: TaskServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse: + ) -> TaskServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceGetResponse, + input=TaskServiceGetRequest, + output=TaskServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, + request: TaskServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse: + ) -> TaskServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceDeleteResponse, + input=TaskServiceDeleteRequest, + output=TaskServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def queues( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, + request: TaskServiceQueuesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse: + ) -> TaskServiceQueuesResponse: return self.execute_unary( request=request, method=MethodInfo( name="Queues", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceQueuesResponse, + input=TaskServiceQueuesRequest, + output=TaskServiceQueuesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, + request: TaskServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse: + ) -> TaskServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TaskService", - input=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_task__pb2.TaskServiceListResponse, + input=TaskServiceListRequest, + output=TaskServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/task_pb.py b/python/metalstack/admin/v2/task_pb.py new file mode 100644 index 00000000..65215b8c --- /dev/null +++ b/python/metalstack/admin/v2/task_pb.py @@ -0,0 +1,554 @@ +# Generated from metalstack/admin/v2/task.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from ...api.v2 import common_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + +_TaskServiceGetRequestFields: TypeAlias = Literal["task_id", "queue"] + +class TaskServiceGetRequest(Message[_TaskServiceGetRequestFields]): + """ + TaskServiceGetRequest is the request payload for getting a task. + + ```proto + message metalstack.admin.v2.TaskServiceGetRequest + ``` + + Attributes: + task_id: + TaskId is the identifier of the task to get + + ```proto + string task_id = 1; + ``` + queue: + Queue is the queue where this task was scheduled to + + ```proto + string queue = 2; + ``` + """ + + __slots__ = ("task_id", "queue") + + if TYPE_CHECKING: + + def __init__( + self, + *, + task_id: str = "", + queue: str = "", + ) -> None: + pass + + task_id: str + queue: str + +_TaskServiceGetResponseFields: TypeAlias = Literal["task"] + +class TaskServiceGetResponse(Message[_TaskServiceGetResponseFields]): + """ + TaskServiceGetResponse is the response payload for getting a task. + + ```proto + message metalstack.admin.v2.TaskServiceGetResponse + ``` + + Attributes: + task: + Task contains the task details + + ```proto + optional metalstack.admin.v2.TaskInfo task = 1; + ``` + """ + + __slots__ = ("task",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + task: TaskInfo | None = None, + ) -> None: + pass + + task: TaskInfo | None + +_TaskServiceDeleteRequestFields: TypeAlias = Literal["task_id", "queue"] + +class TaskServiceDeleteRequest(Message[_TaskServiceDeleteRequestFields]): + """ + TaskServiceDeleteRequest is the request payload for deleting a task. + + ```proto + message metalstack.admin.v2.TaskServiceDeleteRequest + ``` + + Attributes: + task_id: + TaskId is the identifier of the task to cancel + + ```proto + string task_id = 1; + ``` + queue: + Queue is the queue where this task was scheduled to + + ```proto + string queue = 2; + ``` + """ + + __slots__ = ("task_id", "queue") + + if TYPE_CHECKING: + + def __init__( + self, + *, + task_id: str = "", + queue: str = "", + ) -> None: + pass + + task_id: str + queue: str + +_TaskServiceDeleteResponseFields: TypeAlias = NoReturn + +class TaskServiceDeleteResponse(Message[_TaskServiceDeleteResponseFields]): + """ + TaskServiceDeleteResponse is the response payload for deleting a task. + + ```proto + message metalstack.admin.v2.TaskServiceDeleteResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TaskServiceQueuesRequestFields: TypeAlias = NoReturn + +class TaskServiceQueuesRequest(Message[_TaskServiceQueuesRequestFields]): + """ + TaskServiceQueuesRequest is the request payload for getting all queues. + + ```proto + message metalstack.admin.v2.TaskServiceQueuesRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TaskServiceQueuesResponseFields: TypeAlias = Literal["queues"] + +class TaskServiceQueuesResponse(Message[_TaskServiceQueuesResponseFields]): + """ + TaskServiceQueuesResponse is the response payload for getting all queues. + + ```proto + message metalstack.admin.v2.TaskServiceQueuesResponse + ``` + + Attributes: + queues: + Queues configured for the async system + + ```proto + repeated string queues = 1; + ``` + """ + + __slots__ = ("queues",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + queues: list[str] | None = None, + ) -> None: + pass + + queues: list[str] + +_TaskServiceListRequestFields: TypeAlias = Literal["queue", "count", "page"] + +class TaskServiceListRequest(Message[_TaskServiceListRequestFields]): + """ + TaskServiceListRequest is the request payload for listing tasks. + + ```proto + message metalstack.admin.v2.TaskServiceListRequest + ``` + + Attributes: + queue: + Queue filters tasks by this queue + Will return tasks from all queues if not specified + + ```proto + optional string queue = 1; + ``` + count: + Count is the number of tasks to return + + ```proto + optional uint32 count = 2; + ``` + page: + Page is the page of tasks to return + + ```proto + optional uint32 page = 3; + ``` + """ + + __slots__ = ("queue", "count", "page") + + if TYPE_CHECKING: + + def __init__( + self, + *, + queue: str | None = None, + count: int | None = None, + page: int | None = None, + ) -> None: + pass + + queue: str + count: int + page: int + +_TaskServiceListResponseFields: TypeAlias = Literal["tasks"] + +class TaskServiceListResponse(Message[_TaskServiceListResponseFields]): + """ + TaskServiceListResponse is the response payload for listing tasks. + + ```proto + message metalstack.admin.v2.TaskServiceListResponse + ``` + + Attributes: + tasks: + Tasks contains the list of requested tasks + + ```proto + repeated metalstack.admin.v2.TaskInfo tasks = 1; + ``` + """ + + __slots__ = ("tasks",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tasks: list[TaskInfo] | None = None, + ) -> None: + pass + + tasks: list[TaskInfo] + +_TaskInfoFields: TypeAlias = Literal["id", "queue", "type", "payload", "state", "max_retry", "retried", "last_error", "last_failed_at", "timeout", "deadline", "group", "next_process_at", "is_orphaned", "retention", "completed_at", "result"] + +class TaskInfo(Message[_TaskInfoFields]): + """ + TaskInfo contains details of an asynchronous task. + + ```proto + message metalstack.admin.v2.TaskInfo + ``` + + Attributes: + id: + ID is the identifier of the task + + ```proto + string id = 1; + ``` + queue: + Queue is the name of the queue in which the task belongs + + ```proto + string queue = 2; + ``` + type: + Type is the type name of the task + + ```proto + string type = 3; + ``` + payload: + Payload is the payload data of the task + + ```proto + bytes payload = 4; + ``` + state: + State indicates the task state + + ```proto + metalstack.admin.v2.TaskState state = 5; + ``` + max_retry: + MaxRetry is the maximum number of times the task can be retried + + ```proto + int32 max_retry = 6; + ``` + retried: + Retried is the number of times the task has retried so far + + ```proto + int32 retried = 7; + ``` + last_error: + LastError is the error message from the last failure + + ```proto + string last_error = 8; + ``` + last_failed_at: + LastFailedAt is the time of the last failure if any + If the task has no failures, LastFailedAt is zero time (i.e. time.Time{}) + + ```proto + optional google.protobuf.Timestamp last_failed_at = 9; + ``` + timeout: + Timeout is the duration the task can be processed by Handler before being retried + + ```proto + optional google.protobuf.Duration timeout = 10; + ``` + deadline: + Deadline is the deadline for the task + + ```proto + optional google.protobuf.Timestamp deadline = 11; + ``` + group: + Group is the name of the group in which the task belongs + + Tasks in the same queue can be grouped together by Group name and will be aggregated into one task + by a Server processing the queue + + Empty string (default) indicates task does not belong to any groups, and no aggregation will be applied to the task + + ```proto + string group = 12; + ``` + next_process_at: + NextProcessAt is the time the task is scheduled to be processed + Zero if not applicable + + ```proto + optional google.protobuf.Timestamp next_process_at = 13; + ``` + is_orphaned: + IsOrphaned describes whether the task is left in active state with no worker processing it + An orphaned task indicates that the worker has crashed or experienced network failures and was not able to + extend its lease on the task + + This task will be recovered by running a server against the queue the task is in + This field is only applicable to tasks with TaskStateActive + + ```proto + bool is_orphaned = 14; + ``` + retention: + Retention is duration of the retention period after the task is successfully processed + + ```proto + optional google.protobuf.Duration retention = 15; + ``` + completed_at: + CompletedAt is the time when the task is processed successfully + Zero value (i.e. time.Time{}) indicates no value + + ```proto + optional google.protobuf.Timestamp completed_at = 16; + ``` + result: + Result holds the result data associated with the task + Use ResultWriter to write result data from the Handler + + ```proto + bytes result = 17; + ``` + """ + + __slots__ = ("id", "queue", "type", "payload", "state", "max_retry", "retried", "last_error", "last_failed_at", "timeout", "deadline", "group", "next_process_at", "is_orphaned", "retention", "completed_at", "result") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + queue: str = "", + type: str = "", + payload: bytes = b"", + state: TaskState | None = None, + max_retry: int = 0, + retried: int = 0, + last_error: str = "", + last_failed_at: Timestamp | None = None, + timeout: Duration | None = None, + deadline: Timestamp | None = None, + group: str = "", + next_process_at: Timestamp | None = None, + is_orphaned: bool = False, + retention: Duration | None = None, + completed_at: Timestamp | None = None, + result: bytes = b"", + ) -> None: + pass + + id: str + queue: str + type: str + payload: bytes + state: TaskState + max_retry: int + retried: int + last_error: str + last_failed_at: Timestamp | None + timeout: Duration | None + deadline: Timestamp | None + group: str + next_process_at: Timestamp | None + is_orphaned: bool + retention: Duration | None + completed_at: Timestamp | None + result: bytes + +class TaskState(Enum): + """ + TaskState defines the state of the task. + + ```proto + enum metalstack.admin.v2.TaskState + ``` + + Attributes: + UNSPECIFIED: + TASK_STATE_UNSPECIFIED is not specified + + ```proto + TASK_STATE_UNSPECIFIED = 0 + ``` + ACTIVE: + TASK_STATE_ACTIVE indicates that the task is currently being processed by Handler + + ```proto + TASK_STATE_ACTIVE = 1 + ``` + PENDING: + TASK_STATE_PENDING indicates that the task is ready to be processed by Handler + + ```proto + TASK_STATE_PENDING = 2 + ``` + SCHEDULED: + TASK_STATE_SCHEDULED indicates that the task is scheduled to be processed some time in the future + + ```proto + TASK_STATE_SCHEDULED = 3 + ``` + RETRY: + TASK_STATE_RETRY indicates that the task has previously failed and is scheduled to be processed some time in the future + + ```proto + TASK_STATE_RETRY = 4 + ``` + ARCHIVED: + TASK_STATE_ARCHIVED indicates that the task is archived and stored for inspection purposes + + ```proto + TASK_STATE_ARCHIVED = 5 + ``` + COMPLETED: + TASK_STATE_COMPLETED indicates that the task is processed successfully and retained until the retention TTL expires + + ```proto + TASK_STATE_COMPLETED = 6 + ``` + AGGREGATING: + TASK_STATE_AGGREGATING indicates that the task is waiting in a group to be aggregated into one task + + ```proto + TASK_STATE_AGGREGATING = 7 + ``` + """ + + UNSPECIFIED = 0 + ACTIVE = 1 + PENDING = 2 + SCHEDULED = 3 + RETRY = 4 + ARCHIVED = 5 + COMPLETED = 6 + AGGREGATING = 7 + + +_DESC = file_desc( + b'\n\x1emetalstack/admin/v2/task.proto\x12\x13metalstack.admin.v2\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto"F\n\x15TaskServiceGetRequest\x12\x17\n\x07task_id\x18\x01 \x01(\tR\x06taskId\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue"K\n\x16TaskServiceGetResponse\x121\n\x04task\x18\x01 \x01(\x0b2\x1d.metalstack.admin.v2.TaskInfoR\x04task"I\n\x18TaskServiceDeleteRequest\x12\x17\n\x07task_id\x18\x01 \x01(\tR\x06taskId\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue"\x1b\n\x19TaskServiceDeleteResponse"\x1a\n\x18TaskServiceQueuesRequest"3\n\x19TaskServiceQueuesResponse\x12\x16\n\x06queues\x18\x01 \x03(\tR\x06queues"\x84\x01\n\x16TaskServiceListRequest\x12\x19\n\x05queue\x18\x01 \x01(\tH\x00R\x05queue\x88\x01\x01\x12\x19\n\x05count\x18\x02 \x01(\rH\x01R\x05count\x88\x01\x01\x12\x17\n\x04page\x18\x03 \x01(\rH\x02R\x04page\x88\x01\x01B\x08\n\x06_queueB\x08\n\x06_countB\x07\n\x05_page"N\n\x17TaskServiceListResponse\x123\n\x05tasks\x18\x01 \x03(\x0b2\x1d.metalstack.admin.v2.TaskInfoR\x05tasks"\xa4\x05\n\x08TaskInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x18\n\x07payload\x18\x04 \x01(\x0cR\x07payload\x124\n\x05state\x18\x05 \x01(\x0e2\x1e.metalstack.admin.v2.TaskStateR\x05state\x12\x1b\n\tmax_retry\x18\x06 \x01(\x05R\x08maxRetry\x12\x18\n\x07retried\x18\x07 \x01(\x05R\x07retried\x12\x1d\n\nlast_error\x18\x08 \x01(\tR\tlastError\x12@\n\x0elast_failed_at\x18\t \x01(\x0b2\x1a.google.protobuf.TimestampR\x0clastFailedAt\x123\n\x07timeout\x18\n \x01(\x0b2\x19.google.protobuf.DurationR\x07timeout\x126\n\x08deadline\x18\x0b \x01(\x0b2\x1a.google.protobuf.TimestampR\x08deadline\x12\x14\n\x05group\x18\x0c \x01(\tR\x05group\x12B\n\x0fnext_process_at\x18\r \x01(\x0b2\x1a.google.protobuf.TimestampR\rnextProcessAt\x12\x1f\n\x0bis_orphaned\x18\x0e \x01(\x08R\nisOrphaned\x127\n\tretention\x18\x0f \x01(\x0b2\x19.google.protobuf.DurationR\tretention\x12=\n\x0ccompleted_at\x18\x10 \x01(\x0b2\x1a.google.protobuf.TimestampR\x0bcompletedAt\x12\x16\n\x06result\x18\x11 \x01(\x0cR\x06result*\xb6\x02\n\tTaskState\x12\x1a\n\x16TASK_STATE_UNSPECIFIED\x10\x00\x12!\n\x11TASK_STATE_ACTIVE\x10\x01\x1a\n\x82\xb2\x19\x06active\x12#\n\x12TASK_STATE_PENDING\x10\x02\x1a\x0b\x82\xb2\x19\x07pending\x12\'\n\x14TASK_STATE_SCHEDULED\x10\x03\x1a\r\x82\xb2\x19\tscheduled\x12\x1f\n\x10TASK_STATE_RETRY\x10\x04\x1a\t\x82\xb2\x19\x05retry\x12%\n\x13TASK_STATE_ARCHIVED\x10\x05\x1a\x0c\x82\xb2\x19\x08archived\x12\'\n\x14TASK_STATE_COMPLETED\x10\x06\x1a\r\x82\xb2\x19\tcompleted\x12+\n\x16TASK_STATE_AGGREGATING\x10\x07\x1a\x0f\x82\xb2\x19\x0baggregating2\xd1\x03\n\x0bTaskService\x12j\n\x03Get\x12*.metalstack.admin.v2.TaskServiceGetRequest\x1a+.metalstack.admin.v2.TaskServiceGetResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12r\n\x06Delete\x12-.metalstack.admin.v2.TaskServiceDeleteRequest\x1a..metalstack.admin.v2.TaskServiceDeleteResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12s\n\x06Queues\x12-.metalstack.admin.v2.TaskServiceQueuesRequest\x1a..metalstack.admin.v2.TaskServiceQueuesResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12m\n\x04List\x12+.metalstack.admin.v2.TaskServiceListRequest\x1a,.metalstack.admin.v2.TaskServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xcd\x01\n\x17com.metalstack.admin.v2B\tTaskProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + ], + { + "TaskServiceGetRequest": TaskServiceGetRequest, + "TaskServiceGetResponse": TaskServiceGetResponse, + "TaskServiceDeleteRequest": TaskServiceDeleteRequest, + "TaskServiceDeleteResponse": TaskServiceDeleteResponse, + "TaskServiceQueuesRequest": TaskServiceQueuesRequest, + "TaskServiceQueuesResponse": TaskServiceQueuesResponse, + "TaskServiceListRequest": TaskServiceListRequest, + "TaskServiceListResponse": TaskServiceListResponse, + "TaskInfo": TaskInfo, + "TaskState": TaskState, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/task.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/task_pb2.py b/python/metalstack/admin/v2/task_pb2.py deleted file mode 100644 index 1108fdb8..00000000 --- a/python/metalstack/admin/v2/task_pb2.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/task.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/task.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/admin/v2/task.proto\x12\x13metalstack.admin.v2\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\"F\n\x15TaskServiceGetRequest\x12\x17\n\x07task_id\x18\x01 \x01(\tR\x06taskId\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue\"K\n\x16TaskServiceGetResponse\x12\x31\n\x04task\x18\x01 \x01(\x0b\x32\x1d.metalstack.admin.v2.TaskInfoR\x04task\"I\n\x18TaskServiceDeleteRequest\x12\x17\n\x07task_id\x18\x01 \x01(\tR\x06taskId\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue\"\x1b\n\x19TaskServiceDeleteResponse\"\x1a\n\x18TaskServiceQueuesRequest\"3\n\x19TaskServiceQueuesResponse\x12\x16\n\x06queues\x18\x01 \x03(\tR\x06queues\"\x84\x01\n\x16TaskServiceListRequest\x12\x19\n\x05queue\x18\x01 \x01(\tH\x00R\x05queue\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\rH\x01R\x05\x63ount\x88\x01\x01\x12\x17\n\x04page\x18\x03 \x01(\rH\x02R\x04page\x88\x01\x01\x42\x08\n\x06_queueB\x08\n\x06_countB\x07\n\x05_page\"N\n\x17TaskServiceListResponse\x12\x33\n\x05tasks\x18\x01 \x03(\x0b\x32\x1d.metalstack.admin.v2.TaskInfoR\x05tasks\"\xa4\x05\n\x08TaskInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n\x05queue\x18\x02 \x01(\tR\x05queue\x12\x12\n\x04type\x18\x03 \x01(\tR\x04type\x12\x18\n\x07payload\x18\x04 \x01(\x0cR\x07payload\x12\x34\n\x05state\x18\x05 \x01(\x0e\x32\x1e.metalstack.admin.v2.TaskStateR\x05state\x12\x1b\n\tmax_retry\x18\x06 \x01(\x05R\x08maxRetry\x12\x18\n\x07retried\x18\x07 \x01(\x05R\x07retried\x12\x1d\n\nlast_error\x18\x08 \x01(\tR\tlastError\x12@\n\x0elast_failed_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0clastFailedAt\x12\x33\n\x07timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationR\x07timeout\x12\x36\n\x08\x64\x65\x61\x64line\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x64\x65\x61\x64line\x12\x14\n\x05group\x18\x0c \x01(\tR\x05group\x12\x42\n\x0fnext_process_at\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampR\rnextProcessAt\x12\x1f\n\x0bis_orphaned\x18\x0e \x01(\x08R\nisOrphaned\x12\x37\n\tretention\x18\x0f \x01(\x0b\x32\x19.google.protobuf.DurationR\tretention\x12=\n\x0c\x63ompleted_at\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0b\x63ompletedAt\x12\x16\n\x06result\x18\x11 \x01(\x0cR\x06result*\xb6\x02\n\tTaskState\x12\x1a\n\x16TASK_STATE_UNSPECIFIED\x10\x00\x12!\n\x11TASK_STATE_ACTIVE\x10\x01\x1a\n\x82\xb2\x19\x06\x61\x63tive\x12#\n\x12TASK_STATE_PENDING\x10\x02\x1a\x0b\x82\xb2\x19\x07pending\x12\'\n\x14TASK_STATE_SCHEDULED\x10\x03\x1a\r\x82\xb2\x19\tscheduled\x12\x1f\n\x10TASK_STATE_RETRY\x10\x04\x1a\t\x82\xb2\x19\x05retry\x12%\n\x13TASK_STATE_ARCHIVED\x10\x05\x1a\x0c\x82\xb2\x19\x08\x61rchived\x12\'\n\x14TASK_STATE_COMPLETED\x10\x06\x1a\r\x82\xb2\x19\tcompleted\x12+\n\x16TASK_STATE_AGGREGATING\x10\x07\x1a\x0f\x82\xb2\x19\x0b\x61ggregating2\xd1\x03\n\x0bTaskService\x12j\n\x03Get\x12*.metalstack.admin.v2.TaskServiceGetRequest\x1a+.metalstack.admin.v2.TaskServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12r\n\x06\x44\x65lete\x12-.metalstack.admin.v2.TaskServiceDeleteRequest\x1a..metalstack.admin.v2.TaskServiceDeleteResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12s\n\x06Queues\x12-.metalstack.admin.v2.TaskServiceQueuesRequest\x1a..metalstack.admin.v2.TaskServiceQueuesResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12m\n\x04List\x12+.metalstack.admin.v2.TaskServiceListRequest\x1a,.metalstack.admin.v2.TaskServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xcd\x01\n\x17\x63om.metalstack.admin.v2B\tTaskProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.task_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\tTaskProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_ACTIVE"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_ACTIVE"]._serialized_options = b'\202\262\031\006active' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_PENDING"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_PENDING"]._serialized_options = b'\202\262\031\007pending' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_SCHEDULED"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_SCHEDULED"]._serialized_options = b'\202\262\031\tscheduled' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_RETRY"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_RETRY"]._serialized_options = b'\202\262\031\005retry' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_ARCHIVED"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_ARCHIVED"]._serialized_options = b'\202\262\031\010archived' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_COMPLETED"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_COMPLETED"]._serialized_options = b'\202\262\031\tcompleted' - _globals['_TASKSTATE'].values_by_name["TASK_STATE_AGGREGATING"]._loaded_options = None - _globals['_TASKSTATE'].values_by_name["TASK_STATE_AGGREGATING"]._serialized_options = b'\202\262\031\013aggregating' - _globals['_TASKSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_TASKSERVICE'].methods_by_name['Get']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_TASKSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_TASKSERVICE'].methods_by_name['Delete']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TASKSERVICE'].methods_by_name['Queues']._loaded_options = None - _globals['_TASKSERVICE'].methods_by_name['Queues']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_TASKSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_TASKSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_TASKSTATE']._serialized_start=1381 - _globals['_TASKSTATE']._serialized_end=1691 - _globals['_TASKSERVICEGETREQUEST']._serialized_start=152 - _globals['_TASKSERVICEGETREQUEST']._serialized_end=222 - _globals['_TASKSERVICEGETRESPONSE']._serialized_start=224 - _globals['_TASKSERVICEGETRESPONSE']._serialized_end=299 - _globals['_TASKSERVICEDELETEREQUEST']._serialized_start=301 - _globals['_TASKSERVICEDELETEREQUEST']._serialized_end=374 - _globals['_TASKSERVICEDELETERESPONSE']._serialized_start=376 - _globals['_TASKSERVICEDELETERESPONSE']._serialized_end=403 - _globals['_TASKSERVICEQUEUESREQUEST']._serialized_start=405 - _globals['_TASKSERVICEQUEUESREQUEST']._serialized_end=431 - _globals['_TASKSERVICEQUEUESRESPONSE']._serialized_start=433 - _globals['_TASKSERVICEQUEUESRESPONSE']._serialized_end=484 - _globals['_TASKSERVICELISTREQUEST']._serialized_start=487 - _globals['_TASKSERVICELISTREQUEST']._serialized_end=619 - _globals['_TASKSERVICELISTRESPONSE']._serialized_start=621 - _globals['_TASKSERVICELISTRESPONSE']._serialized_end=699 - _globals['_TASKINFO']._serialized_start=702 - _globals['_TASKINFO']._serialized_end=1378 - _globals['_TASKSERVICE']._serialized_start=1694 - _globals['_TASKSERVICE']._serialized_end=2159 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/task_pb2.pyi b/python/metalstack/admin/v2/task_pb2.pyi deleted file mode 100644 index 2ad4c340..00000000 --- a/python/metalstack/admin/v2/task_pb2.pyi +++ /dev/null @@ -1,122 +0,0 @@ -import datetime - -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class TaskState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TASK_STATE_UNSPECIFIED: _ClassVar[TaskState] - TASK_STATE_ACTIVE: _ClassVar[TaskState] - TASK_STATE_PENDING: _ClassVar[TaskState] - TASK_STATE_SCHEDULED: _ClassVar[TaskState] - TASK_STATE_RETRY: _ClassVar[TaskState] - TASK_STATE_ARCHIVED: _ClassVar[TaskState] - TASK_STATE_COMPLETED: _ClassVar[TaskState] - TASK_STATE_AGGREGATING: _ClassVar[TaskState] -TASK_STATE_UNSPECIFIED: TaskState -TASK_STATE_ACTIVE: TaskState -TASK_STATE_PENDING: TaskState -TASK_STATE_SCHEDULED: TaskState -TASK_STATE_RETRY: TaskState -TASK_STATE_ARCHIVED: TaskState -TASK_STATE_COMPLETED: TaskState -TASK_STATE_AGGREGATING: TaskState - -class TaskServiceGetRequest(_message.Message): - __slots__ = ("task_id", "queue") - TASK_ID_FIELD_NUMBER: _ClassVar[int] - QUEUE_FIELD_NUMBER: _ClassVar[int] - task_id: str - queue: str - def __init__(self, task_id: _Optional[str] = ..., queue: _Optional[str] = ...) -> None: ... - -class TaskServiceGetResponse(_message.Message): - __slots__ = ("task",) - TASK_FIELD_NUMBER: _ClassVar[int] - task: TaskInfo - def __init__(self, task: _Optional[_Union[TaskInfo, _Mapping]] = ...) -> None: ... - -class TaskServiceDeleteRequest(_message.Message): - __slots__ = ("task_id", "queue") - TASK_ID_FIELD_NUMBER: _ClassVar[int] - QUEUE_FIELD_NUMBER: _ClassVar[int] - task_id: str - queue: str - def __init__(self, task_id: _Optional[str] = ..., queue: _Optional[str] = ...) -> None: ... - -class TaskServiceDeleteResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TaskServiceQueuesRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TaskServiceQueuesResponse(_message.Message): - __slots__ = ("queues",) - QUEUES_FIELD_NUMBER: _ClassVar[int] - queues: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, queues: _Optional[_Iterable[str]] = ...) -> None: ... - -class TaskServiceListRequest(_message.Message): - __slots__ = ("queue", "count", "page") - QUEUE_FIELD_NUMBER: _ClassVar[int] - COUNT_FIELD_NUMBER: _ClassVar[int] - PAGE_FIELD_NUMBER: _ClassVar[int] - queue: str - count: int - page: int - def __init__(self, queue: _Optional[str] = ..., count: _Optional[int] = ..., page: _Optional[int] = ...) -> None: ... - -class TaskServiceListResponse(_message.Message): - __slots__ = ("tasks",) - TASKS_FIELD_NUMBER: _ClassVar[int] - tasks: _containers.RepeatedCompositeFieldContainer[TaskInfo] - def __init__(self, tasks: _Optional[_Iterable[_Union[TaskInfo, _Mapping]]] = ...) -> None: ... - -class TaskInfo(_message.Message): - __slots__ = ("id", "queue", "type", "payload", "state", "max_retry", "retried", "last_error", "last_failed_at", "timeout", "deadline", "group", "next_process_at", "is_orphaned", "retention", "completed_at", "result") - ID_FIELD_NUMBER: _ClassVar[int] - QUEUE_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - PAYLOAD_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - MAX_RETRY_FIELD_NUMBER: _ClassVar[int] - RETRIED_FIELD_NUMBER: _ClassVar[int] - LAST_ERROR_FIELD_NUMBER: _ClassVar[int] - LAST_FAILED_AT_FIELD_NUMBER: _ClassVar[int] - TIMEOUT_FIELD_NUMBER: _ClassVar[int] - DEADLINE_FIELD_NUMBER: _ClassVar[int] - GROUP_FIELD_NUMBER: _ClassVar[int] - NEXT_PROCESS_AT_FIELD_NUMBER: _ClassVar[int] - IS_ORPHANED_FIELD_NUMBER: _ClassVar[int] - RETENTION_FIELD_NUMBER: _ClassVar[int] - COMPLETED_AT_FIELD_NUMBER: _ClassVar[int] - RESULT_FIELD_NUMBER: _ClassVar[int] - id: str - queue: str - type: str - payload: bytes - state: TaskState - max_retry: int - retried: int - last_error: str - last_failed_at: _timestamp_pb2.Timestamp - timeout: _duration_pb2.Duration - deadline: _timestamp_pb2.Timestamp - group: str - next_process_at: _timestamp_pb2.Timestamp - is_orphaned: bool - retention: _duration_pb2.Duration - completed_at: _timestamp_pb2.Timestamp - result: bytes - def __init__(self, id: _Optional[str] = ..., queue: _Optional[str] = ..., type: _Optional[str] = ..., payload: _Optional[bytes] = ..., state: _Optional[_Union[TaskState, str]] = ..., max_retry: _Optional[int] = ..., retried: _Optional[int] = ..., last_error: _Optional[str] = ..., last_failed_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., timeout: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., deadline: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., group: _Optional[str] = ..., next_process_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., is_orphaned: _Optional[bool] = ..., retention: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., completed_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., result: _Optional[bytes] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/tenant_connect.py b/python/metalstack/admin/v2/tenant_connect.py index d54a06eb..5a390fad 100644 --- a/python/metalstack/admin/v2/tenant_connect.py +++ b/python/metalstack/admin/v2/tenant_connect.py @@ -1,38 +1,54 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/tenant.proto +# Generated from metalstack/admin/v2/tenant.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.tenant_pb2 as metalstack_dot_admin_dot_v2_dot_tenant__pb2 + +from .tenant_pb import TenantServiceAddMemberRequest, TenantServiceAddMemberResponse, TenantServiceCreateRequest, TenantServiceCreateResponse, TenantServiceListRequest, TenantServiceListResponse, TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class TenantService(Protocol): - async def create(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: TenantServiceCreateRequest, ctx: RequestContext[TenantServiceCreateRequest, TenantServiceCreateResponse]) -> TenantServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: TenantServiceListRequest, ctx: RequestContext[TenantServiceListRequest, TenantServiceListResponse]) -> TenantServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def add_member(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def add_member(self, request: TenantServiceAddMemberRequest, ctx: RequestContext[TenantServiceAddMemberRequest, TenantServiceAddMemberResponse]) -> TenantServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def remove_member(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def remove_member(self, request: TenantServiceRemoveMemberRequest, ctx: RequestContext[TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse]) -> TenantServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TenantServiceASGIApplication(ConnectASGIApplication[TenantService]): - def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TenantService | AsyncGenerator[TenantService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -40,8 +56,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -50,8 +66,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="List", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -60,8 +76,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="AddMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.add_member, @@ -70,8 +86,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="RemoveMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.remove_member, @@ -92,18 +108,18 @@ def path(self) -> str: class TenantServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, + request: TenantServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: + ) -> TenantServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -112,18 +128,18 @@ async def create( async def list( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, + request: TenantServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: + ) -> TenantServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -132,18 +148,18 @@ async def list( async def add_member( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, + request: TenantServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: + ) -> TenantServiceAddMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -152,49 +168,55 @@ async def add_member( async def remove_member( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, + request: TenantServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: + ) -> TenantServiceRemoveMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class TenantServiceSync(Protocol): + def create(self, request: TenantServiceCreateRequest, ctx: RequestContext[TenantServiceCreateRequest, TenantServiceCreateResponse]) -> TenantServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: TenantServiceListRequest, ctx: RequestContext[TenantServiceListRequest, TenantServiceListResponse]) -> TenantServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def add_member(self, request: TenantServiceAddMemberRequest, ctx: RequestContext[TenantServiceAddMemberRequest, TenantServiceAddMemberResponse]) -> TenantServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - -class TenantServiceSync(Protocol): - def create(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def add_member(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def remove_member(self, request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def remove_member(self, request: TenantServiceRemoveMemberRequest, ctx: RequestContext[TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse]) -> TenantServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TenantServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TenantServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TenantServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.TenantService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -203,8 +225,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="List", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -213,8 +235,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="AddMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.add_member, @@ -223,8 +245,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="RemoveMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.remove_member, @@ -245,82 +267,77 @@ def path(self) -> str: class TenantServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, + request: TenantServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: + ) -> TenantServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, + request: TenantServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse: + ) -> TenantServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def add_member( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, + request: TenantServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: + ) -> TenantServiceAddMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def remove_member( self, - request: metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, + request: TenantServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: + ) -> TenantServiceRemoveMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.admin.v2.TenantService", - input=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_admin_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/tenant_pb.py b/python/metalstack/admin/v2/tenant_pb.py new file mode 100644 index 00000000..2577bddb --- /dev/null +++ b/python/metalstack/admin/v2/tenant_pb.py @@ -0,0 +1,368 @@ +# Generated from metalstack/admin/v2/tenant.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, tenant_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.common_pb import Labels, TenantRole + from ...api.v2.tenant_pb import Tenant, TenantMember, TenantQuery + + +_TenantServiceCreateRequestFields: TypeAlias = Literal["name", "description", "email", "avatar_url", "labels"] + +class TenantServiceCreateRequest(Message[_TenantServiceCreateRequestFields]): + """ + TenantServiceCreateRequest is the request payload for creating a tenant. + + ```proto + message metalstack.admin.v2.TenantServiceCreateRequest + ``` + + Attributes: + name: + Name of the tenant + + ```proto + string name = 1; + ``` + description: + Description of the tenant + + ```proto + optional string description = 2; + ``` + email: + Email of the tenant, if not set will be inherited from the creator + + ```proto + optional string email = 3; + ``` + avatar_url: + AvatarUrl of the tenant + + ```proto + optional string avatar_url = 4; + ``` + labels: + Labels on the tenant + + ```proto + optional metalstack.api.v2.Labels labels = 5; + ``` + """ + + __slots__ = ("name", "description", "email", "avatar_url", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + description: str | None = None, + email: str | None = None, + avatar_url: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + name: str + description: str + email: str + avatar_url: str + labels: Labels | None + +_TenantServiceCreateResponseFields: TypeAlias = Literal["tenant"] + +class TenantServiceCreateResponse(Message[_TenantServiceCreateResponseFields]): + """ + TenantServiceCreateResponse is the response payload for creating a tenant. + + ```proto + message metalstack.admin.v2.TenantServiceCreateResponse + ``` + + Attributes: + tenant: + Tenant contains the created tenant + + ```proto + optional metalstack.api.v2.Tenant tenant = 1; + ``` + """ + + __slots__ = ("tenant",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: Tenant | None = None, + ) -> None: + pass + + tenant: Tenant | None + +_TenantServiceListRequestFields: TypeAlias = Literal["query"] + +class TenantServiceListRequest(Message[_TenantServiceListRequestFields]): + """ + TenantServiceListRequest is the request payload for listing tenants. + + ```proto + message metalstack.admin.v2.TenantServiceListRequest + ``` + + Attributes: + query: + Query for tenants + + ```proto + optional metalstack.api.v2.TenantQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: TenantQuery | None = None, + ) -> None: + pass + + query: TenantQuery | None + +_TenantServiceListResponseFields: TypeAlias = Literal["tenants", "next_page"] + +class TenantServiceListResponse(Message[_TenantServiceListResponseFields]): + """ + TenantServiceListResponse is the response payload for listing tenants. + + ```proto + message metalstack.admin.v2.TenantServiceListResponse + ``` + + Attributes: + tenants: + Tenants contains the list of tenants + + ```proto + repeated metalstack.api.v2.Tenant tenants = 1; + ``` + next_page: + NextPage is used for pagination, returns the next page to be fetched and must then be provided in the list request + + ```proto + optional uint64 next_page = 2; + ``` + """ + + __slots__ = ("tenants", "next_page") + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenants: list[Tenant] | None = None, + next_page: int | None = None, + ) -> None: + pass + + tenants: list[Tenant] + next_page: int + +_TenantServiceAddMemberRequestFields: TypeAlias = Literal["tenant", "member", "role"] + +class TenantServiceAddMemberRequest(Message[_TenantServiceAddMemberRequestFields]): + """ + TenantServiceAddMemberRequest is the request payload for adding a member to a tenant + + ```proto + message metalstack.admin.v2.TenantServiceAddMemberRequest + ``` + + Attributes: + tenant: + Login of the tenant to which the member will be added + + ```proto + string tenant = 1; + ``` + member: + Login of the member to add + + ```proto + string member = 2; + ``` + role: + Role to assign to the new member + + ```proto + metalstack.api.v2.TenantRole role = 3; + ``` + """ + + __slots__ = ("tenant", "member", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: str = "", + member: str = "", + role: TenantRole | None = None, + ) -> None: + pass + + tenant: str + member: str + role: TenantRole + +_TenantServiceAddMemberResponseFields: TypeAlias = Literal["tenant_member"] + +class TenantServiceAddMemberResponse(Message[_TenantServiceAddMemberResponseFields]): + """ + TenantServiceAddMemberResponse is the response payload for the add member request + + ```proto + message metalstack.admin.v2.TenantServiceAddMemberResponse + ``` + + Attributes: + tenant_member: + TenantMember is the added tenant member + + ```proto + optional metalstack.api.v2.TenantMember tenant_member = 1; + ``` + """ + + __slots__ = ("tenant_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant_member: TenantMember | None = None, + ) -> None: + pass + + tenant_member: TenantMember | None + +_TenantServiceRemoveMemberRequestFields: TypeAlias = Literal["tenant", "member"] + +class TenantServiceRemoveMemberRequest(Message[_TenantServiceRemoveMemberRequestFields]): + """ + TenantServiceRemoveMemberRequest is the request payload for removing a member from a tenant + + ```proto + message metalstack.admin.v2.TenantServiceRemoveMemberRequest + ``` + + Attributes: + tenant: + Login of the tenant from which the member will be removed + + ```proto + string tenant = 1; + ``` + member: + Login of the member to remove + + ```proto + string member = 2; + ``` + """ + + __slots__ = ("tenant", "member") + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: str = "", + member: str = "", + ) -> None: + pass + + tenant: str + member: str + +_TenantServiceRemoveMemberResponseFields: TypeAlias = Literal["tenant_member"] + +class TenantServiceRemoveMemberResponse(Message[_TenantServiceRemoveMemberResponseFields]): + """ + TenantServiceRemoveMemberResponse is the response payload for the remove member request + + ```proto + message metalstack.admin.v2.TenantServiceRemoveMemberResponse + ``` + + Attributes: + tenant_member: + TenantMember is the removed tenant member + + ```proto + optional metalstack.api.v2.TenantMember tenant_member = 1; + ``` + """ + + __slots__ = ("tenant_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant_member: TenantMember | None = None, + ) -> None: + pass + + tenant_member: TenantMember | None + + +_DESC = file_desc( + b'\n metalstack/admin/v2/tenant.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/tenant.proto"\xa2\x02\n\x1aTenantServiceCreateRequest\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x122\n\x0bdescription\x18\x02 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12"\n\x05email\x18\x03 \x01(\tH\x01R\x05emailB\x07\xbaH\x04r\x02`\x01\x88\x01\x01\x12/\n\navatar_url\x18\x04 \x01(\tH\x02R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x121\n\x06labels\x18\x05 \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labelsB\x0e\n\x0c_descriptionB\x08\n\x06_emailB\r\n\x0b_avatar_url"P\n\x1bTenantServiceCreateResponse\x121\n\x06tenant\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.TenantR\x06tenant"P\n\x18TenantServiceListRequest\x124\n\x05query\x18\x01 \x01(\x0b2\x1e.metalstack.api.v2.TenantQueryR\x05query"\x80\x01\n\x19TenantServiceListResponse\x123\n\x07tenants\x18\x01 \x03(\x0b2\x19.metalstack.api.v2.TenantR\x07tenants\x12 \n\tnext_page\x18\x02 \x01(\x04H\x00R\x08nextPage\x88\x01\x01B\x0c\n\n_next_page"\xa6\x01\n\x1dTenantServiceAddMemberRequest\x12#\n\x06tenant\x18\x01 \x01(\tR\x06tenantB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12#\n\x06member\x18\x02 \x01(\tR\x06memberB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12;\n\x04role\x18\x03 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"f\n\x1eTenantServiceAddMemberResponse\x12D\n\rtenant_member\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember"l\n TenantServiceRemoveMemberRequest\x12#\n\x06tenant\x18\x01 \x01(\tR\x06tenantB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12#\n\x06member\x18\x02 \x01(\tR\x06memberB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01"i\n!TenantServiceRemoveMemberResponse\x12D\n\rtenant_member\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember2\x86\x04\n\rTenantService\x12v\n\x06Create\x12/.metalstack.admin.v2.TenantServiceCreateRequest\x1a0.metalstack.admin.v2.TenantServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12q\n\x04List\x12-.metalstack.admin.v2.TenantServiceListRequest\x1a..metalstack.admin.v2.TenantServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x7f\n\tAddMember\x122.metalstack.admin.v2.TenantServiceAddMemberRequest\x1a3.metalstack.admin.v2.TenantServiceAddMemberResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x0cRemoveMember\x125.metalstack.admin.v2.TenantServiceRemoveMemberRequest\x1a6.metalstack.admin.v2.TenantServiceRemoveMemberResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01B\xcf\x01\n\x17com.metalstack.admin.v2B\x0bTenantProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + tenant_pb.desc(), + ], + { + "TenantServiceCreateRequest": TenantServiceCreateRequest, + "TenantServiceCreateResponse": TenantServiceCreateResponse, + "TenantServiceListRequest": TenantServiceListRequest, + "TenantServiceListResponse": TenantServiceListResponse, + "TenantServiceAddMemberRequest": TenantServiceAddMemberRequest, + "TenantServiceAddMemberResponse": TenantServiceAddMemberResponse, + "TenantServiceRemoveMemberRequest": TenantServiceRemoveMemberRequest, + "TenantServiceRemoveMemberResponse": TenantServiceRemoveMemberResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/tenant.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/tenant_pb2.py b/python/metalstack/admin/v2/tenant_pb2.py deleted file mode 100644 index 6e378429..00000000 --- a/python/metalstack/admin/v2/tenant_pb2.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/tenant.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/tenant.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import tenant_pb2 as metalstack_dot_api_dot_v2_dot_tenant__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/admin/v2/tenant.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/tenant.proto\"\xa2\x02\n\x1aTenantServiceCreateRequest\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x04name\x12\x32\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\"\n\x05\x65mail\x18\x03 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x01R\x05\x65mail\x88\x01\x01\x12/\n\navatar_url\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x02R\tavatarUrl\x88\x01\x01\x12\x31\n\x06labels\x18\x05 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labelsB\x0e\n\x0c_descriptionB\x08\n\x06_emailB\r\n\x0b_avatar_url\"P\n\x1bTenantServiceCreateResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\"P\n\x18TenantServiceListRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.TenantQueryR\x05query\"\x80\x01\n\x19TenantServiceListResponse\x12\x33\n\x07tenants\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.TenantR\x07tenants\x12 \n\tnext_page\x18\x02 \x01(\x04H\x00R\x08nextPage\x88\x01\x01\x42\x0c\n\n_next_page\"\xa6\x01\n\x1dTenantServiceAddMemberRequest\x12#\n\x06tenant\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06tenant\x12#\n\x06member\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06member\x12;\n\x04role\x18\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"f\n\x1eTenantServiceAddMemberResponse\x12\x44\n\rtenant_member\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember\"l\n TenantServiceRemoveMemberRequest\x12#\n\x06tenant\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06tenant\x12#\n\x06member\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06member\"i\n!TenantServiceRemoveMemberResponse\x12\x44\n\rtenant_member\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember2\x86\x04\n\rTenantService\x12v\n\x06\x43reate\x12/.metalstack.admin.v2.TenantServiceCreateRequest\x1a\x30.metalstack.admin.v2.TenantServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12q\n\x04List\x12-.metalstack.admin.v2.TenantServiceListRequest\x1a..metalstack.admin.v2.TenantServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x7f\n\tAddMember\x12\x32.metalstack.admin.v2.TenantServiceAddMemberRequest\x1a\x33.metalstack.admin.v2.TenantServiceAddMemberResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x88\x01\n\x0cRemoveMember\x12\x35.metalstack.admin.v2.TenantServiceRemoveMemberRequest\x1a\x36.metalstack.admin.v2.TenantServiceRemoveMemberResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x42\xcf\x01\n\x17\x63om.metalstack.admin.v2B\x0bTenantProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.tenant_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\013TenantProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['tenant']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['tenant']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['tenant']._loaded_options = None - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['tenant']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['member']._loaded_options = None - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['member']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['AddMember']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['AddMember']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['RemoveMember']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['RemoveMember']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICECREATEREQUEST']._serialized_start=193 - _globals['_TENANTSERVICECREATEREQUEST']._serialized_end=483 - _globals['_TENANTSERVICECREATERESPONSE']._serialized_start=485 - _globals['_TENANTSERVICECREATERESPONSE']._serialized_end=565 - _globals['_TENANTSERVICELISTREQUEST']._serialized_start=567 - _globals['_TENANTSERVICELISTREQUEST']._serialized_end=647 - _globals['_TENANTSERVICELISTRESPONSE']._serialized_start=650 - _globals['_TENANTSERVICELISTRESPONSE']._serialized_end=778 - _globals['_TENANTSERVICEADDMEMBERREQUEST']._serialized_start=781 - _globals['_TENANTSERVICEADDMEMBERREQUEST']._serialized_end=947 - _globals['_TENANTSERVICEADDMEMBERRESPONSE']._serialized_start=949 - _globals['_TENANTSERVICEADDMEMBERRESPONSE']._serialized_end=1051 - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST']._serialized_start=1053 - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST']._serialized_end=1161 - _globals['_TENANTSERVICEREMOVEMEMBERRESPONSE']._serialized_start=1163 - _globals['_TENANTSERVICEREMOVEMEMBERRESPONSE']._serialized_end=1268 - _globals['_TENANTSERVICE']._serialized_start=1271 - _globals['_TENANTSERVICE']._serialized_end=1789 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/tenant_pb2.pyi b/python/metalstack/admin/v2/tenant_pb2.pyi deleted file mode 100644 index 77b01eb8..00000000 --- a/python/metalstack/admin/v2/tenant_pb2.pyi +++ /dev/null @@ -1,75 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import tenant_pb2 as _tenant_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class TenantServiceCreateRequest(_message.Message): - __slots__ = ("name", "description", "email", "avatar_url", "labels") - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - name: str - description: str - email: str - avatar_url: str - labels: _common_pb2.Labels - def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., email: _Optional[str] = ..., avatar_url: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class TenantServiceCreateResponse(_message.Message): - __slots__ = ("tenant",) - TENANT_FIELD_NUMBER: _ClassVar[int] - tenant: _tenant_pb2.Tenant - def __init__(self, tenant: _Optional[_Union[_tenant_pb2.Tenant, _Mapping]] = ...) -> None: ... - -class TenantServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _tenant_pb2.TenantQuery - def __init__(self, query: _Optional[_Union[_tenant_pb2.TenantQuery, _Mapping]] = ...) -> None: ... - -class TenantServiceListResponse(_message.Message): - __slots__ = ("tenants", "next_page") - TENANTS_FIELD_NUMBER: _ClassVar[int] - NEXT_PAGE_FIELD_NUMBER: _ClassVar[int] - tenants: _containers.RepeatedCompositeFieldContainer[_tenant_pb2.Tenant] - next_page: int - def __init__(self, tenants: _Optional[_Iterable[_Union[_tenant_pb2.Tenant, _Mapping]]] = ..., next_page: _Optional[int] = ...) -> None: ... - -class TenantServiceAddMemberRequest(_message.Message): - __slots__ = ("tenant", "member", "role") - TENANT_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - tenant: str - member: str - role: _common_pb2.TenantRole - def __init__(self, tenant: _Optional[str] = ..., member: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - -class TenantServiceAddMemberResponse(_message.Message): - __slots__ = ("tenant_member",) - TENANT_MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant_member: _tenant_pb2.TenantMember - def __init__(self, tenant_member: _Optional[_Union[_tenant_pb2.TenantMember, _Mapping]] = ...) -> None: ... - -class TenantServiceRemoveMemberRequest(_message.Message): - __slots__ = ("tenant", "member") - TENANT_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant: str - member: str - def __init__(self, tenant: _Optional[str] = ..., member: _Optional[str] = ...) -> None: ... - -class TenantServiceRemoveMemberResponse(_message.Message): - __slots__ = ("tenant_member",) - TENANT_MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant_member: _tenant_pb2.TenantMember - def __init__(self, tenant_member: _Optional[_Union[_tenant_pb2.TenantMember, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/token_connect.py b/python/metalstack/admin/v2/token_connect.py index 8dcecad6..cf7ea2e2 100644 --- a/python/metalstack/admin/v2/token_connect.py +++ b/python/metalstack/admin/v2/token_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/token.proto +# Generated from metalstack/admin/v2/token.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.token_pb2 as metalstack_dot_admin_dot_v2_dot_token__pb2 + +from .token_pb import TokenServiceCreateRequest, TokenServiceCreateResponse, TokenServiceListRequest, TokenServiceListResponse, TokenServiceRevokeRequest, TokenServiceRevokeResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class TokenService(Protocol): - async def list(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: TokenServiceListRequest, ctx: RequestContext[TokenServiceListRequest, TokenServiceListResponse]) -> TokenServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def revoke(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def revoke(self, request: TokenServiceRevokeRequest, ctx: RequestContext[TokenServiceRevokeRequest, TokenServiceRevokeResponse]) -> TokenServiceRevokeResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: TokenServiceCreateRequest, ctx: RequestContext[TokenServiceCreateRequest, TokenServiceCreateResponse]) -> TokenServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TokenServiceASGIApplication(ConnectASGIApplication[TokenService]): - def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TokenService | AsyncGenerator[TokenService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,8 +53,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="List", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -47,8 +63,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Revoke", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.revoke, @@ -57,8 +73,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -79,18 +95,18 @@ def path(self) -> str: class TokenServiceClient(ConnectClient): async def list( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, + request: TokenServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse: + ) -> TokenServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -99,18 +115,18 @@ async def list( async def revoke( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, + request: TokenServiceRevokeRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: + ) -> TokenServiceRevokeResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Revoke", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -119,47 +135,52 @@ async def revoke( async def create( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, + request: TokenServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse: + ) -> TokenServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class TokenServiceSync(Protocol): + def list(self, request: TokenServiceListRequest, ctx: RequestContext[TokenServiceListRequest, TokenServiceListResponse]) -> TokenServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def revoke(self, request: TokenServiceRevokeRequest, ctx: RequestContext[TokenServiceRevokeRequest, TokenServiceRevokeResponse]) -> TokenServiceRevokeResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class TokenServiceSync(Protocol): - def list(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def revoke(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def create(self, request: TokenServiceCreateRequest, ctx: RequestContext[TokenServiceCreateRequest, TokenServiceCreateResponse]) -> TokenServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TokenServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TokenServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TokenServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.TokenService/List": EndpointSync.unary( method=MethodInfo( name="List", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -168,8 +189,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Revoke", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.revoke, @@ -178,8 +199,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -200,62 +221,58 @@ def path(self) -> str: class TokenServiceClientSync(ConnectClientSync): def list( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, + request: TokenServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse: + ) -> TokenServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def revoke( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, + request: TokenServiceRevokeRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: + ) -> TokenServiceRevokeResponse: return self.execute_unary( request=request, method=MethodInfo( name="Revoke", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, + request: TokenServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse: + ) -> TokenServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.admin.v2.TokenService", - input=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_admin_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/token_pb.py b/python/metalstack/admin/v2/token_pb.py new file mode 100644 index 00000000..c883c2d1 --- /dev/null +++ b/python/metalstack/admin/v2/token_pb.py @@ -0,0 +1,249 @@ +# Generated from metalstack/admin/v2/token.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, token_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.token_pb import Token, TokenQuery, TokenServiceCreateRequest as TokenServiceCreateRequest_ + + +_TokenServiceListRequestFields: TypeAlias = Literal["query"] + +class TokenServiceListRequest(Message[_TokenServiceListRequestFields]): + """ + TokenServiceListRequest is the request payload for listing tokens. + + ```proto + message metalstack.admin.v2.TokenServiceListRequest + ``` + + Attributes: + query: + Query for tokens + + ```proto + optional metalstack.api.v2.TokenQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: TokenQuery | None = None, + ) -> None: + pass + + query: TokenQuery | None + +_TokenServiceListResponseFields: TypeAlias = Literal["tokens"] + +class TokenServiceListResponse(Message[_TokenServiceListResponseFields]): + """ + TokenServiceListResponse is the response payload for listing tokens. + + ```proto + message metalstack.admin.v2.TokenServiceListResponse + ``` + + Attributes: + tokens: + Tokens contains the list of tokens + + ```proto + repeated metalstack.api.v2.Token tokens = 1; + ``` + """ + + __slots__ = ("tokens",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tokens: list[Token] | None = None, + ) -> None: + pass + + tokens: list[Token] + +_TokenServiceRevokeRequestFields: TypeAlias = Literal["uuid", "user"] + +class TokenServiceRevokeRequest(Message[_TokenServiceRevokeRequestFields]): + """ + TokenServiceRevokeRequest is the request payload for revoking a token. + + ```proto + message metalstack.admin.v2.TokenServiceRevokeRequest + ``` + + Attributes: + uuid: + Uuid is the uuid of the token which should be revoked + + ```proto + string uuid = 1; + ``` + user: + User is the id of the user for which the token should be revoked + + ```proto + string user = 2; + ``` + """ + + __slots__ = ("uuid", "user") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + user: str = "", + ) -> None: + pass + + uuid: str + user: str + +_TokenServiceRevokeResponseFields: TypeAlias = NoReturn + +class TokenServiceRevokeResponse(Message[_TokenServiceRevokeResponseFields]): + """ + TokenServiceRevokeResponse is the response payload for revoking a token. + + ```proto + message metalstack.admin.v2.TokenServiceRevokeResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TokenServiceCreateRequestFields: TypeAlias = Literal["user", "token_create_request"] + +class TokenServiceCreateRequest(Message[_TokenServiceCreateRequestFields]): + """ + TokenServiceCreateRequest is the request payload for creating a token. + + ```proto + message metalstack.admin.v2.TokenServiceCreateRequest + ``` + + Attributes: + user: + User this token should be created for, if omitted, user is derived from caller + + ```proto + optional string user = 1; + ``` + token_create_request: + TokenCreateRequest which should be created + + ```proto + optional metalstack.api.v2.TokenServiceCreateRequest token_create_request = 2; + ``` + """ + + __slots__ = ("user", "token_create_request") + + if TYPE_CHECKING: + + def __init__( + self, + *, + user: str | None = None, + token_create_request: TokenServiceCreateRequest_ | None = None, + ) -> None: + pass + + user: str + token_create_request: TokenServiceCreateRequest_ | None + +_TokenServiceCreateResponseFields: TypeAlias = Literal["token", "secret"] + +class TokenServiceCreateResponse(Message[_TokenServiceCreateResponseFields]): + """ + TokenServiceCreateResponse is the response payload for creating a token. + + ```proto + message metalstack.admin.v2.TokenServiceCreateResponse + ``` + + Attributes: + token: + Token contains the created token + + ```proto + optional metalstack.api.v2.Token token = 1; + ``` + secret: + Secret is the body if the JWT token, should be used in API requests as bearer token + + ```proto + string secret = 2; + ``` + """ + + __slots__ = ("token", "secret") + + if TYPE_CHECKING: + + def __init__( + self, + *, + token: Token | None = None, + secret: str = "", + ) -> None: + pass + + token: Token | None + secret: str + + +_DESC = file_desc( + b'\n\x1fmetalstack/admin/v2/token.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1dmetalstack/api/v2/token.proto"N\n\x17TokenServiceListRequest\x123\n\x05query\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.TokenQueryR\x05query"L\n\x18TokenServiceListResponse\x120\n\x06tokens\x18\x01 \x03(\x0b2\x18.metalstack.api.v2.TokenR\x06tokens"Z\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1f\n\x04user\x18\x02 \x01(\tR\x04userB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01"\x1c\n\x1aTokenServiceRevokeResponse"\xaa\x01\n\x19TokenServiceCreateRequest\x12$\n\x04user\x18\x01 \x01(\tH\x00R\x04userB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12^\n\x14token_create_request\x18\x02 \x01(\x0b2,.metalstack.api.v2.TokenServiceCreateRequestR\x12tokenCreateRequestB\x07\n\x05_user"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret2\xeb\x02\n\x0cTokenService\x12o\n\x04List\x12,.metalstack.admin.v2.TokenServiceListRequest\x1a-.metalstack.admin.v2.TokenServiceListResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12t\n\x06Revoke\x12..metalstack.admin.v2.TokenServiceRevokeRequest\x1a/.metalstack.admin.v2.TokenServiceRevokeResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Create\x12..metalstack.admin.v2.TokenServiceCreateRequest\x1a/.metalstack.admin.v2.TokenServiceCreateResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01B\xce\x01\n\x17com.metalstack.admin.v2B\nTokenProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + token_pb.desc(), + ], + { + "TokenServiceListRequest": TokenServiceListRequest, + "TokenServiceListResponse": TokenServiceListResponse, + "TokenServiceRevokeRequest": TokenServiceRevokeRequest, + "TokenServiceRevokeResponse": TokenServiceRevokeResponse, + "TokenServiceCreateRequest": TokenServiceCreateRequest, + "TokenServiceCreateResponse": TokenServiceCreateResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/token.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/token_pb2.py b/python/metalstack/admin/v2/token_pb2.py deleted file mode 100644 index 431b542e..00000000 --- a/python/metalstack/admin/v2/token_pb2.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/token.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/token.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import token_pb2 as metalstack_dot_api_dot_v2_dot_token__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/admin/v2/token.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1dmetalstack/api/v2/token.proto\"N\n\x17TokenServiceListRequest\x12\x33\n\x05query\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.TokenQueryR\x05query\"L\n\x18TokenServiceListResponse\x12\x30\n\x06tokens\x18\x01 \x03(\x0b\x32\x18.metalstack.api.v2.TokenR\x06tokens\"Z\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1f\n\x04user\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01R\x04user\"\x1c\n\x1aTokenServiceRevokeResponse\"\xaa\x01\n\x19TokenServiceCreateRequest\x12$\n\x04user\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01H\x00R\x04user\x88\x01\x01\x12^\n\x14token_create_request\x18\x02 \x01(\x0b\x32,.metalstack.api.v2.TokenServiceCreateRequestR\x12tokenCreateRequestB\x07\n\x05_user\"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret2\xeb\x02\n\x0cTokenService\x12o\n\x04List\x12,.metalstack.admin.v2.TokenServiceListRequest\x1a-.metalstack.admin.v2.TokenServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12t\n\x06Revoke\x12..metalstack.admin.v2.TokenServiceRevokeRequest\x1a/.metalstack.admin.v2.TokenServiceRevokeResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06\x43reate\x12..metalstack.admin.v2.TokenServiceCreateRequest\x1a/.metalstack.admin.v2.TokenServiceCreateResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x42\xce\x01\n\x17\x63om.metalstack.admin.v2B\nTokenProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.token_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\nTokenProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['user']._loaded_options = None - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['user']._serialized_options = b'\272H\010r\006\370\263\256\261\002\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['user']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['user']._serialized_options = b'\272H\010r\006\370\263\256\261\002\001' - _globals['_TOKENSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['List']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Revoke']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Revoke']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Create']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_TOKENSERVICELISTREQUEST']._serialized_start=190 - _globals['_TOKENSERVICELISTREQUEST']._serialized_end=268 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_start=270 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_end=346 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_start=348 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_end=438 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_start=440 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_end=468 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_start=471 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_end=641 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_start=643 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_end=743 - _globals['_TOKENSERVICE']._serialized_start=746 - _globals['_TOKENSERVICE']._serialized_end=1109 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/token_pb2.pyi b/python/metalstack/admin/v2/token_pb2.pyi deleted file mode 100644 index 5902b33a..00000000 --- a/python/metalstack/admin/v2/token_pb2.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import token_pb2 as _token_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class TokenServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: _token_pb2.TokenQuery - def __init__(self, query: _Optional[_Union[_token_pb2.TokenQuery, _Mapping]] = ...) -> None: ... - -class TokenServiceListResponse(_message.Message): - __slots__ = ("tokens",) - TOKENS_FIELD_NUMBER: _ClassVar[int] - tokens: _containers.RepeatedCompositeFieldContainer[_token_pb2.Token] - def __init__(self, tokens: _Optional[_Iterable[_Union[_token_pb2.Token, _Mapping]]] = ...) -> None: ... - -class TokenServiceRevokeRequest(_message.Message): - __slots__ = ("uuid", "user") - UUID_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - uuid: str - user: str - def __init__(self, uuid: _Optional[str] = ..., user: _Optional[str] = ...) -> None: ... - -class TokenServiceRevokeResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TokenServiceCreateRequest(_message.Message): - __slots__ = ("user", "token_create_request") - USER_FIELD_NUMBER: _ClassVar[int] - TOKEN_CREATE_REQUEST_FIELD_NUMBER: _ClassVar[int] - user: str - token_create_request: _token_pb2.TokenServiceCreateRequest - def __init__(self, user: _Optional[str] = ..., token_create_request: _Optional[_Union[_token_pb2.TokenServiceCreateRequest, _Mapping]] = ...) -> None: ... - -class TokenServiceCreateResponse(_message.Message): - __slots__ = ("token", "secret") - TOKEN_FIELD_NUMBER: _ClassVar[int] - SECRET_FIELD_NUMBER: _ClassVar[int] - token: _token_pb2.Token - secret: str - def __init__(self, token: _Optional[_Union[_token_pb2.Token, _Mapping]] = ..., secret: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/admin/v2/vpn_connect.py b/python/metalstack/admin/v2/vpn_connect.py index 8e1523b0..a25dd9bc 100644 --- a/python/metalstack/admin/v2/vpn_connect.py +++ b/python/metalstack/admin/v2/vpn_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/admin/v2/vpn.proto +# Generated from metalstack/admin/v2/vpn.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.admin.v2.vpn_pb2 as metalstack_dot_admin_dot_v2_dot_vpn__pb2 + +from .vpn_pb import VPNServiceAuthKeyRequest, VPNServiceAuthKeyResponse, VPNServiceListNodesRequest, VPNServiceListNodesResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class VPNService(Protocol): - async def auth_key(self, request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def auth_key(self, request: VPNServiceAuthKeyRequest, ctx: RequestContext[VPNServiceAuthKeyRequest, VPNServiceAuthKeyResponse]) -> VPNServiceAuthKeyResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list_nodes(self, request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list_nodes(self, request: VPNServiceListNodesRequest, ctx: RequestContext[VPNServiceListNodesRequest, VPNServiceListNodesResponse]) -> VPNServiceListNodesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class VPNServiceASGIApplication(ConnectASGIApplication[VPNService]): - def __init__(self, service: VPNService | AsyncGenerator[VPNService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: VPNService | AsyncGenerator[VPNService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: VPNService | AsyncGenerator[VPNService], *, intercep method=MethodInfo( name="AuthKey", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse, + input=VPNServiceAuthKeyRequest, + output=VPNServiceAuthKeyResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.auth_key, @@ -44,8 +60,8 @@ def __init__(self, service: VPNService | AsyncGenerator[VPNService], *, intercep method=MethodInfo( name="ListNodes", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse, + input=VPNServiceListNodesRequest, + output=VPNServiceListNodesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list_nodes, @@ -66,18 +82,18 @@ def path(self) -> str: class VPNServiceClient(ConnectClient): async def auth_key( self, - request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, + request: VPNServiceAuthKeyRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse: + ) -> VPNServiceAuthKeyResponse: return await self.execute_unary( request=request, method=MethodInfo( name="AuthKey", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse, + input=VPNServiceAuthKeyRequest, + output=VPNServiceAuthKeyResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def auth_key( async def list_nodes( self, - request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, + request: VPNServiceListNodesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse: + ) -> VPNServiceListNodesResponse: return await self.execute_unary( request=request, method=MethodInfo( name="ListNodes", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse, + input=VPNServiceListNodesRequest, + output=VPNServiceListNodesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class VPNServiceSync(Protocol): - def auth_key(self, request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list_nodes(self, request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def auth_key(self, request: VPNServiceAuthKeyRequest, ctx: RequestContext[VPNServiceAuthKeyRequest, VPNServiceAuthKeyResponse]) -> VPNServiceAuthKeyResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list_nodes(self, request: VPNServiceListNodesRequest, ctx: RequestContext[VPNServiceListNodesRequest, VPNServiceListNodesResponse]) -> VPNServiceListNodesResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class VPNServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: VPNServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: VPNServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.admin.v2.VPNService/AuthKey": EndpointSync.unary( method=MethodInfo( name="AuthKey", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse, + input=VPNServiceAuthKeyRequest, + output=VPNServiceAuthKeyResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.auth_key, @@ -133,8 +153,8 @@ def __init__(self, service: VPNServiceSync, interceptors: Iterable[InterceptorSy method=MethodInfo( name="ListNodes", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse, + input=VPNServiceListNodesRequest, + output=VPNServiceListNodesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list_nodes, @@ -155,42 +175,39 @@ def path(self) -> str: class VPNServiceClientSync(ConnectClientSync): def auth_key( self, - request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, + request: VPNServiceAuthKeyRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse: + ) -> VPNServiceAuthKeyResponse: return self.execute_unary( request=request, method=MethodInfo( name="AuthKey", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceAuthKeyResponse, + input=VPNServiceAuthKeyRequest, + output=VPNServiceAuthKeyResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list_nodes( self, - request: metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, + request: VPNServiceListNodesRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse: + ) -> VPNServiceListNodesResponse: return self.execute_unary( request=request, method=MethodInfo( name="ListNodes", service_name="metalstack.admin.v2.VPNService", - input=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesRequest, - output=metalstack_dot_admin_dot_v2_dot_vpn__pb2.VPNServiceListNodesResponse, + input=VPNServiceListNodesRequest, + output=VPNServiceListNodesResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/admin/v2/vpn_pb.py b/python/metalstack/admin/v2/vpn_pb.py new file mode 100644 index 00000000..b1f4fe44 --- /dev/null +++ b/python/metalstack/admin/v2/vpn_pb.py @@ -0,0 +1,232 @@ +# Generated from metalstack/admin/v2/vpn.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, vpn_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from ...api.v2.vpn_pb import VPNNode + + +_VPNServiceAuthKeyRequestFields: TypeAlias = Literal["project", "ephemeral", "expires", "reason"] + +class VPNServiceAuthKeyRequest(Message[_VPNServiceAuthKeyRequestFields]): + """ + VPNServiceAuthKeyRequest is the request payload for generating a VPN authentication key. + + ```proto + message metalstack.admin.v2.VPNServiceAuthKeyRequest + ``` + + Attributes: + project: + Project for which a VPN authentication key should be generated + + ```proto + string project = 1; + ``` + ephemeral: + Ephemeral defines if the authentication key should be ephemeral + + ```proto + bool ephemeral = 2; + ``` + expires: + Expires defines the duration after which the authentication key expires + + ```proto + optional google.protobuf.Duration expires = 3; + ``` + reason: + Reason must be provided why access to the VPN is requested + Reason is only forwarded to an audit sink + + ```proto + string reason = 4; + ``` + """ + + __slots__ = ("project", "ephemeral", "expires", "reason") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + ephemeral: bool = False, + expires: Duration | None = None, + reason: str = "", + ) -> None: + pass + + project: str + ephemeral: bool + expires: Duration | None + reason: str + +_VPNServiceAuthKeyResponseFields: TypeAlias = Literal["address", "auth_key", "ephemeral", "expires_at", "created_at"] + +class VPNServiceAuthKeyResponse(Message[_VPNServiceAuthKeyResponseFields]): + """ + VPNServiceAuthKeyResponse is the response payload for generating a VPN authentication key. + + ```proto + message metalstack.admin.v2.VPNServiceAuthKeyResponse + ``` + + Attributes: + address: + Address is the address of the VPN control plane + + ```proto + string address = 1; + ``` + auth_key: + AuthKey is the key to connect to the VPN at the given address + This key can only be seen once + + ```proto + string auth_key = 2; + ``` + ephemeral: + Ephemeral defines if the authentication key should be ephemeral + + ```proto + bool ephemeral = 3; + ``` + expires_at: + ExpiresAt this key cannot be used after this timestamp + + ```proto + optional google.protobuf.Timestamp expires_at = 4; + ``` + created_at: + CreatedAt this key was created at this timestamp + + ```proto + optional google.protobuf.Timestamp created_at = 5; + ``` + """ + + __slots__ = ("address", "auth_key", "ephemeral", "expires_at", "created_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + address: str = "", + auth_key: str = "", + ephemeral: bool = False, + expires_at: Timestamp | None = None, + created_at: Timestamp | None = None, + ) -> None: + pass + + address: str + auth_key: str + ephemeral: bool + expires_at: Timestamp | None + created_at: Timestamp | None + +_VPNServiceListNodesRequestFields: TypeAlias = Literal["project"] + +class VPNServiceListNodesRequest(Message[_VPNServiceListNodesRequestFields]): + """ + VPNServiceListNodesRequest is the request payload for listing VPN nodes. + + ```proto + message metalstack.admin.v2.VPNServiceListNodesRequest + ``` + + Attributes: + project: + Project filters nodes by this project + + ```proto + optional string project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str | None = None, + ) -> None: + pass + + project: str + +_VPNServiceListNodesResponseFields: TypeAlias = Literal["nodes"] + +class VPNServiceListNodesResponse(Message[_VPNServiceListNodesResponseFields]): + """ + VPNServiceListNodesResponse is the response payload for listing VPN nodes. + + ```proto + message metalstack.admin.v2.VPNServiceListNodesResponse + ``` + + Attributes: + nodes: + Nodes connected to the VPN + + ```proto + repeated metalstack.api.v2.VPNNode nodes = 1; + ``` + """ + + __slots__ = ("nodes",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + nodes: list[VPNNode] | None = None, + ) -> None: + pass + + nodes: list[VPNNode] + + +_DESC = file_desc( + b'\n\x1dmetalstack/admin/v2/vpn.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1bmetalstack/api/v2/vpn.proto"\xb5\x01\n\x18VPNServiceAuthKeyRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1c\n\tephemeral\x18\x02 \x01(\x08R\tephemeral\x123\n\x07expires\x18\x03 \x01(\x0b2\x19.google.protobuf.DurationR\x07expires\x12"\n\x06reason\x18\x04 \x01(\tR\x06reasonB\n\xbaH\x07r\x05\x10\n\x18\x80\x04"\xe4\x01\n\x19VPNServiceAuthKeyResponse\x12\x18\n\x07address\x18\x01 \x01(\tR\x07address\x12\x19\n\x08auth_key\x18\x02 \x01(\tR\x07authKey\x12\x1c\n\tephemeral\x18\x03 \x01(\x08R\tephemeral\x129\n\nexpires_at\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampR\texpiresAt\x129\n\ncreated_at\x18\x05 \x01(\x0b2\x1a.google.protobuf.TimestampR\tcreatedAt"G\n\x1aVPNServiceListNodesRequest\x12\x1d\n\x07project\x18\x01 \x01(\tH\x00R\x07project\x88\x01\x01B\n\n\x08_project"O\n\x1bVPNServiceListNodesResponse\x120\n\x05nodes\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.VPNNodeR\x05nodes2\xfd\x01\n\nVPNService\x12s\n\x07AuthKey\x12-.metalstack.admin.v2.VPNServiceAuthKeyRequest\x1a..metalstack.admin.v2.VPNServiceAuthKeyResponse"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12z\n\tListNodes\x12/.metalstack.admin.v2.VPNServiceListNodesRequest\x1a0.metalstack.admin.v2.VPNServiceListNodesResponse"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xcc\x01\n\x17com.metalstack.admin.v2B\x08VpnProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + vpn_pb.desc(), + ], + { + "VPNServiceAuthKeyRequest": VPNServiceAuthKeyRequest, + "VPNServiceAuthKeyResponse": VPNServiceAuthKeyResponse, + "VPNServiceListNodesRequest": VPNServiceListNodesRequest, + "VPNServiceListNodesResponse": VPNServiceListNodesResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/admin/v2/vpn.proto`.""" + return _DESC diff --git a/python/metalstack/admin/v2/vpn_pb2.py b/python/metalstack/admin/v2/vpn_pb2.py deleted file mode 100644 index 6623a39d..00000000 --- a/python/metalstack/admin/v2/vpn_pb2.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/admin/v2/vpn.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/admin/v2/vpn.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import vpn_pb2 as metalstack_dot_api_dot_v2_dot_vpn__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/admin/v2/vpn.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1bmetalstack/api/v2/vpn.proto\"\xb5\x01\n\x18VPNServiceAuthKeyRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x1c\n\tephemeral\x18\x02 \x01(\x08R\tephemeral\x12\x33\n\x07\x65xpires\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationR\x07\x65xpires\x12\"\n\x06reason\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\n\x18\x80\x04R\x06reason\"\xe4\x01\n\x19VPNServiceAuthKeyResponse\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x19\n\x08\x61uth_key\x18\x02 \x01(\tR\x07\x61uthKey\x12\x1c\n\tephemeral\x18\x03 \x01(\x08R\tephemeral\x12\x39\n\nexpires_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAt\x12\x39\n\ncreated_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\"G\n\x1aVPNServiceListNodesRequest\x12\x1d\n\x07project\x18\x01 \x01(\tH\x00R\x07project\x88\x01\x01\x42\n\n\x08_project\"O\n\x1bVPNServiceListNodesResponse\x12\x30\n\x05nodes\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.VPNNodeR\x05nodes2\xfd\x01\n\nVPNService\x12s\n\x07\x41uthKey\x12-.metalstack.admin.v2.VPNServiceAuthKeyRequest\x1a..metalstack.admin.v2.VPNServiceAuthKeyResponse\"\t\xd2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12z\n\tListNodes\x12/.metalstack.admin.v2.VPNServiceListNodesRequest\x1a\x30.metalstack.admin.v2.VPNServiceListNodesResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xcc\x01\n\x17\x63om.metalstack.admin.v2B\x08VpnProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.admin.v2.vpn_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.admin.v2B\010VpnProtoP\001Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\242\002\003MAX\252\002\023Metalstack.Admin.V2\312\002\023Metalstack\\Admin\\V2\342\002\037Metalstack\\Admin\\V2\\GPBMetadata\352\002\025Metalstack::Admin::V2' - _globals['_VPNSERVICEAUTHKEYREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_VPNSERVICEAUTHKEYREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_VPNSERVICEAUTHKEYREQUEST'].fields_by_name['reason']._loaded_options = None - _globals['_VPNSERVICEAUTHKEYREQUEST'].fields_by_name['reason']._serialized_options = b'\272H\007r\005\020\n\030\200\004' - _globals['_VPNSERVICE'].methods_by_name['AuthKey']._loaded_options = None - _globals['_VPNSERVICE'].methods_by_name['AuthKey']._serialized_options = b'\322\363\030\001\001\340\363\030\001' - _globals['_VPNSERVICE'].methods_by_name['ListNodes']._loaded_options = None - _globals['_VPNSERVICE'].methods_by_name['ListNodes']._serialized_options = b'\322\363\030\002\001\002\340\363\030\001' - _globals['_VPNSERVICEAUTHKEYREQUEST']._serialized_start=210 - _globals['_VPNSERVICEAUTHKEYREQUEST']._serialized_end=391 - _globals['_VPNSERVICEAUTHKEYRESPONSE']._serialized_start=394 - _globals['_VPNSERVICEAUTHKEYRESPONSE']._serialized_end=622 - _globals['_VPNSERVICELISTNODESREQUEST']._serialized_start=624 - _globals['_VPNSERVICELISTNODESREQUEST']._serialized_end=695 - _globals['_VPNSERVICELISTNODESRESPONSE']._serialized_start=697 - _globals['_VPNSERVICELISTNODESRESPONSE']._serialized_end=776 - _globals['_VPNSERVICE']._serialized_start=779 - _globals['_VPNSERVICE']._serialized_end=1032 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/admin/v2/vpn_pb2.pyi b/python/metalstack/admin/v2/vpn_pb2.pyi deleted file mode 100644 index f7a4718f..00000000 --- a/python/metalstack/admin/v2/vpn_pb2.pyi +++ /dev/null @@ -1,52 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import vpn_pb2 as _vpn_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class VPNServiceAuthKeyRequest(_message.Message): - __slots__ = ("project", "ephemeral", "expires", "reason") - PROJECT_FIELD_NUMBER: _ClassVar[int] - EPHEMERAL_FIELD_NUMBER: _ClassVar[int] - EXPIRES_FIELD_NUMBER: _ClassVar[int] - REASON_FIELD_NUMBER: _ClassVar[int] - project: str - ephemeral: bool - expires: _duration_pb2.Duration - reason: str - def __init__(self, project: _Optional[str] = ..., ephemeral: _Optional[bool] = ..., expires: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., reason: _Optional[str] = ...) -> None: ... - -class VPNServiceAuthKeyResponse(_message.Message): - __slots__ = ("address", "auth_key", "ephemeral", "expires_at", "created_at") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - AUTH_KEY_FIELD_NUMBER: _ClassVar[int] - EPHEMERAL_FIELD_NUMBER: _ClassVar[int] - EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - address: str - auth_key: str - ephemeral: bool - expires_at: _timestamp_pb2.Timestamp - created_at: _timestamp_pb2.Timestamp - def __init__(self, address: _Optional[str] = ..., auth_key: _Optional[str] = ..., ephemeral: _Optional[bool] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class VPNServiceListNodesRequest(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: str - def __init__(self, project: _Optional[str] = ...) -> None: ... - -class VPNServiceListNodesResponse(_message.Message): - __slots__ = ("nodes",) - NODES_FIELD_NUMBER: _ClassVar[int] - nodes: _containers.RepeatedCompositeFieldContainer[_vpn_pb2.VPNNode] - def __init__(self, nodes: _Optional[_Iterable[_Union[_vpn_pb2.VPNNode, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/api/__init__.py b/python/metalstack/api/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/api/__init__.py +++ b/python/metalstack/api/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/api/v2/__init__.py b/python/metalstack/api/v2/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/api/v2/__init__.py +++ b/python/metalstack/api/v2/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/api/v2/audit_connect.py b/python/metalstack/api/v2/audit_connect.py index 222da9aa..cc0d4056 100644 --- a/python/metalstack/api/v2/audit_connect.py +++ b/python/metalstack/api/v2/audit_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/audit.proto +# Generated from metalstack/api/v2/audit.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.audit_pb2 as metalstack_dot_api_dot_v2_dot_audit__pb2 + +from .audit_pb import AuditServiceGetRequest, AuditServiceGetResponse, AuditServiceListRequest, AuditServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class AuditService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: AuditServiceGetRequest, ctx: RequestContext[AuditServiceGetRequest, AuditServiceGetResponse]) -> AuditServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: AuditServiceListRequest, ctx: RequestContext[AuditServiceListRequest, AuditServiceListResponse]) -> AuditServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class AuditServiceASGIApplication(ConnectASGIApplication[AuditService]): - def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: AuditService | AsyncGenerator[AuditService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, inte method=MethodInfo( name="Get", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: AuditService | AsyncGenerator[AuditService], *, inte method=MethodInfo( name="List", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class AuditServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, + request: AuditServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse: + ) -> AuditServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, + request: AuditServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse: + ) -> AuditServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class AuditServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: AuditServiceGetRequest, ctx: RequestContext[AuditServiceGetRequest, AuditServiceGetResponse]) -> AuditServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: AuditServiceListRequest, ctx: RequestContext[AuditServiceListRequest, AuditServiceListResponse]) -> AuditServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class AuditServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: AuditServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: AuditServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.AuditService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: AuditServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="List", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class AuditServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, + request: AuditServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse: + ) -> AuditServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceGetResponse, + input=AuditServiceGetRequest, + output=AuditServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, + request: AuditServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse: + ) -> AuditServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.AuditService", - input=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_audit__pb2.AuditServiceListResponse, + input=AuditServiceListRequest, + output=AuditServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/audit_pb.py b/python/metalstack/api/v2/audit_pb.py new file mode 100644 index 00000000..ef5ca43e --- /dev/null +++ b/python/metalstack/api/v2/audit_pb.py @@ -0,0 +1,457 @@ +# Generated from metalstack/api/v2/audit.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from .common_pb import Meta + + +_AuditTraceFields: TypeAlias = Literal["uuid", "timestamp", "user", "tenant", "project", "method", "body", "source_ip", "result_code", "phase", "meta"] + +class AuditTrace(Message[_AuditTraceFields]): + """ + AuditTrace is an audit trace. + + ```proto + message metalstack.api.v2.AuditTrace + ``` + + Attributes: + uuid: + Uuid of the audit trace + + ```proto + string uuid = 1; + ``` + timestamp: + Timestamp is the timestamp when the request arrived at the API + + ```proto + optional google.protobuf.Timestamp timestamp = 2; + ``` + user: + User is the login user who called the API method + + ```proto + string user = 3; + ``` + tenant: + Tenant is the tenant targeted by the API call + + ```proto + string tenant = 4; + ``` + project: + Project is the project targeted by the API call + + ```proto + optional string project = 5; + ``` + method: + Method is the API method that was called + + ```proto + string method = 6; + ``` + body: + Body is the payload of the API call. In the request phase this contains the payload sent by the client, in the response phase it contains the payload returned by the API server + + ```proto + optional string body = 7; + ``` + source_ip: + SourceIP contains the source IP address of the API call + + ```proto + string source_ip = 8; + ``` + result_code: + ResultCode is a status code describing the result of the API call. It is set for traces in the response phase and contains official gRPC status codes + + ```proto + optional int32 result_code = 9; + ``` + phase: + Phase represents the phase of the audit trace + + ```proto + metalstack.api.v2.AuditPhase phase = 10; + ``` + meta: + Meta for this audit trace + + ```proto + optional metalstack.api.v2.Meta meta = 11; + ``` + """ + + __slots__ = ("uuid", "timestamp", "user", "tenant", "project", "method", "body", "source_ip", "result_code", "phase", "meta") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + timestamp: Timestamp | None = None, + user: str = "", + tenant: str = "", + project: str | None = None, + method: str = "", + body: str | None = None, + source_ip: str = "", + result_code: int | None = None, + phase: AuditPhase | None = None, + meta: Meta | None = None, + ) -> None: + pass + + uuid: str + timestamp: Timestamp | None + user: str + tenant: str + project: str + method: str + body: str + source_ip: str + result_code: int + phase: AuditPhase + meta: Meta | None + +_AuditQueryFields: TypeAlias = Literal["uuid", "from", "to", "user", "project", "method", "source_ip", "result_code", "body", "limit", "phase"] + +class AuditQuery(Message[_AuditQueryFields]): + """ + AuditQuery is the query for audit traces + + ```proto + message metalstack.api.v2.AuditQuery + ``` + + Attributes: + uuid: + Uuid of the audit trace + + ```proto + optional string uuid = 2; + ``` + from_: + From describes the start of the time window in which to list audit traces. Defaults to the last eight hours + + ```proto + optional google.protobuf.Timestamp from = 3; + ``` + to: + To describes the end of the time window in which to list audit traces. Defaults to the time the request was issued + + ```proto + optional google.protobuf.Timestamp to = 4; + ``` + user: + User is the user who called the api method + + ```proto + optional string user = 5; + ``` + project: + Project is the project targeted by the api call + + ```proto + optional string project = 6; + ``` + method: + Method is the api method that was called + + ```proto + optional string method = 7; + ``` + source_ip: + Source IP contains the ip address of the caller + + ```proto + optional string source_ip = 8; + ``` + result_code: + Result Code is a string describing the result of the api call + + ```proto + optional int32 result_code = 9; + ``` + body: + Body is a string providing text-search of the body field + + ```proto + optional string body = 10; + ``` + limit: + Limit is a number limiting the length of the response (min: 1, max: 1000, defaults to 200) + + ```proto + optional int32 limit = 11; + ``` + phase: + Phase specifies the audit phase + + ```proto + optional metalstack.api.v2.AuditPhase phase = 12; + ``` + """ + + __slots__ = ("uuid", "from_", "to", "user", "project", "method", "source_ip", "result_code", "body", "limit", "phase") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + from_: Timestamp | None = None, + to: Timestamp | None = None, + user: str | None = None, + project: str | None = None, + method: str | None = None, + source_ip: str | None = None, + result_code: int | None = None, + body: str | None = None, + limit: int | None = None, + phase: AuditPhase | None = None, + ) -> None: + pass + + uuid: str + from_: Timestamp | None + to: Timestamp | None + user: str + project: str + method: str + source_ip: str + result_code: int + body: str + limit: int + phase: AuditPhase + +_AuditServiceListRequestFields: TypeAlias = Literal["login", "query"] + +class AuditServiceListRequest(Message[_AuditServiceListRequestFields]): + """ + AuditServiceListRequest is the request payload for an audit list request + + ```proto + message metalstack.api.v2.AuditServiceListRequest + ``` + + Attributes: + login: + Login for this tenant + + ```proto + string login = 1; + ``` + query: + Query for audit traces + + ```proto + optional metalstack.api.v2.AuditQuery query = 2; + ``` + """ + + __slots__ = ("login", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + query: AuditQuery | None = None, + ) -> None: + pass + + login: str + query: AuditQuery | None + +_AuditServiceListResponseFields: TypeAlias = Literal["traces"] + +class AuditServiceListResponse(Message[_AuditServiceListResponseFields]): + """ + AuditServiceListResponse is the response payload of a audit list request + + ```proto + message metalstack.api.v2.AuditServiceListResponse + ``` + + Attributes: + traces: + Traces is a list of audit traces + + ```proto + repeated metalstack.api.v2.AuditTrace traces = 1; + ``` + """ + + __slots__ = ("traces",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + traces: list[AuditTrace] | None = None, + ) -> None: + pass + + traces: list[AuditTrace] + +_AuditServiceGetRequestFields: TypeAlias = Literal["login", "uuid", "phase"] + +class AuditServiceGetRequest(Message[_AuditServiceGetRequestFields]): + """ + AuditServiceGetRequest is the request payload of a audit get request + + ```proto + message metalstack.api.v2.AuditServiceGetRequest + ``` + + Attributes: + login: + Login for this tenant + + ```proto + string login = 1; + ``` + uuid: + Uuid of the audit trace + + ```proto + string uuid = 2; + ``` + phase: + Phase specifies the audit phase. Defaults to request + + ```proto + optional metalstack.api.v2.AuditPhase phase = 3; + ``` + """ + + __slots__ = ("login", "uuid", "phase") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + uuid: str = "", + phase: AuditPhase | None = None, + ) -> None: + pass + + login: str + uuid: str + phase: AuditPhase + +_AuditServiceGetResponseFields: TypeAlias = Literal["trace"] + +class AuditServiceGetResponse(Message[_AuditServiceGetResponseFields]): + """ + AuditServiceGetResponse is the response payload of a audit get request + + ```proto + message metalstack.api.v2.AuditServiceGetResponse + ``` + + Attributes: + trace: + Trace is the audit trace + + ```proto + optional metalstack.api.v2.AuditTrace trace = 1; + ``` + """ + + __slots__ = ("trace",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + trace: AuditTrace | None = None, + ) -> None: + pass + + trace: AuditTrace | None + +class AuditPhase(Enum): + """ + AuditPhase specifies the phase of an audit trace. + + ```proto + enum metalstack.api.v2.AuditPhase + ``` + + Attributes: + UNSPECIFIED: + AUDIT_PHASE_UNSPECIFIED is not specified + + ```proto + AUDIT_PHASE_UNSPECIFIED = 0 + ``` + REQUEST: + AUDIT_PHASE_REQUEST defines an audit trace in the request phase + + ```proto + AUDIT_PHASE_REQUEST = 1 + ``` + RESPONSE: + AUDIT_PHASE_RESPONSE defines an audit trace in the response phase + + ```proto + AUDIT_PHASE_RESPONSE = 2 + ``` + """ + + UNSPECIFIED = 0 + REQUEST = 1 + RESPONSE = 2 + + +_DESC = file_desc( + b'\n\x1dmetalstack/api/v2/audit.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xaa\x03\n\nAuditTrace\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x128\n\ttimestamp\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampR\ttimestamp\x12\x12\n\x04user\x18\x03 \x01(\tR\x04user\x12\x16\n\x06tenant\x18\x04 \x01(\tR\x06tenant\x12\x1d\n\x07project\x18\x05 \x01(\tH\x00R\x07project\x88\x01\x01\x12\x16\n\x06method\x18\x06 \x01(\tR\x06method\x12\x17\n\x04body\x18\x07 \x01(\tH\x01R\x04body\x88\x01\x01\x12\x1b\n\tsource_ip\x18\x08 \x01(\tR\x08sourceIp\x12$\n\x0bresult_code\x18\t \x01(\x05H\x02R\nresultCode\x88\x01\x01\x123\n\x05phase\x18\n \x01(\x0e2\x1d.metalstack.api.v2.AuditPhaseR\x05phase\x12+\n\x04meta\x18\x0b \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04metaB\n\n\x08_projectB\x07\n\x05_bodyB\x0e\n\x0c_result_code"\xeb\x04\n\nAuditQuery\x12!\n\x04uuid\x18\x02 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x123\n\x04from\x18\x03 \x01(\x0b2\x1a.google.protobuf.TimestampH\x01R\x04from\x88\x01\x01\x12/\n\x02to\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampH\x02R\x02to\x88\x01\x01\x12$\n\x04user\x18\x05 \x01(\tH\x03R\x04userB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x06 \x01(\tH\x04R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12\'\n\x06method\x18\x07 \x01(\tH\x05R\x06methodB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02\x88\x01\x01\x12)\n\tsource_ip\x18\x08 \x01(\tH\x06R\x08sourceIpB\x07\xbaH\x04r\x02p\x01\x88\x01\x01\x12-\n\x0bresult_code\x18\t \x01(\x05H\x07R\nresultCodeB\x07\xbaH\x04\x1a\x02(\x00\x88\x01\x01\x12#\n\x04body\x18\n \x01(\tH\x08R\x04bodyB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02\x88\x01\x01\x12%\n\x05limit\x18\x0b \x01(\x05H\tR\x05limitB\n\xbaH\x07\x1a\x05\x18\xe8\x07 \x00\x88\x01\x01\x12B\n\x05phase\x18\x0c \x01(\x0e2\x1d.metalstack.api.v2.AuditPhaseH\nR\x05phaseB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_fromB\x05\n\x03_toB\x07\n\x05_userB\n\n\x08_projectB\t\n\x07_methodB\x0c\n\n_source_ipB\x0e\n\x0c_result_codeB\x07\n\x05_bodyB\x08\n\x06_limitB\x08\n\x06_phase"q\n\x17AuditServiceListRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x123\n\x05query\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.AuditQueryR\x05query"Q\n\x18AuditServiceListResponse\x125\n\x06traces\x18\x01 \x03(\x0b2\x1d.metalstack.api.v2.AuditTraceR\x06traces"\xa7\x01\n\x16AuditServiceGetRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1c\n\x04uuid\x18\x02 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12B\n\x05phase\x18\x03 \x01(\x0e2\x1d.metalstack.api.v2.AuditPhaseH\x00R\x05phaseB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x08\n\x06_phase"N\n\x17AuditServiceGetResponse\x123\n\x05trace\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.AuditTraceR\x05trace*\\\n\nAuditPhase\x12\x1b\n\x17AUDIT_PHASE_UNSPECIFIED\x10\x00\x12\x17\n\x13AUDIT_PHASE_REQUEST\x10\x01\x12\x18\n\x14AUDIT_PHASE_RESPONSE\x10\x022\xe3\x01\n\x0cAuditService\x12g\n\x03Get\x12).metalstack.api.v2.AuditServiceGetRequest\x1a*.metalstack.api.v2.AuditServiceGetResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12j\n\x04List\x12*.metalstack.api.v2.AuditServiceListRequest\x1a+.metalstack.api.v2.AuditServiceListResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02B\xc0\x01\n\x15com.metalstack.api.v2B\nAuditProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "AuditTrace": AuditTrace, + "AuditQuery": AuditQuery, + "AuditServiceListRequest": AuditServiceListRequest, + "AuditServiceListResponse": AuditServiceListResponse, + "AuditServiceGetRequest": AuditServiceGetRequest, + "AuditServiceGetResponse": AuditServiceGetResponse, + "AuditPhase": AuditPhase, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/audit.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/audit_pb2.py b/python/metalstack/api/v2/audit_pb2.py deleted file mode 100644 index f841767b..00000000 --- a/python/metalstack/api/v2/audit_pb2.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/audit.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/audit.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/api/v2/audit.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xaa\x03\n\nAuditTrace\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x38\n\ttimestamp\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\ttimestamp\x12\x12\n\x04user\x18\x03 \x01(\tR\x04user\x12\x16\n\x06tenant\x18\x04 \x01(\tR\x06tenant\x12\x1d\n\x07project\x18\x05 \x01(\tH\x00R\x07project\x88\x01\x01\x12\x16\n\x06method\x18\x06 \x01(\tR\x06method\x12\x17\n\x04\x62ody\x18\x07 \x01(\tH\x01R\x04\x62ody\x88\x01\x01\x12\x1b\n\tsource_ip\x18\x08 \x01(\tR\x08sourceIp\x12$\n\x0bresult_code\x18\t \x01(\x05H\x02R\nresultCode\x88\x01\x01\x12\x33\n\x05phase\x18\n \x01(\x0e\x32\x1d.metalstack.api.v2.AuditPhaseR\x05phase\x12+\n\x04meta\x18\x0b \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04metaB\n\n\x08_projectB\x07\n\x05_bodyB\x0e\n\x0c_result_code\"\xeb\x04\n\nAuditQuery\x12!\n\x04uuid\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12\x33\n\x04\x66rom\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x04\x66rom\x88\x01\x01\x12/\n\x02to\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\x02to\x88\x01\x01\x12$\n\x04user\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04user\x88\x01\x01\x12\'\n\x07project\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\x07project\x88\x01\x01\x12\'\n\x06method\x18\x07 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02H\x05R\x06method\x88\x01\x01\x12)\n\tsource_ip\x18\x08 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x06R\x08sourceIp\x88\x01\x01\x12-\n\x0bresult_code\x18\t \x01(\x05\x42\x07\xbaH\x04\x1a\x02(\x00H\x07R\nresultCode\x88\x01\x01\x12#\n\x04\x62ody\x18\n \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x02H\x08R\x04\x62ody\x88\x01\x01\x12%\n\x05limit\x18\x0b \x01(\x05\x42\n\xbaH\x07\x1a\x05\x18\xe8\x07 \x00H\tR\x05limit\x88\x01\x01\x12\x42\n\x05phase\x18\x0c \x01(\x0e\x32\x1d.metalstack.api.v2.AuditPhaseB\x08\xbaH\x05\x82\x01\x02\x10\x01H\nR\x05phase\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_fromB\x05\n\x03_toB\x07\n\x05_userB\n\n\x08_projectB\t\n\x07_methodB\x0c\n\n_source_ipB\x0e\n\x0c_result_codeB\x07\n\x05_bodyB\x08\n\x06_limitB\x08\n\x06_phase\"q\n\x17\x41uditServiceListRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05login\x12\x33\n\x05query\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.AuditQueryR\x05query\"Q\n\x18\x41uditServiceListResponse\x12\x35\n\x06traces\x18\x01 \x03(\x0b\x32\x1d.metalstack.api.v2.AuditTraceR\x06traces\"\xa7\x01\n\x16\x41uditServiceGetRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05login\x12\x1c\n\x04uuid\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x42\n\x05phase\x18\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.AuditPhaseB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x05phase\x88\x01\x01\x42\x08\n\x06_phase\"N\n\x17\x41uditServiceGetResponse\x12\x33\n\x05trace\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.AuditTraceR\x05trace*\\\n\nAuditPhase\x12\x1b\n\x17\x41UDIT_PHASE_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41UDIT_PHASE_REQUEST\x10\x01\x12\x18\n\x14\x41UDIT_PHASE_RESPONSE\x10\x02\x32\xe3\x01\n\x0c\x41uditService\x12g\n\x03Get\x12).metalstack.api.v2.AuditServiceGetRequest\x1a*.metalstack.api.v2.AuditServiceGetResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12j\n\x04List\x12*.metalstack.api.v2.AuditServiceListRequest\x1a+.metalstack.api.v2.AuditServiceListResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02\x42\xc0\x01\n\x15\x63om.metalstack.api.v2B\nAuditProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.audit_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\nAuditProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_AUDITTRACE'].fields_by_name['uuid']._loaded_options = None - _globals['_AUDITTRACE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_AUDITQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_AUDITQUERY'].fields_by_name['user']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['user']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_AUDITQUERY'].fields_by_name['project']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_AUDITQUERY'].fields_by_name['method']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['method']._serialized_options = b'\272H\007r\005\020\002\030\200\002' - _globals['_AUDITQUERY'].fields_by_name['source_ip']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['source_ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_AUDITQUERY'].fields_by_name['result_code']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['result_code']._serialized_options = b'\272H\004\032\002(\000' - _globals['_AUDITQUERY'].fields_by_name['body']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['body']._serialized_options = b'\272H\007r\005\020\002\030\200\002' - _globals['_AUDITQUERY'].fields_by_name['limit']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['limit']._serialized_options = b'\272H\007\032\005\030\350\007 \000' - _globals['_AUDITQUERY'].fields_by_name['phase']._loaded_options = None - _globals['_AUDITQUERY'].fields_by_name['phase']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_AUDITSERVICELISTREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_AUDITSERVICELISTREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['phase']._loaded_options = None - _globals['_AUDITSERVICEGETREQUEST'].fields_by_name['phase']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_AUDITSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_AUDITSERVICE'].methods_by_name['Get']._serialized_options = b'\302\363\030\001\001\340\363\030\002' - _globals['_AUDITSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_AUDITSERVICE'].methods_by_name['List']._serialized_options = b'\302\363\030\001\001\340\363\030\002' - _globals['_AUDITPHASE']._serialized_start=1687 - _globals['_AUDITPHASE']._serialized_end=1779 - _globals['_AUDITTRACE']._serialized_start=189 - _globals['_AUDITTRACE']._serialized_end=615 - _globals['_AUDITQUERY']._serialized_start=618 - _globals['_AUDITQUERY']._serialized_end=1237 - _globals['_AUDITSERVICELISTREQUEST']._serialized_start=1239 - _globals['_AUDITSERVICELISTREQUEST']._serialized_end=1352 - _globals['_AUDITSERVICELISTRESPONSE']._serialized_start=1354 - _globals['_AUDITSERVICELISTRESPONSE']._serialized_end=1435 - _globals['_AUDITSERVICEGETREQUEST']._serialized_start=1438 - _globals['_AUDITSERVICEGETREQUEST']._serialized_end=1605 - _globals['_AUDITSERVICEGETRESPONSE']._serialized_start=1607 - _globals['_AUDITSERVICEGETRESPONSE']._serialized_end=1685 - _globals['_AUDITSERVICE']._serialized_start=1782 - _globals['_AUDITSERVICE']._serialized_end=2009 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/audit_pb2.pyi b/python/metalstack/api/v2/audit_pb2.pyi deleted file mode 100644 index 13398cfa..00000000 --- a/python/metalstack/api/v2/audit_pb2.pyi +++ /dev/null @@ -1,104 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class AuditPhase(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - AUDIT_PHASE_UNSPECIFIED: _ClassVar[AuditPhase] - AUDIT_PHASE_REQUEST: _ClassVar[AuditPhase] - AUDIT_PHASE_RESPONSE: _ClassVar[AuditPhase] -AUDIT_PHASE_UNSPECIFIED: AuditPhase -AUDIT_PHASE_REQUEST: AuditPhase -AUDIT_PHASE_RESPONSE: AuditPhase - -class AuditTrace(_message.Message): - __slots__ = ("uuid", "timestamp", "user", "tenant", "project", "method", "body", "source_ip", "result_code", "phase", "meta") - UUID_FIELD_NUMBER: _ClassVar[int] - TIMESTAMP_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - TENANT_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - METHOD_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - SOURCE_IP_FIELD_NUMBER: _ClassVar[int] - RESULT_CODE_FIELD_NUMBER: _ClassVar[int] - PHASE_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - uuid: str - timestamp: _timestamp_pb2.Timestamp - user: str - tenant: str - project: str - method: str - body: str - source_ip: str - result_code: int - phase: AuditPhase - meta: _common_pb2.Meta - def __init__(self, uuid: _Optional[str] = ..., timestamp: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., user: _Optional[str] = ..., tenant: _Optional[str] = ..., project: _Optional[str] = ..., method: _Optional[str] = ..., body: _Optional[str] = ..., source_ip: _Optional[str] = ..., result_code: _Optional[int] = ..., phase: _Optional[_Union[AuditPhase, str]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ...) -> None: ... - -class AuditQuery(_message.Message): - __slots__ = ("uuid", "to", "user", "project", "method", "source_ip", "result_code", "body", "limit", "phase") - UUID_FIELD_NUMBER: _ClassVar[int] - FROM_FIELD_NUMBER: _ClassVar[int] - TO_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - METHOD_FIELD_NUMBER: _ClassVar[int] - SOURCE_IP_FIELD_NUMBER: _ClassVar[int] - RESULT_CODE_FIELD_NUMBER: _ClassVar[int] - BODY_FIELD_NUMBER: _ClassVar[int] - LIMIT_FIELD_NUMBER: _ClassVar[int] - PHASE_FIELD_NUMBER: _ClassVar[int] - uuid: str - to: _timestamp_pb2.Timestamp - user: str - project: str - method: str - source_ip: str - result_code: int - body: str - limit: int - phase: AuditPhase - def __init__(self, uuid: _Optional[str] = ..., to: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., user: _Optional[str] = ..., project: _Optional[str] = ..., method: _Optional[str] = ..., source_ip: _Optional[str] = ..., result_code: _Optional[int] = ..., body: _Optional[str] = ..., limit: _Optional[int] = ..., phase: _Optional[_Union[AuditPhase, str]] = ..., **kwargs) -> None: ... - -class AuditServiceListRequest(_message.Message): - __slots__ = ("login", "query") - LOGIN_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - login: str - query: AuditQuery - def __init__(self, login: _Optional[str] = ..., query: _Optional[_Union[AuditQuery, _Mapping]] = ...) -> None: ... - -class AuditServiceListResponse(_message.Message): - __slots__ = ("traces",) - TRACES_FIELD_NUMBER: _ClassVar[int] - traces: _containers.RepeatedCompositeFieldContainer[AuditTrace] - def __init__(self, traces: _Optional[_Iterable[_Union[AuditTrace, _Mapping]]] = ...) -> None: ... - -class AuditServiceGetRequest(_message.Message): - __slots__ = ("login", "uuid", "phase") - LOGIN_FIELD_NUMBER: _ClassVar[int] - UUID_FIELD_NUMBER: _ClassVar[int] - PHASE_FIELD_NUMBER: _ClassVar[int] - login: str - uuid: str - phase: AuditPhase - def __init__(self, login: _Optional[str] = ..., uuid: _Optional[str] = ..., phase: _Optional[_Union[AuditPhase, str]] = ...) -> None: ... - -class AuditServiceGetResponse(_message.Message): - __slots__ = ("trace",) - TRACE_FIELD_NUMBER: _ClassVar[int] - trace: AuditTrace - def __init__(self, trace: _Optional[_Union[AuditTrace, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/common_pb.py b/python/metalstack/api/v2/common_pb.py new file mode 100644 index 00000000..a19465fa --- /dev/null +++ b/python/metalstack/api/v2/common_pb.py @@ -0,0 +1,676 @@ +# Generated from metalstack/api/v2/common.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Final, Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Extension, Message +from protobuf._codegen import file_desc +from protobuf.wkt import EnumValueOptions, MethodOptions, descriptor_pb, timestamp_pb + +from . import predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile, Oneof + from protobuf.wkt import Timestamp + + +_PagingFields: TypeAlias = Literal["page", "count"] + +class Paging(Message[_PagingFields]): + """ + Paging defines paging for methods with a lot of results + + ```proto + message metalstack.api.v2.Paging + ``` + + Attributes: + page: + Page is used for pagination, if unset only the first page is returned, + the list response contains then the page number for the next page. + + ```proto + optional uint64 page = 1; + ``` + count: + Count is the number of results returned per page, if not given server side defaults apply + + ```proto + optional uint64 count = 2; + ``` + """ + + __slots__ = ("page", "count") + + if TYPE_CHECKING: + + def __init__( + self, + *, + page: int | None = None, + count: int | None = None, + ) -> None: + pass + + page: int + count: int + +_LabelsFields: TypeAlias = Literal["labels"] + +class Labels(Message[_LabelsFields]): + """ + Labels define additional information to a entity + + ```proto + message metalstack.api.v2.Labels + ``` + + Attributes: + labels: + Labels consists labels + + ```proto + map labels = 1; + ``` + """ + + __slots__ = ("labels",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + labels: dict[str, str] | None = None, + ) -> None: + pass + + labels: dict[str, str] + +_MetaFields: TypeAlias = Literal["labels", "created_at", "updated_at", "generation", "deletion_task_id"] + +class Meta(Message[_MetaFields]): + """ + Meta of a message + + ```proto + message metalstack.api.v2.Meta + ``` + + Attributes: + labels: + Tags on this entity + + ```proto + optional metalstack.api.v2.Labels labels = 1; + ``` + created_at: + CreatedAt is the date when this entity was created + + ```proto + optional google.protobuf.Timestamp created_at = 2; + ``` + updated_at: + UpdatedAt is the date when this entity was updated + must be part of the update request to ensure optimistic locking + + ```proto + optional google.protobuf.Timestamp updated_at = 3; + ``` + generation: + Generation identifies how often this entity was modified since creation. + + ```proto + uint64 generation = 4; + ``` + deletion_task_id: + DeletionTaskID is an optional id that is set to the meta after triggering the deletion. + This can be used by admins to track the deletion progress if necessary. + + ```proto + optional string deletion_task_id = 5; + ``` + """ + + __slots__ = ("labels", "created_at", "updated_at", "generation", "deletion_task_id") + + if TYPE_CHECKING: + + def __init__( + self, + *, + labels: Labels | None = None, + created_at: Timestamp | None = None, + updated_at: Timestamp | None = None, + generation: int = 0, + deletion_task_id: str | None = None, + ) -> None: + pass + + labels: Labels | None + created_at: Timestamp | None + updated_at: Timestamp | None + generation: int + deletion_task_id: str + +_UpdateLabelsFields: TypeAlias = Literal["replace", "patch"] + +class UpdateLabels(Message[_UpdateLabelsFields]): + """ + UpdateLabels is a message to update labels + + ```proto + message metalstack.api.v2.UpdateLabels + ``` + + Attributes: + strategy: + Strategy defines the label update strategy + + ```proto + oneof strategy + ``` + """ + + __slots__ = ("strategy",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + strategy: Oneof[Literal["replace"], Labels] | Oneof[Literal["patch"], LabelsPatch] | None = None, + ) -> None: + pass + + strategy: Oneof[Literal["replace"], Labels] | Oneof[Literal["patch"], LabelsPatch] | None + +_LabelsPatchFields: TypeAlias = Literal["update", "remove"] + +class LabelsPatch(Message[_LabelsPatchFields]): + """ + LabelsPatch adds, updates or remove given labels without modifying others + + ```proto + message metalstack.api.v2.LabelsPatch + ``` + + Attributes: + update: + Update labels. New ones will be added, existing ones overwritten + + ```proto + optional metalstack.api.v2.Labels update = 1; + ``` + remove: + Remove labels by key + + ```proto + repeated string remove = 2; + ``` + """ + + __slots__ = ("update", "remove") + + if TYPE_CHECKING: + + def __init__( + self, + *, + update: Labels | None = None, + remove: list[str] | None = None, + ) -> None: + pass + + update: Labels | None + remove: list[str] + +_UpdateMetaFields: TypeAlias = Literal["updated_at", "locking_strategy"] + +class UpdateMeta(Message[_UpdateMetaFields]): + """ + UpdateMeta must be provided with every UpdateRequest to define how optimistic locking should be handled + + ```proto + message metalstack.api.v2.UpdateMeta + ``` + + Attributes: + updated_at: + UpdatedAt is the date when this entity was updated + must be part of the update request to ensure optimistic locking + + ```proto + optional google.protobuf.Timestamp updated_at = 1; + ``` + locking_strategy: + LockingStrategy to be used for this update request + + ```proto + metalstack.api.v2.OptimisticLockingStrategy locking_strategy = 2; + ``` + """ + + __slots__ = ("updated_at", "locking_strategy") + + if TYPE_CHECKING: + + def __init__( + self, + *, + updated_at: Timestamp | None = None, + locking_strategy: OptimisticLockingStrategy | None = None, + ) -> None: + pass + + updated_at: Timestamp | None + locking_strategy: OptimisticLockingStrategy + +class TenantRole(Enum): + """ + TenantRole specifies what role a logged in user needs to call this tenant scoped service + + ```proto + enum metalstack.api.v2.TenantRole + ``` + + Attributes: + UNSPECIFIED: + TENANT_ROLE_UNSPECIFIED is not specified + + ```proto + TENANT_ROLE_UNSPECIFIED = 0 + ``` + OWNER: + TENANT_ROLE_OWNER the logged in user needs at least owner role to call this method + + ```proto + TENANT_ROLE_OWNER = 1 + ``` + EDITOR: + TENANT_ROLE_EDITOR the logged in user needs at least editor role to call this method + + ```proto + TENANT_ROLE_EDITOR = 2 + ``` + VIEWER: + TENANT_ROLE_VIEWER the logged in user needs at least viewer role to call this method + + ```proto + TENANT_ROLE_VIEWER = 3 + ``` + GUEST: + TENANT_ROLE_GUEST the logged in user needs at least guest role to call this method + The guest role is assumed by users who are invited to a tenant's project without them + having a direct membership within the tenant. + + ```proto + TENANT_ROLE_GUEST = 4 + ``` + """ + + UNSPECIFIED = 0 + OWNER = 1 + EDITOR = 2 + VIEWER = 3 + GUEST = 4 + +class ProjectRole(Enum): + """ + ProjectRole specifies what role a logged in user needs to call this project scoped service + + ```proto + enum metalstack.api.v2.ProjectRole + ``` + + Attributes: + UNSPECIFIED: + PROJECT_ROLE_UNSPECIFIED is not specified + + ```proto + PROJECT_ROLE_UNSPECIFIED = 0 + ``` + OWNER: + PROJECT_ROLE_OWNER the logged in user needs at least owner role to call this method + + ```proto + PROJECT_ROLE_OWNER = 1 + ``` + EDITOR: + PROJECT_ROLE_EDITOR the logged in user needs at least editor role to call this method + + ```proto + PROJECT_ROLE_EDITOR = 2 + ``` + VIEWER: + PROJECT_ROLE_VIEWER the logged in user needs at least viewer role to call this method + + ```proto + PROJECT_ROLE_VIEWER = 3 + ``` + """ + + UNSPECIFIED = 0 + OWNER = 1 + EDITOR = 2 + VIEWER = 3 + +class AdminRole(Enum): + """ + AdminRole specifies what role a logged in user needs to call this admin service + + ```proto + enum metalstack.api.v2.AdminRole + ``` + + Attributes: + UNSPECIFIED: + ADMIN_ROLE_UNSPECIFIED is not specified + + ```proto + ADMIN_ROLE_UNSPECIFIED = 0 + ``` + EDITOR: + ADMIN_ROLE_EDITOR the logged in user needs at least editor role to call this method + + ```proto + ADMIN_ROLE_EDITOR = 1 + ``` + VIEWER: + ADMIN_ROLE_VIEWER the logged in user needs at least viewer role to call this method + + ```proto + ADMIN_ROLE_VIEWER = 2 + ``` + """ + + UNSPECIFIED = 0 + EDITOR = 1 + VIEWER = 2 + +class InfraRole(Enum): + """ + InfraRole specifies what role a microservice needs to call this infra service + + ```proto + enum metalstack.api.v2.InfraRole + ``` + + Attributes: + UNSPECIFIED: + INFRA_ROLE_UNSPECIFIED is not specified + + ```proto + INFRA_ROLE_UNSPECIFIED = 0 + ``` + EDITOR: + INFRA_ROLE_EDITOR a microservice needs at least editor role to call this method + + ```proto + INFRA_ROLE_EDITOR = 1 + ``` + VIEWER: + INFRA_ROLE_VIEWER a microservice needs at least viewer role to call this method + + ```proto + INFRA_ROLE_VIEWER = 2 + ``` + """ + + UNSPECIFIED = 0 + EDITOR = 1 + VIEWER = 2 + +class MachineRole(Enum): + """ + MachineRole specifies what role a microservice needs to call this machine service + + ```proto + enum metalstack.api.v2.MachineRole + ``` + + Attributes: + UNSPECIFIED: + MACHINE_ROLE_UNSPECIFIED is not specified + + ```proto + MACHINE_ROLE_UNSPECIFIED = 0 + ``` + EDITOR: + MACHINE_ROLE_EDITOR a microservice needs at least editor role to call this method + + ```proto + MACHINE_ROLE_EDITOR = 1 + ``` + VIEWER: + MACHINE_ROLE_VIEWER a microservice needs at least viewer role to call this method + + ```proto + MACHINE_ROLE_VIEWER = 2 + ``` + """ + + UNSPECIFIED = 0 + EDITOR = 1 + VIEWER = 2 + +class Visibility(Enum): + """ + Visibility of a method + + ```proto + enum metalstack.api.v2.Visibility + ``` + + Attributes: + UNSPECIFIED: + VISIBILITY_UNSPECIFIED is not defined + + ```proto + VISIBILITY_UNSPECIFIED = 0 + ``` + PUBLIC: + VISIBILITY_PUBLIC specifies that this service is accessible without authentication + + ```proto + VISIBILITY_PUBLIC = 1 + ``` + SELF: + VISIBILITY_SELF restricts calls to the authenticated user only + + ```proto + VISIBILITY_SELF = 2 + ``` + """ + + UNSPECIFIED = 0 + PUBLIC = 1 + SELF = 2 + +class Auditing(Enum): + """ + Auditing option specified per service method + by default all service methods are included + add the auditing option if you want to exclude a method in auditing + + ```proto + enum metalstack.api.v2.Auditing + ``` + + Attributes: + UNSPECIFIED: + AUDITING_UNSPECIFIED is not specified + + ```proto + AUDITING_UNSPECIFIED = 0 + ``` + INCLUDED: + AUDITING_INCLUDED if a method is annotated with this, all calls are audited + + ```proto + AUDITING_INCLUDED = 1 + ``` + EXCLUDED: + AUDITING_EXCLUDED if a method is annotated with this, no calls are audited + + ```proto + AUDITING_EXCLUDED = 2 + ``` + """ + + UNSPECIFIED = 0 + INCLUDED = 1 + EXCLUDED = 2 + +class OptimisticLockingStrategy(Enum): + """ + OptimisticLockingStrategy defines how optimistic locking should be handled. + It defaults to client side, which requires the UpdatedAt timestamp to be provided + + ```proto + enum metalstack.api.v2.OptimisticLockingStrategy + ``` + + Attributes: + UNSPECIFIED: + OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED same as client side + + ```proto + OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED = 0 + ``` + CLIENT: + OPTIMISTIC_LOCKING_STRATEGY_CLIENT requires UpdatedAt to be specified + + ```proto + OPTIMISTIC_LOCKING_STRATEGY_CLIENT = 1 + ``` + SERVER: + OPTIMISTIC_LOCKING_STRATEGY_SERVER allows to omit UpdatedAt + and fetches the most recent entity before updating with the given values with the update request + + ```proto + OPTIMISTIC_LOCKING_STRATEGY_SERVER = 2 + ``` + """ + + UNSPECIFIED = 0 + CLIENT = 1 + SERVER = 2 + +ext_tenant_roles: Final[Extension[MethodOptions, list[TenantRole]]] = Extension() +""" +TenantRoles are used to define the tenant role a logged in user must provide to call this method + +```proto +extend google.protobuf.MethodOptions { repeated metalstack.api.v2.TenantRole tenant_roles = 51000 [packed = true, json_name = "[metalstack.api.v2.tenant_roles]"] } +``` +""" + +ext_project_roles: Final[Extension[MethodOptions, list[ProjectRole]]] = Extension() +""" +ProjectRoles are used to define the project role a logged in user must provide to call this method + +```proto +extend google.protobuf.MethodOptions { repeated metalstack.api.v2.ProjectRole project_roles = 51001 [packed = true, json_name = "[metalstack.api.v2.project_roles]"] } +``` +""" + +ext_admin_roles: Final[Extension[MethodOptions, list[AdminRole]]] = Extension() +""" +AdminRoles are used to define the admin role a logged in user must provide to call this method + +```proto +extend google.protobuf.MethodOptions { repeated metalstack.api.v2.AdminRole admin_roles = 51002 [packed = true, json_name = "[metalstack.api.v2.admin_roles]"] } +``` +""" + +ext_visibility: Final[Extension[MethodOptions, Visibility]] = Extension() +""" +Visibility defines the visibility of this method, this is used to have public or self visible methods + +```proto +extend google.protobuf.MethodOptions { optional metalstack.api.v2.Visibility visibility = 51003 [json_name = "[metalstack.api.v2.visibility]"] } +``` +""" + +ext_auditing: Final[Extension[MethodOptions, Auditing]] = Extension() +""" +Auditing defines if calls to this method should be audited or not + +```proto +extend google.protobuf.MethodOptions { optional metalstack.api.v2.Auditing auditing = 51004 [json_name = "[metalstack.api.v2.auditing]"] } +``` +""" + +ext_infra_roles: Final[Extension[MethodOptions, list[InfraRole]]] = Extension() +""" +InfraRoles are used to define the infra role a microservice must provide to call this method + +```proto +extend google.protobuf.MethodOptions { repeated metalstack.api.v2.InfraRole infra_roles = 51005 [packed = true, json_name = "[metalstack.api.v2.infra_roles]"] } +``` +""" + +ext_machine_roles: Final[Extension[MethodOptions, list[MachineRole]]] = Extension() +""" +MachineRole are used to define which machine role a microservice must provide to call this method + +```proto +extend google.protobuf.MethodOptions { repeated metalstack.api.v2.MachineRole machine_roles = 51006 [packed = true, json_name = "[metalstack.api.v2.machine_roles]"] } +``` +""" + +ext_enum_string_value: Final[Extension[EnumValueOptions, str]] = Extension() +""" +StringValue which can be set to a enum + +```proto +extend google.protobuf.EnumValueOptions { optional string enum_string_value = 52000 [json_name = "[metalstack.api.v2.enum_string_value]"] } +``` +""" + + +_DESC = file_desc( + b'\n\x1emetalstack/api/v2/common.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a(metalstack/api/v2/predefined_rules.proto"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05count\x18\x02 \x01(\x04H\x01R\x05count\x88\x01\x01B\x07\n\x05_pageB\x08\n\x06_count"\xa2\x01\n\x06Labels\x12]\n\x06labels\x18\x01 \x03(\x0b2%.metalstack.api.v2.Labels.LabelsEntryR\x06labelsB\x1e\xbaH\x1b\x9a\x01\x18\xb8\x95\xb8\xb1\x02\x01"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02\x1a9\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x028\x01"\xa3\x02\n\x04Meta\x126\n\x06labels\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x00R\x06labels\x88\x01\x01\x129\n\ncreated_at\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n\nupdated_at\x18\x03 \x01(\x0b2\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1e\n\ngeneration\x18\x04 \x01(\x04R\ngeneration\x12-\n\x10deletion_task_id\x18\x05 \x01(\tH\x01R\x0edeletionTaskId\x88\x01\x01B\t\n\x07_labelsB\x13\n\x11_deletion_task_id"\x90\x01\n\x0cUpdateLabels\x125\n\x07replace\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x00R\x07replace\x126\n\x05patch\x18\x02 \x01(\x0b2\x1e.metalstack.api.v2.LabelsPatchH\x00R\x05patchB\x11\n\x08strategy\x12\x05\xbaH\x02\x08\x01"l\n\x0bLabelsPatch\x121\n\x06update\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06update\x12*\n\x06remove\x18\x02 \x03(\tR\x06removeB\x12\xbaH\x0f\x92\x01\x0c\x18\x01"\x08r\x06\xf0\xb3\xae\xb1\x02\x01"\xaa\x01\n\nUpdateMeta\x129\n\nupdated_at\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampR\tupdatedAt\x12a\n\x10locking_strategy\x18\x02 \x01(\x0e2,.metalstack.api.v2.OptimisticLockingStrategyR\x0flockingStrategyB\x08\xbaH\x05\x82\x01\x02\x10\x01*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16ADMIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11ADMIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11ADMIN_ROLE_VIEWER\x10\x02*U\n\tInfraRole\x12\x1a\n\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n\x11INFRA_ROLE_VIEWER\x10\x02*]\n\x0bMachineRole\x12\x1c\n\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n\x13MACHINE_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x02*R\n\x08Auditing\x12\x18\n\x14AUDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11AUDITING_INCLUDED\x10\x01\x12\x15\n\x11AUDITING_EXCLUDED\x10\x02*\x98\x01\n\x19OptimisticLockingStrategy\x12+\n\'OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED\x10\x00\x12&\n"OPTIMISTIC_LOCKING_STRATEGY_CLIENT\x10\x01\x12&\n"OPTIMISTIC_LOCKING_STRATEGY_SERVER\x10\x02:b\n\x0ctenant_roles\x18\xb8\x8e\x03 \x03(\x0e2\x1d.metalstack.api.v2.TenantRole\x12\x1e.google.protobuf.MethodOptionsR\x0btenantRoles:e\n\rproject_roles\x18\xb9\x8e\x03 \x03(\x0e2\x1e.metalstack.api.v2.ProjectRole\x12\x1e.google.protobuf.MethodOptionsR\x0cprojectRoles:_\n\x0badmin_roles\x18\xba\x8e\x03 \x03(\x0e2\x1c.metalstack.api.v2.AdminRole\x12\x1e.google.protobuf.MethodOptionsR\nadminRoles:_\n\nvisibility\x18\xbb\x8e\x03 \x01(\x0e2\x1d.metalstack.api.v2.Visibility\x12\x1e.google.protobuf.MethodOptionsR\nvisibility:Y\n\x08auditing\x18\xbc\x8e\x03 \x01(\x0e2\x1b.metalstack.api.v2.Auditing\x12\x1e.google.protobuf.MethodOptionsR\x08auditing:_\n\x0binfra_roles\x18\xbd\x8e\x03 \x03(\x0e2\x1c.metalstack.api.v2.InfraRole\x12\x1e.google.protobuf.MethodOptionsR\ninfraRoles:e\n\rmachine_roles\x18\xbe\x8e\x03 \x03(\x0e2\x1e.metalstack.api.v2.MachineRole\x12\x1e.google.protobuf.MethodOptionsR\x0cmachineRoles:O\n\x11enum_string_value\x18\xa0\x96\x03 \x01(\t\x12!.google.protobuf.EnumValueOptionsR\x0fenumStringValueB\xc1\x01\n\x15com.metalstack.api.v2B\x0bCommonProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + descriptor_pb.desc(), + timestamp_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Paging": Paging, + "Labels": Labels, + "Meta": Meta, + "UpdateLabels": UpdateLabels, + "LabelsPatch": LabelsPatch, + "UpdateMeta": UpdateMeta, + "TenantRole": TenantRole, + "ProjectRole": ProjectRole, + "AdminRole": AdminRole, + "InfraRole": InfraRole, + "MachineRole": MachineRole, + "Visibility": Visibility, + "Auditing": Auditing, + "OptimisticLockingStrategy": OptimisticLockingStrategy, + "tenant_roles": ext_tenant_roles, + "project_roles": ext_project_roles, + "admin_roles": ext_admin_roles, + "visibility": ext_visibility, + "auditing": ext_auditing, + "infra_roles": ext_infra_roles, + "machine_roles": ext_machine_roles, + "enum_string_value": ext_enum_string_value, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/common.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/common_pb2.py b/python/metalstack/api/v2/common_pb2.py deleted file mode 100644 index cfedafb3..00000000 --- a/python/metalstack/api/v2/common_pb2.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/common.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/common.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/common.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a(metalstack/api/v2/predefined_rules.proto\"O\n\x06Paging\x12\x17\n\x04page\x18\x01 \x01(\x04H\x00R\x04page\x88\x01\x01\x12\x19\n\x05\x63ount\x18\x02 \x01(\x04H\x01R\x05\x63ount\x88\x01\x01\x42\x07\n\x05_pageB\x08\n\x06_count\"\xa2\x01\n\x06Labels\x12]\n\x06labels\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.Labels.LabelsEntryB\x1e\xbaH\x1b\x9a\x01\x18\"\x07r\x05\x10\x01\x18\x80\x02*\x07r\x05\x10\x00\x18\x80\x02\xb8\x95\xb8\xb1\x02\x01R\x06labels\x1a\x39\n\x0bLabelsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xa3\x02\n\x04Meta\x12\x36\n\x06labels\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x00R\x06labels\x88\x01\x01\x12\x39\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x1e\n\ngeneration\x18\x04 \x01(\x04R\ngeneration\x12-\n\x10\x64\x65letion_task_id\x18\x05 \x01(\tH\x01R\x0e\x64\x65letionTaskId\x88\x01\x01\x42\t\n\x07_labelsB\x13\n\x11_deletion_task_id\"\x90\x01\n\x0cUpdateLabels\x12\x35\n\x07replace\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x00R\x07replace\x12\x36\n\x05patch\x18\x02 \x01(\x0b\x32\x1e.metalstack.api.v2.LabelsPatchH\x00R\x05patchB\x11\n\x08strategy\x12\x05\xbaH\x02\x08\x01\"l\n\x0bLabelsPatch\x12\x31\n\x06update\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06update\x12*\n\x06remove\x18\x02 \x03(\tB\x12\xbaH\x0f\x92\x01\x0c\x18\x01\"\x08r\x06\xf0\xb3\xae\xb1\x02\x01R\x06remove\"\xaa\x01\n\nUpdateMeta\x12\x39\n\nupdated_at\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x61\n\x10locking_strategy\x18\x02 \x01(\x0e\x32,.metalstack.api.v2.OptimisticLockingStrategyB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0flockingStrategy*\x87\x01\n\nTenantRole\x12\x1b\n\x17TENANT_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11TENANT_ROLE_OWNER\x10\x01\x12\x16\n\x12TENANT_ROLE_EDITOR\x10\x02\x12\x16\n\x12TENANT_ROLE_VIEWER\x10\x03\x12\x15\n\x11TENANT_ROLE_GUEST\x10\x04*u\n\x0bProjectRole\x12\x1c\n\x18PROJECT_ROLE_UNSPECIFIED\x10\x00\x12\x16\n\x12PROJECT_ROLE_OWNER\x10\x01\x12\x17\n\x13PROJECT_ROLE_EDITOR\x10\x02\x12\x17\n\x13PROJECT_ROLE_VIEWER\x10\x03*U\n\tAdminRole\x12\x1a\n\x16\x41\x44MIN_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41\x44MIN_ROLE_EDITOR\x10\x01\x12\x15\n\x11\x41\x44MIN_ROLE_VIEWER\x10\x02*U\n\tInfraRole\x12\x1a\n\x16INFRA_ROLE_UNSPECIFIED\x10\x00\x12\x15\n\x11INFRA_ROLE_EDITOR\x10\x01\x12\x15\n\x11INFRA_ROLE_VIEWER\x10\x02*]\n\x0bMachineRole\x12\x1c\n\x18MACHINE_ROLE_UNSPECIFIED\x10\x00\x12\x17\n\x13MACHINE_ROLE_EDITOR\x10\x01\x12\x17\n\x13MACHINE_ROLE_VIEWER\x10\x02*T\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x15\n\x11VISIBILITY_PUBLIC\x10\x01\x12\x13\n\x0fVISIBILITY_SELF\x10\x02*R\n\x08\x41uditing\x12\x18\n\x14\x41UDITING_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UDITING_INCLUDED\x10\x01\x12\x15\n\x11\x41UDITING_EXCLUDED\x10\x02*\x98\x01\n\x19OptimisticLockingStrategy\x12+\n\'OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED\x10\x00\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_CLIENT\x10\x01\x12&\n\"OPTIMISTIC_LOCKING_STRATEGY_SERVER\x10\x02:b\n\x0ctenant_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb8\x8e\x03 \x03(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x0btenantRoles:e\n\rproject_roles\x12\x1e.google.protobuf.MethodOptions\x18\xb9\x8e\x03 \x03(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x0cprojectRoles:_\n\x0b\x61\x64min_roles\x12\x1e.google.protobuf.MethodOptions\x18\xba\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.AdminRoleR\nadminRoles:_\n\nvisibility\x12\x1e.google.protobuf.MethodOptions\x18\xbb\x8e\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.VisibilityR\nvisibility:Y\n\x08\x61uditing\x12\x1e.google.protobuf.MethodOptions\x18\xbc\x8e\x03 \x01(\x0e\x32\x1b.metalstack.api.v2.AuditingR\x08\x61uditing:_\n\x0binfra_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbd\x8e\x03 \x03(\x0e\x32\x1c.metalstack.api.v2.InfraRoleR\ninfraRoles:e\n\rmachine_roles\x12\x1e.google.protobuf.MethodOptions\x18\xbe\x8e\x03 \x03(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x0cmachineRoles:O\n\x11\x65num_string_value\x12!.google.protobuf.EnumValueOptions\x18\xa0\x96\x03 \x01(\tR\x0f\x65numStringValueB\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0b\x43ommonProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.common_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013CommonProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_LABELS_LABELSENTRY']._loaded_options = None - _globals['_LABELS_LABELSENTRY']._serialized_options = b'8\001' - _globals['_LABELS'].fields_by_name['labels']._loaded_options = None - _globals['_LABELS'].fields_by_name['labels']._serialized_options = b'\272H\033\232\001\030\"\007r\005\020\001\030\200\002*\007r\005\020\000\030\200\002\270\225\270\261\002\001' - _globals['_UPDATELABELS'].oneofs_by_name['strategy']._loaded_options = None - _globals['_UPDATELABELS'].oneofs_by_name['strategy']._serialized_options = b'\272H\002\010\001' - _globals['_LABELSPATCH'].fields_by_name['remove']._loaded_options = None - _globals['_LABELSPATCH'].fields_by_name['remove']._serialized_options = b'\272H\017\222\001\014\030\001\"\010r\006\360\263\256\261\002\001' - _globals['_UPDATEMETA'].fields_by_name['locking_strategy']._loaded_options = None - _globals['_UPDATEMETA'].fields_by_name['locking_strategy']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTROLE']._serialized_start=1162 - _globals['_TENANTROLE']._serialized_end=1297 - _globals['_PROJECTROLE']._serialized_start=1299 - _globals['_PROJECTROLE']._serialized_end=1416 - _globals['_ADMINROLE']._serialized_start=1418 - _globals['_ADMINROLE']._serialized_end=1503 - _globals['_INFRAROLE']._serialized_start=1505 - _globals['_INFRAROLE']._serialized_end=1590 - _globals['_MACHINEROLE']._serialized_start=1592 - _globals['_MACHINEROLE']._serialized_end=1685 - _globals['_VISIBILITY']._serialized_start=1687 - _globals['_VISIBILITY']._serialized_end=1771 - _globals['_AUDITING']._serialized_start=1773 - _globals['_AUDITING']._serialized_end=1855 - _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_start=1858 - _globals['_OPTIMISTICLOCKINGSTRATEGY']._serialized_end=2010 - _globals['_PAGING']._serialized_start=191 - _globals['_PAGING']._serialized_end=270 - _globals['_LABELS']._serialized_start=273 - _globals['_LABELS']._serialized_end=435 - _globals['_LABELS_LABELSENTRY']._serialized_start=378 - _globals['_LABELS_LABELSENTRY']._serialized_end=435 - _globals['_META']._serialized_start=438 - _globals['_META']._serialized_end=729 - _globals['_UPDATELABELS']._serialized_start=732 - _globals['_UPDATELABELS']._serialized_end=876 - _globals['_LABELSPATCH']._serialized_start=878 - _globals['_LABELSPATCH']._serialized_end=986 - _globals['_UPDATEMETA']._serialized_start=989 - _globals['_UPDATEMETA']._serialized_end=1159 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/common_pb2.pyi b/python/metalstack/api/v2/common_pb2.pyi deleted file mode 100644 index 23919830..00000000 --- a/python/metalstack/api/v2/common_pb2.pyi +++ /dev/null @@ -1,167 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import descriptor_pb2 as _descriptor_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class TenantRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TENANT_ROLE_UNSPECIFIED: _ClassVar[TenantRole] - TENANT_ROLE_OWNER: _ClassVar[TenantRole] - TENANT_ROLE_EDITOR: _ClassVar[TenantRole] - TENANT_ROLE_VIEWER: _ClassVar[TenantRole] - TENANT_ROLE_GUEST: _ClassVar[TenantRole] - -class ProjectRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - PROJECT_ROLE_UNSPECIFIED: _ClassVar[ProjectRole] - PROJECT_ROLE_OWNER: _ClassVar[ProjectRole] - PROJECT_ROLE_EDITOR: _ClassVar[ProjectRole] - PROJECT_ROLE_VIEWER: _ClassVar[ProjectRole] - -class AdminRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - ADMIN_ROLE_UNSPECIFIED: _ClassVar[AdminRole] - ADMIN_ROLE_EDITOR: _ClassVar[AdminRole] - ADMIN_ROLE_VIEWER: _ClassVar[AdminRole] - -class InfraRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INFRA_ROLE_UNSPECIFIED: _ClassVar[InfraRole] - INFRA_ROLE_EDITOR: _ClassVar[InfraRole] - INFRA_ROLE_VIEWER: _ClassVar[InfraRole] - -class MachineRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_ROLE_UNSPECIFIED: _ClassVar[MachineRole] - MACHINE_ROLE_EDITOR: _ClassVar[MachineRole] - MACHINE_ROLE_VIEWER: _ClassVar[MachineRole] - -class Visibility(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - VISIBILITY_UNSPECIFIED: _ClassVar[Visibility] - VISIBILITY_PUBLIC: _ClassVar[Visibility] - VISIBILITY_SELF: _ClassVar[Visibility] - -class Auditing(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - AUDITING_UNSPECIFIED: _ClassVar[Auditing] - AUDITING_INCLUDED: _ClassVar[Auditing] - AUDITING_EXCLUDED: _ClassVar[Auditing] - -class OptimisticLockingStrategy(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED: _ClassVar[OptimisticLockingStrategy] - OPTIMISTIC_LOCKING_STRATEGY_CLIENT: _ClassVar[OptimisticLockingStrategy] - OPTIMISTIC_LOCKING_STRATEGY_SERVER: _ClassVar[OptimisticLockingStrategy] -TENANT_ROLE_UNSPECIFIED: TenantRole -TENANT_ROLE_OWNER: TenantRole -TENANT_ROLE_EDITOR: TenantRole -TENANT_ROLE_VIEWER: TenantRole -TENANT_ROLE_GUEST: TenantRole -PROJECT_ROLE_UNSPECIFIED: ProjectRole -PROJECT_ROLE_OWNER: ProjectRole -PROJECT_ROLE_EDITOR: ProjectRole -PROJECT_ROLE_VIEWER: ProjectRole -ADMIN_ROLE_UNSPECIFIED: AdminRole -ADMIN_ROLE_EDITOR: AdminRole -ADMIN_ROLE_VIEWER: AdminRole -INFRA_ROLE_UNSPECIFIED: InfraRole -INFRA_ROLE_EDITOR: InfraRole -INFRA_ROLE_VIEWER: InfraRole -MACHINE_ROLE_UNSPECIFIED: MachineRole -MACHINE_ROLE_EDITOR: MachineRole -MACHINE_ROLE_VIEWER: MachineRole -VISIBILITY_UNSPECIFIED: Visibility -VISIBILITY_PUBLIC: Visibility -VISIBILITY_SELF: Visibility -AUDITING_UNSPECIFIED: Auditing -AUDITING_INCLUDED: Auditing -AUDITING_EXCLUDED: Auditing -OPTIMISTIC_LOCKING_STRATEGY_UNSPECIFIED: OptimisticLockingStrategy -OPTIMISTIC_LOCKING_STRATEGY_CLIENT: OptimisticLockingStrategy -OPTIMISTIC_LOCKING_STRATEGY_SERVER: OptimisticLockingStrategy -TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] -tenant_roles: _descriptor.FieldDescriptor -PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] -project_roles: _descriptor.FieldDescriptor -ADMIN_ROLES_FIELD_NUMBER: _ClassVar[int] -admin_roles: _descriptor.FieldDescriptor -VISIBILITY_FIELD_NUMBER: _ClassVar[int] -visibility: _descriptor.FieldDescriptor -AUDITING_FIELD_NUMBER: _ClassVar[int] -auditing: _descriptor.FieldDescriptor -INFRA_ROLES_FIELD_NUMBER: _ClassVar[int] -infra_roles: _descriptor.FieldDescriptor -MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] -machine_roles: _descriptor.FieldDescriptor -ENUM_STRING_VALUE_FIELD_NUMBER: _ClassVar[int] -enum_string_value: _descriptor.FieldDescriptor - -class Paging(_message.Message): - __slots__ = ("page", "count") - PAGE_FIELD_NUMBER: _ClassVar[int] - COUNT_FIELD_NUMBER: _ClassVar[int] - page: int - count: int - def __init__(self, page: _Optional[int] = ..., count: _Optional[int] = ...) -> None: ... - -class Labels(_message.Message): - __slots__ = ("labels",) - class LabelsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - LABELS_FIELD_NUMBER: _ClassVar[int] - labels: _containers.ScalarMap[str, str] - def __init__(self, labels: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class Meta(_message.Message): - __slots__ = ("labels", "created_at", "updated_at", "generation", "deletion_task_id") - LABELS_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - GENERATION_FIELD_NUMBER: _ClassVar[int] - DELETION_TASK_ID_FIELD_NUMBER: _ClassVar[int] - labels: Labels - created_at: _timestamp_pb2.Timestamp - updated_at: _timestamp_pb2.Timestamp - generation: int - deletion_task_id: str - def __init__(self, labels: _Optional[_Union[Labels, _Mapping]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., updated_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., generation: _Optional[int] = ..., deletion_task_id: _Optional[str] = ...) -> None: ... - -class UpdateLabels(_message.Message): - __slots__ = ("replace", "patch") - REPLACE_FIELD_NUMBER: _ClassVar[int] - PATCH_FIELD_NUMBER: _ClassVar[int] - replace: Labels - patch: LabelsPatch - def __init__(self, replace: _Optional[_Union[Labels, _Mapping]] = ..., patch: _Optional[_Union[LabelsPatch, _Mapping]] = ...) -> None: ... - -class LabelsPatch(_message.Message): - __slots__ = ("update", "remove") - UPDATE_FIELD_NUMBER: _ClassVar[int] - REMOVE_FIELD_NUMBER: _ClassVar[int] - update: Labels - remove: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, update: _Optional[_Union[Labels, _Mapping]] = ..., remove: _Optional[_Iterable[str]] = ...) -> None: ... - -class UpdateMeta(_message.Message): - __slots__ = ("updated_at", "locking_strategy") - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - LOCKING_STRATEGY_FIELD_NUMBER: _ClassVar[int] - updated_at: _timestamp_pb2.Timestamp - locking_strategy: OptimisticLockingStrategy - def __init__(self, updated_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., locking_strategy: _Optional[_Union[OptimisticLockingStrategy, str]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/component_pb.py b/python/metalstack/api/v2/component_pb.py new file mode 100644 index 00000000..5a0bcf47 --- /dev/null +++ b/python/metalstack/api/v2/component_pb.py @@ -0,0 +1,256 @@ +# Generated from metalstack/api/v2/component.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from . import common_pb, predefined_rules_pb, token_pb, version_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from .common_pb import Meta + from .token_pb import Token + from .version_pb import Version + + +_ComponentFields: TypeAlias = Literal["uuid", "type", "identifier", "started_at", "reported_at", "interval", "version", "token", "meta"] + +class Component(Message[_ComponentFields]): + """ + Component represents a microservice connected to our apiserver + + ```proto + message metalstack.api.v2.Component + ``` + + Attributes: + uuid: + UUID identifies this component event + + ```proto + string uuid = 1; + ``` + type: + Type defines which service is actually pinging + + ```proto + metalstack.api.v2.ComponentType type = 2; + ``` + identifier: + Identifier is a unique identifier of this service, e.g. if two instance are running, this might be the pod id. + micro_service and identifier guarantee uniqueness. + + ```proto + string identifier = 3; + ``` + started_at: + StartedAt is the timestamp this service was started + + ```proto + optional google.protobuf.Timestamp started_at = 4; + ``` + reported_at: + ReportedAt is the timestamp this service sent this ping. + + ```proto + optional google.protobuf.Timestamp reported_at = 5; + ``` + interval: + Interval at which the ping is scheduled. + + ```proto + optional google.protobuf.Duration interval = 6; + ``` + version: + Version of this service + + ```proto + optional metalstack.api.v2.Version version = 7; + ``` + token: + Token is the token which is actually used by this microservice. + + ```proto + optional metalstack.api.v2.Token token = 8; + ``` + meta: + Meta for this component + + ```proto + optional metalstack.api.v2.Meta meta = 9; + ``` + """ + + __slots__ = ("uuid", "type", "identifier", "started_at", "reported_at", "interval", "version", "token", "meta") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + type: ComponentType | None = None, + identifier: str = "", + started_at: Timestamp | None = None, + reported_at: Timestamp | None = None, + interval: Duration | None = None, + version: Version | None = None, + token: Token | None = None, + meta: Meta | None = None, + ) -> None: + pass + + uuid: str + type: ComponentType + identifier: str + started_at: Timestamp | None + reported_at: Timestamp | None + interval: Duration | None + version: Version | None + token: Token | None + meta: Meta | None + +_ComponentQueryFields: TypeAlias = Literal["uuid", "type", "identifier"] + +class ComponentQuery(Message[_ComponentQueryFields]): + """ + ComponentQuery to query components + + ```proto + message metalstack.api.v2.ComponentQuery + ``` + + Attributes: + uuid: + UUID identifies this component + + ```proto + optional string uuid = 1; + ``` + type: + Type defines which service is actually pinging + + ```proto + optional metalstack.api.v2.ComponentType type = 2; + ``` + identifier: + Identifier is a unique identifier of this service, e.g. if two instance are running, this might be the pod id. + micro_service and identifier guarantee uniqueness. + + ```proto + optional string identifier = 3; + ``` + """ + + __slots__ = ("uuid", "type", "identifier") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + type: ComponentType | None = None, + identifier: str | None = None, + ) -> None: + pass + + uuid: str + type: ComponentType + identifier: str + +class ComponentType(Enum): + """ + ComponentType defines which service is actually pinging + + ```proto + enum metalstack.api.v2.ComponentType + ``` + + Attributes: + UNSPECIFIED: + COMPONENT_TYPE_UNSPECIFIED is unspecified + + ```proto + COMPONENT_TYPE_UNSPECIFIED = 0 + ``` + PIXIECORE: + COMPONENT_TYPE_PIXIECORE is pixiecore + + ```proto + COMPONENT_TYPE_PIXIECORE = 1 + ``` + METAL_CORE: + COMPONENT_TYPE_METAL_CORE is metal-core + + ```proto + COMPONENT_TYPE_METAL_CORE = 2 + ``` + METAL_BMC: + COMPONENT_TYPE_METAL_BMC is metal-bmc + + ```proto + COMPONENT_TYPE_METAL_BMC = 3 + ``` + METAL_IMAGE_CACHE_SYNC: + COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC is metal-image-cache-sync + + ```proto + COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC = 4 + ``` + METAL_CONSOLE: + COMPONENT_TYPE_METAL_CONSOLE is metal-console + + ```proto + COMPONENT_TYPE_METAL_CONSOLE = 5 + ``` + METAL_METRICS_EXPORTER: + COMPONENT_TYPE_METAL_METRICS_EXPORTER is metal-metrics-exporter + + ```proto + COMPONENT_TYPE_METAL_METRICS_EXPORTER = 6 + ``` + """ + + UNSPECIFIED = 0 + PIXIECORE = 1 + METAL_CORE = 2 + METAL_BMC = 3 + METAL_IMAGE_CACHE_SYNC = 4 + METAL_CONSOLE = 5 + METAL_METRICS_EXPORTER = 6 + + +_DESC = file_desc( + b'\n!metalstack/api/v2/component.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1dmetalstack/api/v2/token.proto\x1a\x1fmetalstack/api/v2/version.proto"\xd8\x03\n\tComponent\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12>\n\x04type\x18\x02 \x01(\x0e2 .metalstack.api.v2.ComponentTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12+\n\nidentifier\x18\x03 \x01(\tR\nidentifierB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x129\n\nstarted_at\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampR\tstartedAt\x12;\n\x0breported_at\x18\x05 \x01(\x0b2\x1a.google.protobuf.TimestampR\nreportedAt\x125\n\x08interval\x18\x06 \x01(\x0b2\x19.google.protobuf.DurationR\x08interval\x124\n\x07version\x18\x07 \x01(\x0b2\x1a.metalstack.api.v2.VersionR\x07version\x12.\n\x05token\x18\x08 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token\x12+\n\x04meta\x18\t \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta"\xcb\x01\n\x0eComponentQuery\x12!\n\x04uuid\x18\x01 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12C\n\x04type\x18\x02 \x01(\x0e2 .metalstack.api.v2.ComponentTypeH\x01R\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x120\n\nidentifier\x18\x03 \x01(\tH\x02R\nidentifierB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_typeB\r\n\x0b_identifier*\x8c\x03\n\rComponentType\x12/\n\x1aCOMPONENT_TYPE_UNSPECIFIED\x10\x00\x1a\x0f\x82\xb2\x19\x0bunspecified\x12+\n\x18COMPONENT_TYPE_PIXIECORE\x10\x01\x1a\r\x82\xb2\x19\tpixiecore\x12-\n\x19COMPONENT_TYPE_METAL_CORE\x10\x02\x1a\x0e\x82\xb2\x19\nmetal-core\x12+\n\x18COMPONENT_TYPE_METAL_BMC\x10\x03\x1a\r\x82\xb2\x19\tmetal-bmc\x12E\n%COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC\x10\x04\x1a\x1a\x82\xb2\x19\x16metal-image-cache-sync\x123\n\x1cCOMPONENT_TYPE_METAL_CONSOLE\x10\x05\x1a\x11\x82\xb2\x19\rmetal-console\x12E\n%COMPONENT_TYPE_METAL_METRICS_EXPORTER\x10\x06\x1a\x1a\x82\xb2\x19\x16metal-metrics-exporterB\xc4\x01\n\x15com.metalstack.api.v2B\x0eComponentProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + token_pb.desc(), + version_pb.desc(), + ], + { + "Component": Component, + "ComponentQuery": ComponentQuery, + "ComponentType": ComponentType, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/component.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/component_pb2.py b/python/metalstack/api/v2/component_pb2.py deleted file mode 100644 index 41dc03d9..00000000 --- a/python/metalstack/api/v2/component_pb2.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/component.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/component.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import token_pb2 as metalstack_dot_api_dot_v2_dot_token__pb2 -from metalstack.api.v2 import version_pb2 as metalstack_dot_api_dot_v2_dot_version__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/api/v2/component.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1dmetalstack/api/v2/token.proto\x1a\x1fmetalstack/api/v2/version.proto\"\xd8\x03\n\tComponent\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x04type\x18\x02 \x01(\x0e\x32 .metalstack.api.v2.ComponentTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12+\n\nidentifier\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\nidentifier\x12\x39\n\nstarted_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tstartedAt\x12;\n\x0breported_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\nreportedAt\x12\x35\n\x08interval\x18\x06 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08interval\x12\x34\n\x07version\x18\x07 \x01(\x0b\x32\x1a.metalstack.api.v2.VersionR\x07version\x12.\n\x05token\x18\x08 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12+\n\x04meta\x18\t \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\"\xcb\x01\n\x0e\x43omponentQuery\x12!\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12\x43\n\x04type\x18\x02 \x01(\x0e\x32 .metalstack.api.v2.ComponentTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\x04type\x88\x01\x01\x12\x30\n\nidentifier\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x02R\nidentifier\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_typeB\r\n\x0b_identifier*\x8c\x03\n\rComponentType\x12/\n\x1a\x43OMPONENT_TYPE_UNSPECIFIED\x10\x00\x1a\x0f\x82\xb2\x19\x0bunspecified\x12+\n\x18\x43OMPONENT_TYPE_PIXIECORE\x10\x01\x1a\r\x82\xb2\x19\tpixiecore\x12-\n\x19\x43OMPONENT_TYPE_METAL_CORE\x10\x02\x1a\x0e\x82\xb2\x19\nmetal-core\x12+\n\x18\x43OMPONENT_TYPE_METAL_BMC\x10\x03\x1a\r\x82\xb2\x19\tmetal-bmc\x12\x45\n%COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC\x10\x04\x1a\x1a\x82\xb2\x19\x16metal-image-cache-sync\x12\x33\n\x1c\x43OMPONENT_TYPE_METAL_CONSOLE\x10\x05\x1a\x11\x82\xb2\x19\rmetal-console\x12\x45\n%COMPONENT_TYPE_METAL_METRICS_EXPORTER\x10\x06\x1a\x1a\x82\xb2\x19\x16metal-metrics-exporterB\xc4\x01\n\x15\x63om.metalstack.api.v2B\x0e\x43omponentProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.component_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\016ComponentProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_UNSPECIFIED"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_UNSPECIFIED"]._serialized_options = b'\202\262\031\013unspecified' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_PIXIECORE"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_PIXIECORE"]._serialized_options = b'\202\262\031\tpixiecore' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_CORE"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_CORE"]._serialized_options = b'\202\262\031\nmetal-core' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_BMC"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_BMC"]._serialized_options = b'\202\262\031\tmetal-bmc' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC"]._serialized_options = b'\202\262\031\026metal-image-cache-sync' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_CONSOLE"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_CONSOLE"]._serialized_options = b'\202\262\031\rmetal-console' - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_METRICS_EXPORTER"]._loaded_options = None - _globals['_COMPONENTTYPE'].values_by_name["COMPONENT_TYPE_METAL_METRICS_EXPORTER"]._serialized_options = b'\202\262\031\026metal-metrics-exporter' - _globals['_COMPONENT'].fields_by_name['uuid']._loaded_options = None - _globals['_COMPONENT'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_COMPONENT'].fields_by_name['type']._loaded_options = None - _globals['_COMPONENT'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_COMPONENT'].fields_by_name['identifier']._loaded_options = None - _globals['_COMPONENT'].fields_by_name['identifier']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_COMPONENTQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_COMPONENTQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_COMPONENTQUERY'].fields_by_name['type']._loaded_options = None - _globals['_COMPONENTQUERY'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_COMPONENTQUERY'].fields_by_name['identifier']._loaded_options = None - _globals['_COMPONENTQUERY'].fields_by_name['identifier']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_COMPONENTTYPE']._serialized_start=970 - _globals['_COMPONENTTYPE']._serialized_end=1366 - _globals['_COMPONENT']._serialized_start=289 - _globals['_COMPONENT']._serialized_end=761 - _globals['_COMPONENTQUERY']._serialized_start=764 - _globals['_COMPONENTQUERY']._serialized_end=967 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/component_pb2.pyi b/python/metalstack/api/v2/component_pb2.pyi deleted file mode 100644 index f6a593b5..00000000 --- a/python/metalstack/api/v2/component_pb2.pyi +++ /dev/null @@ -1,65 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import token_pb2 as _token_pb2 -from metalstack.api.v2 import version_pb2 as _version_pb2 -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ComponentType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - COMPONENT_TYPE_UNSPECIFIED: _ClassVar[ComponentType] - COMPONENT_TYPE_PIXIECORE: _ClassVar[ComponentType] - COMPONENT_TYPE_METAL_CORE: _ClassVar[ComponentType] - COMPONENT_TYPE_METAL_BMC: _ClassVar[ComponentType] - COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC: _ClassVar[ComponentType] - COMPONENT_TYPE_METAL_CONSOLE: _ClassVar[ComponentType] - COMPONENT_TYPE_METAL_METRICS_EXPORTER: _ClassVar[ComponentType] -COMPONENT_TYPE_UNSPECIFIED: ComponentType -COMPONENT_TYPE_PIXIECORE: ComponentType -COMPONENT_TYPE_METAL_CORE: ComponentType -COMPONENT_TYPE_METAL_BMC: ComponentType -COMPONENT_TYPE_METAL_IMAGE_CACHE_SYNC: ComponentType -COMPONENT_TYPE_METAL_CONSOLE: ComponentType -COMPONENT_TYPE_METAL_METRICS_EXPORTER: ComponentType - -class Component(_message.Message): - __slots__ = ("uuid", "type", "identifier", "started_at", "reported_at", "interval", "version", "token", "meta") - UUID_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - STARTED_AT_FIELD_NUMBER: _ClassVar[int] - REPORTED_AT_FIELD_NUMBER: _ClassVar[int] - INTERVAL_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - TOKEN_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - uuid: str - type: ComponentType - identifier: str - started_at: _timestamp_pb2.Timestamp - reported_at: _timestamp_pb2.Timestamp - interval: _duration_pb2.Duration - version: _version_pb2.Version - token: _token_pb2.Token - meta: _common_pb2.Meta - def __init__(self, uuid: _Optional[str] = ..., type: _Optional[_Union[ComponentType, str]] = ..., identifier: _Optional[str] = ..., started_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., reported_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., version: _Optional[_Union[_version_pb2.Version, _Mapping]] = ..., token: _Optional[_Union[_token_pb2.Token, _Mapping]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ...) -> None: ... - -class ComponentQuery(_message.Message): - __slots__ = ("uuid", "type", "identifier") - UUID_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - uuid: str - type: ComponentType - identifier: str - def __init__(self, uuid: _Optional[str] = ..., type: _Optional[_Union[ComponentType, str]] = ..., identifier: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/api/v2/filesystem_connect.py b/python/metalstack/api/v2/filesystem_connect.py index 1a5e5759..5c8809b6 100644 --- a/python/metalstack/api/v2/filesystem_connect.py +++ b/python/metalstack/api/v2/filesystem_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/filesystem.proto +# Generated from metalstack/api/v2/filesystem.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.filesystem_pb2 as metalstack_dot_api_dot_v2_dot_filesystem__pb2 + +from .filesystem_pb import FilesystemServiceGetRequest, FilesystemServiceGetResponse, FilesystemServiceListRequest, FilesystemServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class FilesystemService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: FilesystemServiceGetRequest, ctx: RequestContext[FilesystemServiceGetRequest, FilesystemServiceGetResponse]) -> FilesystemServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: FilesystemServiceListRequest, ctx: RequestContext[FilesystemServiceListRequest, FilesystemServiceListResponse]) -> FilesystemServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class FilesystemServiceASGIApplication(ConnectASGIApplication[FilesystemService]): - def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: FilesystemService | AsyncGenerator[FilesystemService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="Get", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse, + input=FilesystemServiceGetRequest, + output=FilesystemServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: FilesystemService | AsyncGenerator[FilesystemService method=MethodInfo( name="List", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse, + input=FilesystemServiceListRequest, + output=FilesystemServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class FilesystemServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, + request: FilesystemServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse: + ) -> FilesystemServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse, + input=FilesystemServiceGetRequest, + output=FilesystemServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, + request: FilesystemServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse: + ) -> FilesystemServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse, + input=FilesystemServiceListRequest, + output=FilesystemServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class FilesystemServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: FilesystemServiceGetRequest, ctx: RequestContext[FilesystemServiceGetRequest, FilesystemServiceGetResponse]) -> FilesystemServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: FilesystemServiceListRequest, ctx: RequestContext[FilesystemServiceListRequest, FilesystemServiceListResponse]) -> FilesystemServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class FilesystemServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: FilesystemServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.FilesystemService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse, + input=FilesystemServiceGetRequest, + output=FilesystemServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: FilesystemServiceSync, interceptors: Iterable[Interc method=MethodInfo( name="List", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse, + input=FilesystemServiceListRequest, + output=FilesystemServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class FilesystemServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, + request: FilesystemServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse: + ) -> FilesystemServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceGetResponse, + input=FilesystemServiceGetRequest, + output=FilesystemServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, + request: FilesystemServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse: + ) -> FilesystemServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.FilesystemService", - input=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_filesystem__pb2.FilesystemServiceListResponse, + input=FilesystemServiceListRequest, + output=FilesystemServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/filesystem_pb.py b/python/metalstack/api/v2/filesystem_pb.py new file mode 100644 index 00000000..38ee5063 --- /dev/null +++ b/python/metalstack/api/v2/filesystem_pb.py @@ -0,0 +1,864 @@ +# Generated from metalstack/api/v2/filesystem.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Meta + + +_FilesystemServiceGetRequestFields: TypeAlias = Literal["id"] + +class FilesystemServiceGetRequest(Message[_FilesystemServiceGetRequestFields]): + """ + FilesystemServiceGetRequest is the request payload for a filesystem get request + + ```proto + message metalstack.api.v2.FilesystemServiceGetRequest + ``` + + Attributes: + id: + ID of the filesystem to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_FilesystemServiceListRequestFields: TypeAlias = Literal["id"] + +class FilesystemServiceListRequest(Message[_FilesystemServiceListRequestFields]): + """ + FilesystemServiceListRequest is the request payload for a filesystem list request + + ```proto + message metalstack.api.v2.FilesystemServiceListRequest + ``` + + Attributes: + id: + ID of the filesystem to get + + ```proto + optional string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + ) -> None: + pass + + id: str + +_FilesystemServiceGetResponseFields: TypeAlias = Literal["filesystem_layout"] + +class FilesystemServiceGetResponse(Message[_FilesystemServiceGetResponseFields]): + """ + FilesystemServiceGetResponse is the response payload for a filesystem get request + + ```proto + message metalstack.api.v2.FilesystemServiceGetResponse + ``` + + Attributes: + filesystem_layout: + FilesystemLayout the filesystemlayout + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 1; + ``` + """ + + __slots__ = ("filesystem_layout",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layout: FilesystemLayout | None = None, + ) -> None: + pass + + filesystem_layout: FilesystemLayout | None + +_FilesystemServiceListResponseFields: TypeAlias = Literal["filesystem_layouts"] + +class FilesystemServiceListResponse(Message[_FilesystemServiceListResponseFields]): + """ + FilesystemServiceListResponse is the response payload for a filesystem list request + + ```proto + message metalstack.api.v2.FilesystemServiceListResponse + ``` + + Attributes: + filesystem_layouts: + FilesystemLayouts the filesystemlayouts + + ```proto + repeated metalstack.api.v2.FilesystemLayout filesystem_layouts = 1; + ``` + """ + + __slots__ = ("filesystem_layouts",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + filesystem_layouts: list[FilesystemLayout] | None = None, + ) -> None: + pass + + filesystem_layouts: list[FilesystemLayout] + +_FilesystemLayoutFields: TypeAlias = Literal["id", "meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints"] + +class FilesystemLayout(Message[_FilesystemLayoutFields]): + """ + FilesystemLayout + + ```proto + message metalstack.api.v2.FilesystemLayout + ``` + + Attributes: + id: + Id of this filesystemLayout + + ```proto + string id = 1; + ``` + meta: + Meta for this filesystemLayout + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this filesystemLayout + + ```proto + optional string name = 3; + ``` + description: + Description of this filesystemLayout + + ```proto + optional string description = 4; + ``` + filesystems: + Filesystems is a list of filesystems to create on a machine + + ```proto + repeated metalstack.api.v2.Filesystem filesystems = 5; + ``` + disks: + Disks list of disks that belong to this layout + + ```proto + repeated metalstack.api.v2.Disk disks = 6; + ``` + raid: + raid arrays to create + + ```proto + repeated metalstack.api.v2.Raid raid = 7; + ``` + volume_groups: + VolumeGroups list of volumegroups to create + + ```proto + repeated metalstack.api.v2.VolumeGroup volume_groups = 8; + ``` + logical_volumes: + LogicalVolumes list of logicalvolumes to create + + ```proto + repeated metalstack.api.v2.LogicalVolume logical_volumes = 9; + ``` + constraints: + Constraints which must match that this layout is taken, if sizes and images are empty these are develop layouts + + ```proto + optional metalstack.api.v2.FilesystemLayoutConstraints constraints = 10; + ``` + """ + + __slots__ = ("id", "meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + name: str | None = None, + description: str | None = None, + filesystems: list[Filesystem] | None = None, + disks: list[Disk] | None = None, + raid: list[Raid] | None = None, + volume_groups: list[VolumeGroup] | None = None, + logical_volumes: list[LogicalVolume] | None = None, + constraints: FilesystemLayoutConstraints | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + name: str + description: str + filesystems: list[Filesystem] + disks: list[Disk] + raid: list[Raid] + volume_groups: list[VolumeGroup] + logical_volumes: list[LogicalVolume] + constraints: FilesystemLayoutConstraints | None + +_FilesystemLayoutConstraintsFields: TypeAlias = Literal["sizes", "images"] + +class FilesystemLayoutConstraints(Message[_FilesystemLayoutConstraintsFields]): + """ + FilesystemLayoutConstraints + + ```proto + message metalstack.api.v2.FilesystemLayoutConstraints + ``` + + Attributes: + sizes: + Sizes list of sizes this layout applies to + this could either be a concrete size, or a asterisk to match all sizes + + ```proto + repeated string sizes = 1; + ``` + images: + Images list of images this layout applies to in the following form + key must be the first part of available images, e.g. the name of the image + value must be a semver match expression with the constraint and the version separated by space + this would match all debian images which are greater or equal 12.0 + "debian":">= 12.0" + + ```proto + map images = 2; + ``` + """ + + __slots__ = ("sizes", "images") + + if TYPE_CHECKING: + + def __init__( + self, + *, + sizes: list[str] | None = None, + images: dict[str, str] | None = None, + ) -> None: + pass + + sizes: list[str] + images: dict[str, str] + +_FilesystemFields: TypeAlias = Literal["device", "format", "name", "description", "path", "label", "mount_options", "create_options"] + +class Filesystem(Message[_FilesystemFields]): + """ + Filesystem + + ```proto + message metalstack.api.v2.Filesystem + ``` + + Attributes: + device: + Device the underlying device where this filesystem should be created + + ```proto + string device = 1; + ``` + format: + Format of the filesystem format + + ```proto + metalstack.api.v2.Format format = 2; + ``` + name: + Name of this filesystem + + ```proto + optional string name = 3; + ``` + description: + Description of this filesystem + + ```proto + optional string description = 4; + ``` + path: + Path the mountpoint where this filesystem should be mounted on + + ```proto + optional string path = 5; + ``` + label: + Label an optional label for this filesystem + + ```proto + optional string label = 6; + ``` + mount_options: + MountOptions the options to use to mount this filesystem + + ```proto + repeated string mount_options = 7; + ``` + create_options: + CreateOptions the options to use to create (mkfs) this filesystem + + ```proto + repeated string create_options = 8; + ``` + """ + + __slots__ = ("device", "format", "name", "description", "path", "label", "mount_options", "create_options") + + if TYPE_CHECKING: + + def __init__( + self, + *, + device: str = "", + format: Format | None = None, + name: str | None = None, + description: str | None = None, + path: str | None = None, + label: str | None = None, + mount_options: list[str] | None = None, + create_options: list[str] | None = None, + ) -> None: + pass + + device: str + format: Format + name: str + description: str + path: str + label: str + mount_options: list[str] + create_options: list[str] + +_DiskFields: TypeAlias = Literal["device", "partitions"] + +class Disk(Message[_DiskFields]): + """ + Disk + + ```proto + message metalstack.api.v2.Disk + ``` + + Attributes: + device: + Device the device to create the partitions + + ```proto + string device = 1; + ``` + partitions: + Partitions list of partitions to create on this disk + + ```proto + repeated metalstack.api.v2.DiskPartition partitions = 2; + ``` + """ + + __slots__ = ("device", "partitions") + + if TYPE_CHECKING: + + def __init__( + self, + *, + device: str = "", + partitions: list[DiskPartition] | None = None, + ) -> None: + pass + + device: str + partitions: list[DiskPartition] + +_RaidFields: TypeAlias = Literal["array_name", "devices", "level", "create_options", "spares"] + +class Raid(Message[_RaidFields]): + """ + Raid + + ```proto + message metalstack.api.v2.Raid + ``` + + Attributes: + array_name: + ArrayName the name of the resulting array device + + ```proto + string array_name = 1; + ``` + devices: + Devices list of devices to form the raid array from + + ```proto + repeated string devices = 2; + ``` + level: + Level raid level to create, should be 0 or 1 + + ```proto + metalstack.api.v2.RaidLevel level = 3; + ``` + create_options: + CreateOptions the options to use to create the raid array + + ```proto + repeated string create_options = 4; + ``` + spares: + Spares number of spares for the raid array + + ```proto + int32 spares = 5; + ``` + """ + + __slots__ = ("array_name", "devices", "level", "create_options", "spares") + + if TYPE_CHECKING: + + def __init__( + self, + *, + array_name: str = "", + devices: list[str] | None = None, + level: RaidLevel | None = None, + create_options: list[str] | None = None, + spares: int = 0, + ) -> None: + pass + + array_name: str + devices: list[str] + level: RaidLevel + create_options: list[str] + spares: int + +_DiskPartitionFields: TypeAlias = Literal["number", "label", "size", "gpt_type"] + +class DiskPartition(Message[_DiskPartitionFields]): + """ + DiskPartition + + ```proto + message metalstack.api.v2.DiskPartition + ``` + + Attributes: + number: + Number partition number, will be appended to partitionprefix to create the final devicename + + ```proto + uint32 number = 1; + ``` + label: + Label an optional label for this partition + + ```proto + optional string label = 2; + ``` + size: + Size in mebibytes (MiB) of this partition + + ```proto + uint64 size = 3; + ``` + gpt_type: + GPTType the gpt partition table type of this partition + + ```proto + optional metalstack.api.v2.GPTType gpt_type = 4; + ``` + """ + + __slots__ = ("number", "label", "size", "gpt_type") + + if TYPE_CHECKING: + + def __init__( + self, + *, + number: int = 0, + label: str | None = None, + size: int = 0, + gpt_type: GPTType | None = None, + ) -> None: + pass + + number: int + label: str + size: int + gpt_type: GPTType + +_VolumeGroupFields: TypeAlias = Literal["name", "devices", "tags"] + +class VolumeGroup(Message[_VolumeGroupFields]): + """ + VolumeGroup + + ```proto + message metalstack.api.v2.VolumeGroup + ``` + + Attributes: + name: + Name the name of the resulting volume group + + ```proto + string name = 1; + ``` + devices: + Devices list of devices to form the volume group from + + ```proto + repeated string devices = 2; + ``` + tags: + Tags list of tags to add to the volume group + + ```proto + repeated string tags = 3; + ``` + """ + + __slots__ = ("name", "devices", "tags") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + devices: list[str] | None = None, + tags: list[str] | None = None, + ) -> None: + pass + + name: str + devices: list[str] + tags: list[str] + +_LogicalVolumeFields: TypeAlias = Literal["name", "volume_group", "size", "lvm_type"] + +class LogicalVolume(Message[_LogicalVolumeFields]): + """ + LogicalVolume + + ```proto + message metalstack.api.v2.LogicalVolume + ``` + + Attributes: + name: + Name the name of the logical volume + + ```proto + string name = 1; + ``` + volume_group: + VolumeGroup the name of the volume group where to create the logical volume onto + + ```proto + string volume_group = 2; + ``` + size: + Size size in mebibytes (MiB) of this volume + + ```proto + uint64 size = 3; + ``` + lvm_type: + LVMType the type of this logical volume can be either linear|striped|raid1 + + ```proto + metalstack.api.v2.LVMType lvm_type = 4; + ``` + """ + + __slots__ = ("name", "volume_group", "size", "lvm_type") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + volume_group: str = "", + size: int = 0, + lvm_type: LVMType | None = None, + ) -> None: + pass + + name: str + volume_group: str + size: int + lvm_type: LVMType + +class LVMType(Enum): + """ + LVMType + + ```proto + enum metalstack.api.v2.LVMType + ``` + + Attributes: + UNSPECIFIED: + LVM_TYPE_UNSPECIFIED is not specified + + ```proto + LVM_TYPE_UNSPECIFIED = 0 + ``` + LINEAR: + LVM_TYPE_LINEAR append across all physical volumes + + ```proto + LVM_TYPE_LINEAR = 1 + ``` + STRIPED: + LVM_TYPE_STRIPED stripe across all physical volumes + + ```proto + LVM_TYPE_STRIPED = 2 + ``` + RAID1: + LVM_TYPE_RAID1 mirror with raid across all physical volumes + + ```proto + LVM_TYPE_RAID1 = 3 + ``` + """ + + UNSPECIFIED = 0 + LINEAR = 1 + STRIPED = 2 + RAID1 = 3 + +class Format(Enum): + """ + Format specifies the filesystem to use on a volume + + ```proto + enum metalstack.api.v2.Format + ``` + + Attributes: + UNSPECIFIED: + FORMAT_UNSPECIFIED + + ```proto + FORMAT_UNSPECIFIED = 0 + ``` + VFAT: + FORMAT_VFAT is used for the UEFI boot partition + + ```proto + FORMAT_VFAT = 1 + ``` + EXT3: + FORMAT_EXT3 is usually only used for /boot + + ```proto + FORMAT_EXT3 = 2 + ``` + EXT4: + FORMAT_EXT4 is the default fs + + ```proto + FORMAT_EXT4 = 3 + ``` + SWAP: + FORMAT_SWAP is for the swap partition + + ```proto + FORMAT_SWAP = 4 + ``` + TMPFS: + FORMAT_TMPFS is used for a memory filesystem typically /tmp + + ```proto + FORMAT_TMPFS = 5 + ``` + NONE: + FORMAT_NONE + + ```proto + FORMAT_NONE = 6 + ``` + """ + + UNSPECIFIED = 0 + VFAT = 1 + EXT3 = 2 + EXT4 = 3 + SWAP = 4 + TMPFS = 5 + NONE = 6 + +class GPTType(Enum): + """ + GPTType specifies the partition type in uefi systems + + ```proto + enum metalstack.api.v2.GPTType + ``` + + Attributes: + UNSPECIFIED: + GPT_TYPE_UNSPECIFIED is no specified + + ```proto + GPT_TYPE_UNSPECIFIED = 0 + ``` + BOOT: + GPT_TYPE_BOOT EFI Boot Partition + + ```proto + GPT_TYPE_BOOT = 1 + ``` + LINUX: + GPT_TYPE_LINUX Linux Partition + + ```proto + GPT_TYPE_LINUX = 2 + ``` + LINUX_RAID: + GPT_TYPE_LINUX_RAID Linux Raid Partition + + ```proto + GPT_TYPE_LINUX_RAID = 3 + ``` + LINUX_LVM: + GPT_TYPE_LINUX_LVM Linux LVM Partition + + ```proto + GPT_TYPE_LINUX_LVM = 4 + ``` + """ + + UNSPECIFIED = 0 + BOOT = 1 + LINUX = 2 + LINUX_RAID = 3 + LINUX_LVM = 4 + +class RaidLevel(Enum): + """ + RaidLevel defines howto mirror two or more block devices + + ```proto + enum metalstack.api.v2.RaidLevel + ``` + + Attributes: + UNSPECIFIED: + RAID_LEVEL_UNSPECIFIED is not specified + + ```proto + RAID_LEVEL_UNSPECIFIED = 0 + ``` + RAID_LEVEL_0: + RAID_LEVEL_0 is a stripe of two or more disks + + ```proto + RAID_LEVEL_0 = 1 + ``` + RAID_LEVEL_1: + RAID_LEVEL_1 is a mirror of two disks + + ```proto + RAID_LEVEL_1 = 2 + ``` + """ + + UNSPECIFIED = 0 + RAID_LEVEL_0 = 1 + RAID_LEVEL_1 = 2 + + +_DESC = file_desc( + b'\n"metalstack/api/v2/filesystem.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto":\n\x1bFilesystemServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"G\n\x1cFilesystemServiceListRequest\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01B\x05\n\x03_id"p\n\x1cFilesystemServiceGetResponse\x12P\n\x11filesystem_layout\x18\x01 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout"s\n\x1dFilesystemServiceListResponse\x12R\n\x12filesystem_layouts\x18\x01 \x03(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x11filesystemLayouts"\xce\x04\n\x10FilesystemLayout\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12?\n\x0bfilesystems\x18\x05 \x03(\x0b2\x1d.metalstack.api.v2.FilesystemR\x0bfilesystems\x12-\n\x05disks\x18\x06 \x03(\x0b2\x17.metalstack.api.v2.DiskR\x05disks\x12+\n\x04raid\x18\x07 \x03(\x0b2\x17.metalstack.api.v2.RaidR\x04raid\x12C\n\rvolume_groups\x18\x08 \x03(\x0b2\x1e.metalstack.api.v2.VolumeGroupR\x0cvolumeGroups\x12I\n\x0flogical_volumes\x18\t \x03(\x0b2 .metalstack.api.v2.LogicalVolumeR\x0elogicalVolumes\x12P\n\x0bconstraints\x18\n \x01(\x0b2..metalstack.api.v2.FilesystemLayoutConstraintsR\x0bconstraintsB\x07\n\x05_nameB\x0e\n\x0c_description"\xc2\x01\n\x1bFilesystemLayoutConstraints\x12\x14\n\x05sizes\x18\x01 \x03(\tR\x05sizes\x12R\n\x06images\x18\x02 \x03(\x0b2:.metalstack.api.v2.FilesystemLayoutConstraints.ImagesEntryR\x06images\x1a9\n\x0bImagesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x028\x01"\xc2\x03\n\nFilesystem\x12#\n\x06device\x18\x01 \x01(\tR\x06deviceB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12>\n\x06format\x18\x02 \x01(\x0e2\x19.metalstack.api.v2.FormatR\x06formatB\x0b\xbaH\x08\xc8\x01\x01\x82\x01\x02\x10\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12#\n\x04path\x18\x05 \x01(\tH\x02R\x04pathB\n\xbaH\x07r\x05\x10\x01\x18\x80 \x88\x01\x01\x12,\n\x05label\x18\x06 \x01(\tH\x03R\x05labelB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01\x88\x01\x01\x129\n\rmount_options\x18\x07 \x03(\tR\x0cmountOptionsB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01"\x08r\x06\x80\xb4\xae\xb1\x02\x01\x12;\n\x0ecreate_options\x18\x08 \x03(\tR\rcreateOptionsB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01"\x08r\x06\x80\xb4\xae\xb1\x02\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_pathB\x08\n\x06_label"s\n\x04Disk\x12)\n\x06device\x18\x01 \x01(\tR\x06deviceB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01\x12@\n\npartitions\x18\x02 \x03(\x0b2 .metalstack.api.v2.DiskPartitionR\npartitions"\x83\x02\n\x04Raid\x120\n\narray_name\x18\x01 \x01(\tR\tarrayNameB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01\x123\n\x07devices\x18\x02 \x03(\tR\x07devicesB\x19\xbaH\x16\x92\x01\x13\xd0\xa4\xb3\xb1\x02\x01\x10\x80\x01"\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12?\n\x05level\x18\x03 \x01(\x0e2\x1c.metalstack.api.v2.RaidLevelR\x05levelB\x0b\xbaH\x08\xc8\x01\x01\x82\x01\x02\x10\x01\x12;\n\x0ecreate_options\x18\x04 \x03(\tR\rcreateOptionsB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01"\x08r\x06\x80\xb4\xae\xb1\x02\x01\x12\x16\n\x06spares\x18\x05 \x01(\x05R\x06spares"\xc9\x01\n\rDiskPartition\x12\x16\n\x06number\x18\x01 \x01(\rR\x06number\x12,\n\x05label\x18\x02 \x01(\tH\x00R\x05labelB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\x12\n\x04size\x18\x03 \x01(\x04R\x04size\x12G\n\x08gpt_type\x18\x04 \x01(\x0e2\x1a.metalstack.api.v2.GPTTypeH\x01R\x07gptTypeB\x0b\xbaH\x08\xc8\x01\x01\x82\x01\x02\x10\x01\x88\x01\x01B\x08\n\x06_labelB\x0b\n\t_gpt_type"\x92\x01\n\x0bVolumeGroup\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x123\n\x07devices\x18\x02 \x03(\tR\x07devicesB\x19\xbaH\x16\x92\x01\x13\xd0\xa4\xb3\xb1\x02\x01\x10\x80\x01"\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x04tags\x18\x03 \x03(\tR\x04tagsB\x19\xbaH\x16\x92\x01\x13\xd0\xa4\xb3\xb1\x02\x01\x10\x80\x01"\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\xb5\x01\n\rLogicalVolume\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12.\n\x0cvolume_group\x18\x02 \x01(\tR\x0bvolumeGroupB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x12\n\x04size\x18\x03 \x01(\x04R\x04size\x12?\n\x08lvm_type\x18\x04 \x01(\x0e2\x1a.metalstack.api.v2.LVMTypeR\x07lvmTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01*\x86\x01\n\x07LVMType\x12\x18\n\x14LVM_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x0fLVM_TYPE_LINEAR\x10\x01\x1a\n\x82\xb2\x19\x06linear\x12!\n\x10LVM_TYPE_STRIPED\x10\x02\x1a\x0b\x82\xb2\x19\x07striped\x12\x1d\n\x0eLVM_TYPE_RAID1\x10\x03\x1a\t\x82\xb2\x19\x05raid1*\xc4\x01\n\x06Format\x12\x16\n\x12FORMAT_UNSPECIFIED\x10\x00\x12\x19\n\x0bFORMAT_VFAT\x10\x01\x1a\x08\x82\xb2\x19\x04vfat\x12\x19\n\x0bFORMAT_EXT3\x10\x02\x1a\x08\x82\xb2\x19\x04ext3\x12\x19\n\x0bFORMAT_EXT4\x10\x03\x1a\x08\x82\xb2\x19\x04ext4\x12\x19\n\x0bFORMAT_SWAP\x10\x04\x1a\x08\x82\xb2\x19\x04swap\x12\x1b\n\x0cFORMAT_TMPFS\x10\x05\x1a\t\x82\xb2\x19\x05tmpfs\x12\x19\n\x0bFORMAT_NONE\x10\x06\x1a\x08\x82\xb2\x19\x04none*\xa3\x01\n\x07GPTType\x12\x18\n\x14GPT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\rGPT_TYPE_BOOT\x10\x01\x1a\x08\x82\xb2\x19\x04ef00\x12\x1c\n\x0eGPT_TYPE_LINUX\x10\x02\x1a\x08\x82\xb2\x19\x048300\x12!\n\x13GPT_TYPE_LINUX_RAID\x10\x03\x1a\x08\x82\xb2\x19\x04fd00\x12 \n\x12GPT_TYPE_LINUX_LVM\x10\x04\x1a\x08\x82\xb2\x19\x048e00*Y\n\tRaidLevel\x12\x1a\n\x16RAID_LEVEL_UNSPECIFIED\x10\x00\x12\x17\n\x0cRAID_LEVEL_0\x10\x01\x1a\x05\x82\xb2\x19\x010\x12\x17\n\x0cRAID_LEVEL_1\x10\x02\x1a\x05\x82\xb2\x19\x0112\xfa\x01\n\x11FilesystemService\x12p\n\x03Get\x12..metalstack.api.v2.FilesystemServiceGetRequest\x1a/.metalstack.api.v2.FilesystemServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12/.metalstack.api.v2.FilesystemServiceListRequest\x1a0.metalstack.api.v2.FilesystemServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xc5\x01\n\x15com.metalstack.api.v2B\x0fFilesystemProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "FilesystemServiceGetRequest": FilesystemServiceGetRequest, + "FilesystemServiceListRequest": FilesystemServiceListRequest, + "FilesystemServiceGetResponse": FilesystemServiceGetResponse, + "FilesystemServiceListResponse": FilesystemServiceListResponse, + "FilesystemLayout": FilesystemLayout, + "FilesystemLayoutConstraints": FilesystemLayoutConstraints, + "Filesystem": Filesystem, + "Disk": Disk, + "Raid": Raid, + "DiskPartition": DiskPartition, + "VolumeGroup": VolumeGroup, + "LogicalVolume": LogicalVolume, + "LVMType": LVMType, + "Format": Format, + "GPTType": GPTType, + "RaidLevel": RaidLevel, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/filesystem.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/filesystem_pb2.py b/python/metalstack/api/v2/filesystem_pb2.py deleted file mode 100644 index 76a2f7cd..00000000 --- a/python/metalstack/api/v2/filesystem_pb2.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/filesystem.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/filesystem.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"metalstack/api/v2/filesystem.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\":\n\x1b\x46ilesystemServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"G\n\x1c\x46ilesystemServiceListRequest\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x42\x05\n\x03_id\"p\n\x1c\x46ilesystemServiceGetResponse\x12P\n\x11\x66ilesystem_layout\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\"s\n\x1d\x46ilesystemServiceListResponse\x12R\n\x12\x66ilesystem_layouts\x18\x01 \x03(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x11\x66ilesystemLayouts\"\xce\x04\n\x10\x46ilesystemLayout\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12?\n\x0b\x66ilesystems\x18\x05 \x03(\x0b\x32\x1d.metalstack.api.v2.FilesystemR\x0b\x66ilesystems\x12-\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x17.metalstack.api.v2.DiskR\x05\x64isks\x12+\n\x04raid\x18\x07 \x03(\x0b\x32\x17.metalstack.api.v2.RaidR\x04raid\x12\x43\n\rvolume_groups\x18\x08 \x03(\x0b\x32\x1e.metalstack.api.v2.VolumeGroupR\x0cvolumeGroups\x12I\n\x0flogical_volumes\x18\t \x03(\x0b\x32 .metalstack.api.v2.LogicalVolumeR\x0elogicalVolumes\x12P\n\x0b\x63onstraints\x18\n \x01(\x0b\x32..metalstack.api.v2.FilesystemLayoutConstraintsR\x0b\x63onstraintsB\x07\n\x05_nameB\x0e\n\x0c_description\"\xc2\x01\n\x1b\x46ilesystemLayoutConstraints\x12\x14\n\x05sizes\x18\x01 \x03(\tR\x05sizes\x12R\n\x06images\x18\x02 \x03(\x0b\x32:.metalstack.api.v2.FilesystemLayoutConstraints.ImagesEntryR\x06images\x1a\x39\n\x0bImagesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\"\xc2\x03\n\nFilesystem\x12#\n\x06\x64\x65vice\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x06\x64\x65vice\x12>\n\x06\x66ormat\x18\x02 \x01(\x0e\x32\x19.metalstack.api.v2.FormatB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x06\x66ormat\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12#\n\x04path\x18\x05 \x01(\tB\n\xbaH\x07r\x05\x10\x01\x18\x80 H\x02R\x04path\x88\x01\x01\x12,\n\x05label\x18\x06 \x01(\tB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01H\x03R\x05label\x88\x01\x01\x12\x39\n\rmount_options\x18\x07 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01\"\x08r\x06\x80\xb4\xae\xb1\x02\x01R\x0cmountOptions\x12;\n\x0e\x63reate_options\x18\x08 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01\"\x08r\x06\x80\xb4\xae\xb1\x02\x01R\rcreateOptionsB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_pathB\x08\n\x06_label\"s\n\x04\x44isk\x12)\n\x06\x64\x65vice\x18\x01 \x01(\tB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01R\x06\x64\x65vice\x12@\n\npartitions\x18\x02 \x03(\x0b\x32 .metalstack.api.v2.DiskPartitionR\npartitions\"\x83\x02\n\x04Raid\x12\x30\n\narray_name\x18\x01 \x01(\tB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01R\tarrayName\x12\x33\n\x07\x64\x65vices\x18\x02 \x03(\tB\x19\xbaH\x16\x92\x01\x13\x10\x80\x01\"\x08r\x06\xc0\xb3\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\x07\x64\x65vices\x12?\n\x05level\x18\x03 \x01(\x0e\x32\x1c.metalstack.api.v2.RaidLevelB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01R\x05level\x12;\n\x0e\x63reate_options\x18\x04 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x10 \x18\x01\"\x08r\x06\x80\xb4\xae\xb1\x02\x01R\rcreateOptions\x12\x16\n\x06spares\x18\x05 \x01(\x05R\x06spares\"\xc9\x01\n\rDiskPartition\x12\x16\n\x06number\x18\x01 \x01(\rR\x06number\x12,\n\x05label\x18\x02 \x01(\tB\x11\xbaH\x0er\x0c\xc0\xb3\xae\xb1\x02\x01\xf0\xb3\xae\xb1\x02\x01H\x00R\x05label\x88\x01\x01\x12\x12\n\x04size\x18\x03 \x01(\x04R\x04size\x12G\n\x08gpt_type\x18\x04 \x01(\x0e\x32\x1a.metalstack.api.v2.GPTTypeB\x0b\xbaH\x08\x82\x01\x02\x10\x01\xc8\x01\x01H\x01R\x07gptType\x88\x01\x01\x42\x08\n\x06_labelB\x0b\n\t_gpt_type\"\x92\x01\n\x0bVolumeGroup\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x33\n\x07\x64\x65vices\x18\x02 \x03(\tB\x19\xbaH\x16\x92\x01\x13\x10\x80\x01\"\x08r\x06\xc0\xb3\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\x07\x64\x65vices\x12-\n\x04tags\x18\x03 \x03(\tB\x19\xbaH\x16\x92\x01\x13\x10\x80\x01\"\x08r\x06\xc0\xb3\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\x04tags\"\xb5\x01\n\rLogicalVolume\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12.\n\x0cvolume_group\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x0bvolumeGroup\x12\x12\n\x04size\x18\x03 \x01(\x04R\x04size\x12?\n\x08lvm_type\x18\x04 \x01(\x0e\x32\x1a.metalstack.api.v2.LVMTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07lvmType*\x86\x01\n\x07LVMType\x12\x18\n\x14LVM_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x0fLVM_TYPE_LINEAR\x10\x01\x1a\n\x82\xb2\x19\x06linear\x12!\n\x10LVM_TYPE_STRIPED\x10\x02\x1a\x0b\x82\xb2\x19\x07striped\x12\x1d\n\x0eLVM_TYPE_RAID1\x10\x03\x1a\t\x82\xb2\x19\x05raid1*\xc4\x01\n\x06\x46ormat\x12\x16\n\x12\x46ORMAT_UNSPECIFIED\x10\x00\x12\x19\n\x0b\x46ORMAT_VFAT\x10\x01\x1a\x08\x82\xb2\x19\x04vfat\x12\x19\n\x0b\x46ORMAT_EXT3\x10\x02\x1a\x08\x82\xb2\x19\x04\x65xt3\x12\x19\n\x0b\x46ORMAT_EXT4\x10\x03\x1a\x08\x82\xb2\x19\x04\x65xt4\x12\x19\n\x0b\x46ORMAT_SWAP\x10\x04\x1a\x08\x82\xb2\x19\x04swap\x12\x1b\n\x0c\x46ORMAT_TMPFS\x10\x05\x1a\t\x82\xb2\x19\x05tmpfs\x12\x19\n\x0b\x46ORMAT_NONE\x10\x06\x1a\x08\x82\xb2\x19\x04none*\xa3\x01\n\x07GPTType\x12\x18\n\x14GPT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\rGPT_TYPE_BOOT\x10\x01\x1a\x08\x82\xb2\x19\x04\x65\x66\x30\x30\x12\x1c\n\x0eGPT_TYPE_LINUX\x10\x02\x1a\x08\x82\xb2\x19\x04\x38\x33\x30\x30\x12!\n\x13GPT_TYPE_LINUX_RAID\x10\x03\x1a\x08\x82\xb2\x19\x04\x66\x64\x30\x30\x12 \n\x12GPT_TYPE_LINUX_LVM\x10\x04\x1a\x08\x82\xb2\x19\x04\x38\x65\x30\x30*Y\n\tRaidLevel\x12\x1a\n\x16RAID_LEVEL_UNSPECIFIED\x10\x00\x12\x17\n\x0cRAID_LEVEL_0\x10\x01\x1a\x05\x82\xb2\x19\x01\x30\x12\x17\n\x0cRAID_LEVEL_1\x10\x02\x1a\x05\x82\xb2\x19\x01\x31\x32\xfa\x01\n\x11\x46ilesystemService\x12p\n\x03Get\x12..metalstack.api.v2.FilesystemServiceGetRequest\x1a/.metalstack.api.v2.FilesystemServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12s\n\x04List\x12/.metalstack.api.v2.FilesystemServiceListRequest\x1a\x30.metalstack.api.v2.FilesystemServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xc5\x01\n\x15\x63om.metalstack.api.v2B\x0f\x46ilesystemProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.filesystem_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\017FilesystemProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_LINEAR"]._loaded_options = None - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_LINEAR"]._serialized_options = b'\202\262\031\006linear' - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_STRIPED"]._loaded_options = None - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_STRIPED"]._serialized_options = b'\202\262\031\007striped' - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_RAID1"]._loaded_options = None - _globals['_LVMTYPE'].values_by_name["LVM_TYPE_RAID1"]._serialized_options = b'\202\262\031\005raid1' - _globals['_FORMAT'].values_by_name["FORMAT_VFAT"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_VFAT"]._serialized_options = b'\202\262\031\004vfat' - _globals['_FORMAT'].values_by_name["FORMAT_EXT3"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_EXT3"]._serialized_options = b'\202\262\031\004ext3' - _globals['_FORMAT'].values_by_name["FORMAT_EXT4"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_EXT4"]._serialized_options = b'\202\262\031\004ext4' - _globals['_FORMAT'].values_by_name["FORMAT_SWAP"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_SWAP"]._serialized_options = b'\202\262\031\004swap' - _globals['_FORMAT'].values_by_name["FORMAT_TMPFS"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_TMPFS"]._serialized_options = b'\202\262\031\005tmpfs' - _globals['_FORMAT'].values_by_name["FORMAT_NONE"]._loaded_options = None - _globals['_FORMAT'].values_by_name["FORMAT_NONE"]._serialized_options = b'\202\262\031\004none' - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_BOOT"]._loaded_options = None - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_BOOT"]._serialized_options = b'\202\262\031\004ef00' - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX"]._loaded_options = None - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX"]._serialized_options = b'\202\262\031\0048300' - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX_RAID"]._loaded_options = None - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX_RAID"]._serialized_options = b'\202\262\031\004fd00' - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX_LVM"]._loaded_options = None - _globals['_GPTTYPE'].values_by_name["GPT_TYPE_LINUX_LVM"]._serialized_options = b'\202\262\031\0048e00' - _globals['_RAIDLEVEL'].values_by_name["RAID_LEVEL_0"]._loaded_options = None - _globals['_RAIDLEVEL'].values_by_name["RAID_LEVEL_0"]._serialized_options = b'\202\262\031\0010' - _globals['_RAIDLEVEL'].values_by_name["RAID_LEVEL_1"]._loaded_options = None - _globals['_RAIDLEVEL'].values_by_name["RAID_LEVEL_1"]._serialized_options = b'\202\262\031\0011' - _globals['_FILESYSTEMSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_FILESYSTEMSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMSERVICELISTREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_FILESYSTEMSERVICELISTREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMLAYOUT'].fields_by_name['id']._loaded_options = None - _globals['_FILESYSTEMLAYOUT'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMLAYOUT'].fields_by_name['name']._loaded_options = None - _globals['_FILESYSTEMLAYOUT'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEMLAYOUT'].fields_by_name['description']._loaded_options = None - _globals['_FILESYSTEMLAYOUT'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_FILESYSTEMLAYOUTCONSTRAINTS_IMAGESENTRY']._loaded_options = None - _globals['_FILESYSTEMLAYOUTCONSTRAINTS_IMAGESENTRY']._serialized_options = b'8\001' - _globals['_FILESYSTEM'].fields_by_name['device']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['device']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEM'].fields_by_name['format']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['format']._serialized_options = b'\272H\010\202\001\002\020\001\310\001\001' - _globals['_FILESYSTEM'].fields_by_name['name']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_FILESYSTEM'].fields_by_name['description']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_FILESYSTEM'].fields_by_name['path']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['path']._serialized_options = b'\272H\007r\005\020\001\030\200 ' - _globals['_FILESYSTEM'].fields_by_name['label']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['label']._serialized_options = b'\272H\016r\014\300\263\256\261\002\001\360\263\256\261\002\001' - _globals['_FILESYSTEM'].fields_by_name['mount_options']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['mount_options']._serialized_options = b'\272H\021\222\001\016\020 \030\001\"\010r\006\200\264\256\261\002\001' - _globals['_FILESYSTEM'].fields_by_name['create_options']._loaded_options = None - _globals['_FILESYSTEM'].fields_by_name['create_options']._serialized_options = b'\272H\021\222\001\016\020 \030\001\"\010r\006\200\264\256\261\002\001' - _globals['_DISK'].fields_by_name['device']._loaded_options = None - _globals['_DISK'].fields_by_name['device']._serialized_options = b'\272H\016r\014\300\263\256\261\002\001\360\263\256\261\002\001' - _globals['_RAID'].fields_by_name['array_name']._loaded_options = None - _globals['_RAID'].fields_by_name['array_name']._serialized_options = b'\272H\016r\014\300\263\256\261\002\001\360\263\256\261\002\001' - _globals['_RAID'].fields_by_name['devices']._loaded_options = None - _globals['_RAID'].fields_by_name['devices']._serialized_options = b'\272H\026\222\001\023\020\200\001\"\010r\006\300\263\256\261\002\001\320\244\263\261\002\001' - _globals['_RAID'].fields_by_name['level']._loaded_options = None - _globals['_RAID'].fields_by_name['level']._serialized_options = b'\272H\010\202\001\002\020\001\310\001\001' - _globals['_RAID'].fields_by_name['create_options']._loaded_options = None - _globals['_RAID'].fields_by_name['create_options']._serialized_options = b'\272H\021\222\001\016\020 \030\001\"\010r\006\200\264\256\261\002\001' - _globals['_DISKPARTITION'].fields_by_name['label']._loaded_options = None - _globals['_DISKPARTITION'].fields_by_name['label']._serialized_options = b'\272H\016r\014\300\263\256\261\002\001\360\263\256\261\002\001' - _globals['_DISKPARTITION'].fields_by_name['gpt_type']._loaded_options = None - _globals['_DISKPARTITION'].fields_by_name['gpt_type']._serialized_options = b'\272H\010\202\001\002\020\001\310\001\001' - _globals['_VOLUMEGROUP'].fields_by_name['name']._loaded_options = None - _globals['_VOLUMEGROUP'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_VOLUMEGROUP'].fields_by_name['devices']._loaded_options = None - _globals['_VOLUMEGROUP'].fields_by_name['devices']._serialized_options = b'\272H\026\222\001\023\020\200\001\"\010r\006\300\263\256\261\002\001\320\244\263\261\002\001' - _globals['_VOLUMEGROUP'].fields_by_name['tags']._loaded_options = None - _globals['_VOLUMEGROUP'].fields_by_name['tags']._serialized_options = b'\272H\026\222\001\023\020\200\001\"\010r\006\300\263\256\261\002\001\320\244\263\261\002\001' - _globals['_LOGICALVOLUME'].fields_by_name['name']._loaded_options = None - _globals['_LOGICALVOLUME'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_LOGICALVOLUME'].fields_by_name['volume_group']._loaded_options = None - _globals['_LOGICALVOLUME'].fields_by_name['volume_group']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_LOGICALVOLUME'].fields_by_name['lvm_type']._loaded_options = None - _globals['_LOGICALVOLUME'].fields_by_name['lvm_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_FILESYSTEMSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_FILESYSTEMSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_FILESYSTEMSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_LVMTYPE']._serialized_start=2684 - _globals['_LVMTYPE']._serialized_end=2818 - _globals['_FORMAT']._serialized_start=2821 - _globals['_FORMAT']._serialized_end=3017 - _globals['_GPTTYPE']._serialized_start=3020 - _globals['_GPTTYPE']._serialized_end=3183 - _globals['_RAIDLEVEL']._serialized_start=3185 - _globals['_RAIDLEVEL']._serialized_end=3274 - _globals['_FILESYSTEMSERVICEGETREQUEST']._serialized_start=160 - _globals['_FILESYSTEMSERVICEGETREQUEST']._serialized_end=218 - _globals['_FILESYSTEMSERVICELISTREQUEST']._serialized_start=220 - _globals['_FILESYSTEMSERVICELISTREQUEST']._serialized_end=291 - _globals['_FILESYSTEMSERVICEGETRESPONSE']._serialized_start=293 - _globals['_FILESYSTEMSERVICEGETRESPONSE']._serialized_end=405 - _globals['_FILESYSTEMSERVICELISTRESPONSE']._serialized_start=407 - _globals['_FILESYSTEMSERVICELISTRESPONSE']._serialized_end=522 - _globals['_FILESYSTEMLAYOUT']._serialized_start=525 - _globals['_FILESYSTEMLAYOUT']._serialized_end=1115 - _globals['_FILESYSTEMLAYOUTCONSTRAINTS']._serialized_start=1118 - _globals['_FILESYSTEMLAYOUTCONSTRAINTS']._serialized_end=1312 - _globals['_FILESYSTEMLAYOUTCONSTRAINTS_IMAGESENTRY']._serialized_start=1255 - _globals['_FILESYSTEMLAYOUTCONSTRAINTS_IMAGESENTRY']._serialized_end=1312 - _globals['_FILESYSTEM']._serialized_start=1315 - _globals['_FILESYSTEM']._serialized_end=1765 - _globals['_DISK']._serialized_start=1767 - _globals['_DISK']._serialized_end=1882 - _globals['_RAID']._serialized_start=1885 - _globals['_RAID']._serialized_end=2144 - _globals['_DISKPARTITION']._serialized_start=2147 - _globals['_DISKPARTITION']._serialized_end=2348 - _globals['_VOLUMEGROUP']._serialized_start=2351 - _globals['_VOLUMEGROUP']._serialized_end=2497 - _globals['_LOGICALVOLUME']._serialized_start=2500 - _globals['_LOGICALVOLUME']._serialized_end=2681 - _globals['_FILESYSTEMSERVICE']._serialized_start=3277 - _globals['_FILESYSTEMSERVICE']._serialized_end=3527 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/filesystem_pb2.pyi b/python/metalstack/api/v2/filesystem_pb2.pyi deleted file mode 100644 index 1de31ad9..00000000 --- a/python/metalstack/api/v2/filesystem_pb2.pyi +++ /dev/null @@ -1,200 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class LVMType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - LVM_TYPE_UNSPECIFIED: _ClassVar[LVMType] - LVM_TYPE_LINEAR: _ClassVar[LVMType] - LVM_TYPE_STRIPED: _ClassVar[LVMType] - LVM_TYPE_RAID1: _ClassVar[LVMType] - -class Format(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - FORMAT_UNSPECIFIED: _ClassVar[Format] - FORMAT_VFAT: _ClassVar[Format] - FORMAT_EXT3: _ClassVar[Format] - FORMAT_EXT4: _ClassVar[Format] - FORMAT_SWAP: _ClassVar[Format] - FORMAT_TMPFS: _ClassVar[Format] - FORMAT_NONE: _ClassVar[Format] - -class GPTType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - GPT_TYPE_UNSPECIFIED: _ClassVar[GPTType] - GPT_TYPE_BOOT: _ClassVar[GPTType] - GPT_TYPE_LINUX: _ClassVar[GPTType] - GPT_TYPE_LINUX_RAID: _ClassVar[GPTType] - GPT_TYPE_LINUX_LVM: _ClassVar[GPTType] - -class RaidLevel(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - RAID_LEVEL_UNSPECIFIED: _ClassVar[RaidLevel] - RAID_LEVEL_0: _ClassVar[RaidLevel] - RAID_LEVEL_1: _ClassVar[RaidLevel] -LVM_TYPE_UNSPECIFIED: LVMType -LVM_TYPE_LINEAR: LVMType -LVM_TYPE_STRIPED: LVMType -LVM_TYPE_RAID1: LVMType -FORMAT_UNSPECIFIED: Format -FORMAT_VFAT: Format -FORMAT_EXT3: Format -FORMAT_EXT4: Format -FORMAT_SWAP: Format -FORMAT_TMPFS: Format -FORMAT_NONE: Format -GPT_TYPE_UNSPECIFIED: GPTType -GPT_TYPE_BOOT: GPTType -GPT_TYPE_LINUX: GPTType -GPT_TYPE_LINUX_RAID: GPTType -GPT_TYPE_LINUX_LVM: GPTType -RAID_LEVEL_UNSPECIFIED: RaidLevel -RAID_LEVEL_0: RaidLevel -RAID_LEVEL_1: RaidLevel - -class FilesystemServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class FilesystemServiceListRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class FilesystemServiceGetResponse(_message.Message): - __slots__ = ("filesystem_layout",) - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - filesystem_layout: FilesystemLayout - def __init__(self, filesystem_layout: _Optional[_Union[FilesystemLayout, _Mapping]] = ...) -> None: ... - -class FilesystemServiceListResponse(_message.Message): - __slots__ = ("filesystem_layouts",) - FILESYSTEM_LAYOUTS_FIELD_NUMBER: _ClassVar[int] - filesystem_layouts: _containers.RepeatedCompositeFieldContainer[FilesystemLayout] - def __init__(self, filesystem_layouts: _Optional[_Iterable[_Union[FilesystemLayout, _Mapping]]] = ...) -> None: ... - -class FilesystemLayout(_message.Message): - __slots__ = ("id", "meta", "name", "description", "filesystems", "disks", "raid", "volume_groups", "logical_volumes", "constraints") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - FILESYSTEMS_FIELD_NUMBER: _ClassVar[int] - DISKS_FIELD_NUMBER: _ClassVar[int] - RAID_FIELD_NUMBER: _ClassVar[int] - VOLUME_GROUPS_FIELD_NUMBER: _ClassVar[int] - LOGICAL_VOLUMES_FIELD_NUMBER: _ClassVar[int] - CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - name: str - description: str - filesystems: _containers.RepeatedCompositeFieldContainer[Filesystem] - disks: _containers.RepeatedCompositeFieldContainer[Disk] - raid: _containers.RepeatedCompositeFieldContainer[Raid] - volume_groups: _containers.RepeatedCompositeFieldContainer[VolumeGroup] - logical_volumes: _containers.RepeatedCompositeFieldContainer[LogicalVolume] - constraints: FilesystemLayoutConstraints - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., filesystems: _Optional[_Iterable[_Union[Filesystem, _Mapping]]] = ..., disks: _Optional[_Iterable[_Union[Disk, _Mapping]]] = ..., raid: _Optional[_Iterable[_Union[Raid, _Mapping]]] = ..., volume_groups: _Optional[_Iterable[_Union[VolumeGroup, _Mapping]]] = ..., logical_volumes: _Optional[_Iterable[_Union[LogicalVolume, _Mapping]]] = ..., constraints: _Optional[_Union[FilesystemLayoutConstraints, _Mapping]] = ...) -> None: ... - -class FilesystemLayoutConstraints(_message.Message): - __slots__ = ("sizes", "images") - class ImagesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - SIZES_FIELD_NUMBER: _ClassVar[int] - IMAGES_FIELD_NUMBER: _ClassVar[int] - sizes: _containers.RepeatedScalarFieldContainer[str] - images: _containers.ScalarMap[str, str] - def __init__(self, sizes: _Optional[_Iterable[str]] = ..., images: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class Filesystem(_message.Message): - __slots__ = ("device", "format", "name", "description", "path", "label", "mount_options", "create_options") - DEVICE_FIELD_NUMBER: _ClassVar[int] - FORMAT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PATH_FIELD_NUMBER: _ClassVar[int] - LABEL_FIELD_NUMBER: _ClassVar[int] - MOUNT_OPTIONS_FIELD_NUMBER: _ClassVar[int] - CREATE_OPTIONS_FIELD_NUMBER: _ClassVar[int] - device: str - format: Format - name: str - description: str - path: str - label: str - mount_options: _containers.RepeatedScalarFieldContainer[str] - create_options: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, device: _Optional[str] = ..., format: _Optional[_Union[Format, str]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., path: _Optional[str] = ..., label: _Optional[str] = ..., mount_options: _Optional[_Iterable[str]] = ..., create_options: _Optional[_Iterable[str]] = ...) -> None: ... - -class Disk(_message.Message): - __slots__ = ("device", "partitions") - DEVICE_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - device: str - partitions: _containers.RepeatedCompositeFieldContainer[DiskPartition] - def __init__(self, device: _Optional[str] = ..., partitions: _Optional[_Iterable[_Union[DiskPartition, _Mapping]]] = ...) -> None: ... - -class Raid(_message.Message): - __slots__ = ("array_name", "devices", "level", "create_options", "spares") - ARRAY_NAME_FIELD_NUMBER: _ClassVar[int] - DEVICES_FIELD_NUMBER: _ClassVar[int] - LEVEL_FIELD_NUMBER: _ClassVar[int] - CREATE_OPTIONS_FIELD_NUMBER: _ClassVar[int] - SPARES_FIELD_NUMBER: _ClassVar[int] - array_name: str - devices: _containers.RepeatedScalarFieldContainer[str] - level: RaidLevel - create_options: _containers.RepeatedScalarFieldContainer[str] - spares: int - def __init__(self, array_name: _Optional[str] = ..., devices: _Optional[_Iterable[str]] = ..., level: _Optional[_Union[RaidLevel, str]] = ..., create_options: _Optional[_Iterable[str]] = ..., spares: _Optional[int] = ...) -> None: ... - -class DiskPartition(_message.Message): - __slots__ = ("number", "label", "size", "gpt_type") - NUMBER_FIELD_NUMBER: _ClassVar[int] - LABEL_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - GPT_TYPE_FIELD_NUMBER: _ClassVar[int] - number: int - label: str - size: int - gpt_type: GPTType - def __init__(self, number: _Optional[int] = ..., label: _Optional[str] = ..., size: _Optional[int] = ..., gpt_type: _Optional[_Union[GPTType, str]] = ...) -> None: ... - -class VolumeGroup(_message.Message): - __slots__ = ("name", "devices", "tags") - NAME_FIELD_NUMBER: _ClassVar[int] - DEVICES_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - name: str - devices: _containers.RepeatedScalarFieldContainer[str] - tags: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, name: _Optional[str] = ..., devices: _Optional[_Iterable[str]] = ..., tags: _Optional[_Iterable[str]] = ...) -> None: ... - -class LogicalVolume(_message.Message): - __slots__ = ("name", "volume_group", "size", "lvm_type") - NAME_FIELD_NUMBER: _ClassVar[int] - VOLUME_GROUP_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - LVM_TYPE_FIELD_NUMBER: _ClassVar[int] - name: str - volume_group: str - size: int - lvm_type: LVMType - def __init__(self, name: _Optional[str] = ..., volume_group: _Optional[str] = ..., size: _Optional[int] = ..., lvm_type: _Optional[_Union[LVMType, str]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/health_connect.py b/python/metalstack/api/v2/health_connect.py index 4ab16f05..1f188d06 100644 --- a/python/metalstack/api/v2/health_connect.py +++ b/python/metalstack/api/v2/health_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/health.proto +# Generated from metalstack/api/v2/health.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.health_pb2 as metalstack_dot_api_dot_v2_dot_health__pb2 + +from .health_pb import HealthServiceGetRequest, HealthServiceGetResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class HealthService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: HealthServiceGetRequest, ctx: RequestContext[HealthServiceGetRequest, HealthServiceGetResponse]) -> HealthServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class HealthServiceASGIApplication(ConnectASGIApplication[HealthService]): - def __init__(self, service: HealthService | AsyncGenerator[HealthService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: HealthService | AsyncGenerator[HealthService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: HealthService | AsyncGenerator[HealthService], *, in method=MethodInfo( name="Get", service_name="metalstack.api.v2.HealthService", - input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse, + input=HealthServiceGetRequest, + output=HealthServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -53,43 +69,46 @@ def path(self) -> str: class HealthServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, + request: HealthServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: + ) -> HealthServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.HealthService", - input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse, + input=HealthServiceGetRequest, + output=HealthServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class HealthServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: HealthServiceGetRequest, ctx: RequestContext[HealthServiceGetRequest, HealthServiceGetResponse]) -> HealthServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class HealthServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: HealthServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: HealthServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.HealthService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.HealthService", - input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse, + input=HealthServiceGetRequest, + output=HealthServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -110,22 +129,20 @@ def path(self) -> str: class HealthServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, + request: HealthServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse: + ) -> HealthServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.HealthService", - input=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_health__pb2.HealthServiceGetResponse, + input=HealthServiceGetRequest, + output=HealthServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/health_pb.py b/python/metalstack/api/v2/health_pb.py new file mode 100644 index 00000000..08361476 --- /dev/null +++ b/python/metalstack/api/v2/health_pb.py @@ -0,0 +1,335 @@ +# Generated from metalstack/api/v2/health.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc + +from . import common_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + +_HealthFields: TypeAlias = Literal["services"] + +class Health(Message[_HealthFields]): + """ + Health reports the health status of all services. + + ```proto + message metalstack.api.v2.Health + ``` + + Attributes: + services: + Services contains the health of all individual services + + ```proto + repeated metalstack.api.v2.HealthStatus services = 1; + ``` + """ + + __slots__ = ("services",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + services: list[HealthStatus] | None = None, + ) -> None: + pass + + services: list[HealthStatus] + +_HealthStatusFields: TypeAlias = Literal["name", "status", "message", "partitions"] + +class HealthStatus(Message[_HealthStatusFields]): + """ + HealthStatus represents the health status of one service. + + ```proto + message metalstack.api.v2.HealthStatus + ``` + + Attributes: + name: + Name is the name of the service + + ```proto + metalstack.api.v2.Service name = 1; + ``` + status: + Status is the status of this service + + ```proto + metalstack.api.v2.ServiceStatus status = 2; + ``` + message: + Message describes the reason for the unhealthy status if possible + + ```proto + string message = 3; + ``` + partitions: + Partitions describes the health of the service by partition + + ```proto + map partitions = 4; + ``` + """ + + __slots__ = ("name", "status", "message", "partitions") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: Service | None = None, + status: ServiceStatus | None = None, + message: str = "", + partitions: dict[str, PartitionHealth] | None = None, + ) -> None: + pass + + name: Service + status: ServiceStatus + message: str + partitions: dict[str, PartitionHealth] + +_PartitionHealthFields: TypeAlias = Literal["status", "message"] + +class PartitionHealth(Message[_PartitionHealthFields]): + """ + PartitionHealth represents the status of a specific service in this partition. + + ```proto + message metalstack.api.v2.PartitionHealth + ``` + + Attributes: + status: + Status is the health status of the service in this partition + + ```proto + metalstack.api.v2.ServiceStatus status = 1; + ``` + message: + Message describes the reason for the unhealthy status if possible + + ```proto + string message = 2; + ``` + """ + + __slots__ = ("status", "message") + + if TYPE_CHECKING: + + def __init__( + self, + *, + status: ServiceStatus | None = None, + message: str = "", + ) -> None: + pass + + status: ServiceStatus + message: str + +_HealthServiceGetRequestFields: TypeAlias = NoReturn + +class HealthServiceGetRequest(Message[_HealthServiceGetRequestFields]): + """ + HealthServiceGetRequest is the request payload for getting the health of the system. + + ```proto + message metalstack.api.v2.HealthServiceGetRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_HealthServiceGetResponseFields: TypeAlias = Literal["health"] + +class HealthServiceGetResponse(Message[_HealthServiceGetResponseFields]): + """ + HealthServiceGetResponse is the response payload for getting the health of the system. + + ```proto + message metalstack.api.v2.HealthServiceGetResponse + ``` + + Attributes: + health: + Health contains the overall health of the system + + ```proto + optional metalstack.api.v2.Health health = 1; + ``` + """ + + __slots__ = ("health",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + health: Health | None = None, + ) -> None: + pass + + health: Health | None + +class ServiceStatus(Enum): + """ + ServiceStatus defines the status of a service. + + ```proto + enum metalstack.api.v2.ServiceStatus + ``` + + Attributes: + UNSPECIFIED: + SERVICE_STATUS_UNSPECIFIED service status is not known or unspecified + + ```proto + SERVICE_STATUS_UNSPECIFIED = 0 + ``` + DEGRADED: + SERVICE_STATUS_DEGRADED the service is in degraded status, not the whole functionality is available + + ```proto + SERVICE_STATUS_DEGRADED = 1 + ``` + UNHEALTHY: + SERVICE_STATUS_UNHEALTHY the service is in unhealthy status, serious impact is expected + + ```proto + SERVICE_STATUS_UNHEALTHY = 2 + ``` + HEALTHY: + SERVICE_STATUS_HEALTHY the service is in healthy status, for example fully functional + + ```proto + SERVICE_STATUS_HEALTHY = 3 + ``` + """ + + UNSPECIFIED = 0 + DEGRADED = 1 + UNHEALTHY = 2 + HEALTHY = 3 + +class Service(Enum): + """ + Service defines the service for which the healthiness is reported. + + ```proto + enum metalstack.api.v2.Service + ``` + + Attributes: + UNSPECIFIED: + SERVICE_UNSPECIFIED is a unknown service + + ```proto + SERVICE_UNSPECIFIED = 0 + ``` + IPAM: + SERVICE_IPAM the IPAM service + + ```proto + SERVICE_IPAM = 1 + ``` + RETHINK: + SERVICE_RETHINK the RethinkDB + + ```proto + SERVICE_RETHINK = 2 + ``` + TENANT_APISERVER: + SERVICE_TENANT_APISERVER the tenant-apiserver + + ```proto + SERVICE_TENANT_APISERVER = 3 + ``` + MACHINES: + SERVICE_MACHINES the machine service + + ```proto + SERVICE_MACHINES = 4 + ``` + AUDIT: + SERVICE_AUDIT the auditing + + ```proto + SERVICE_AUDIT = 5 + ``` + VPN: + SERVICE_VPN the VPN service + + ```proto + SERVICE_VPN = 6 + ``` + REDIS: + SERVICE_REDIS the Redis service + + ```proto + SERVICE_REDIS = 7 + ``` + TASKS: + SERVICE_TASKS the tasks service + + ```proto + SERVICE_TASKS = 8 + ``` + """ + + UNSPECIFIED = 0 + IPAM = 1 + RETHINK = 2 + TENANT_APISERVER = 3 + MACHINES = 4 + AUDIT = 5 + VPN = 6 + REDIS = 7 + TASKS = 8 + + +_DESC = file_desc( + b'\n\x1emetalstack/api/v2/health.proto\x12\x11metalstack.api.v2\x1a\x1emetalstack/api/v2/common.proto"E\n\x06Health\x12;\n\x08services\x18\x01 \x03(\x0b2\x1f.metalstack.api.v2.HealthStatusR\x08services"\xc6\x02\n\x0cHealthStatus\x12.\n\x04name\x18\x01 \x01(\x0e2\x1a.metalstack.api.v2.ServiceR\x04name\x128\n\x06status\x18\x02 \x01(\x0e2 .metalstack.api.v2.ServiceStatusR\x06status\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12O\n\npartitions\x18\x04 \x03(\x0b2/.metalstack.api.v2.HealthStatus.PartitionsEntryR\npartitions\x1aa\n\x0fPartitionsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x128\n\x05value\x18\x02 \x01(\x0b2".metalstack.api.v2.PartitionHealthR\x05value:\x028\x01"e\n\x0fPartitionHealth\x128\n\x06status\x18\x01 \x01(\x0e2 .metalstack.api.v2.ServiceStatusR\x06status\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message"\x19\n\x17HealthServiceGetRequest"M\n\x18HealthServiceGetResponse\x121\n\x06health\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.HealthR\x06health*\x86\x01\n\rServiceStatus\x12\x1e\n\x1aSERVICE_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n\x17SERVICE_STATUS_DEGRADED\x10\x01\x12\x1c\n\x18SERVICE_STATUS_UNHEALTHY\x10\x02\x12\x1a\n\x16SERVICE_STATUS_HEALTHY\x10\x03*\xae\x02\n\x07Service\x12\x17\n\x13SERVICE_UNSPECIFIED\x10\x00\x12\x1a\n\x0cSERVICE_IPAM\x10\x01\x1a\x08\x82\xb2\x19\x04ipam\x12"\n\x0fSERVICE_RETHINK\x10\x02\x1a\r\x82\xb2\x19\trethinkdb\x122\n\x18SERVICE_TENANT_APISERVER\x10\x03\x1a\x14\x82\xb2\x19\x10tenant-apiserver\x12"\n\x10SERVICE_MACHINES\x10\x04\x1a\x0c\x82\xb2\x19\x08machines\x12\x1c\n\rSERVICE_AUDIT\x10\x05\x1a\t\x82\xb2\x19\x05audit\x12\x18\n\x0bSERVICE_VPN\x10\x06\x1a\x07\x82\xb2\x19\x03vpn\x12\x1c\n\rSERVICE_REDIS\x10\x07\x1a\t\x82\xb2\x19\x05redis\x12\x1c\n\rSERVICE_TASKS\x10\x08\x1a\t\x82\xb2\x19\x05tasks2y\n\rHealthService\x12h\n\x03Get\x12*.metalstack.api.v2.HealthServiceGetRequest\x1a+.metalstack.api.v2.HealthServiceGetResponse"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x02B\xc1\x01\n\x15com.metalstack.api.v2B\x0bHealthProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + common_pb.desc(), + ], + { + "Health": Health, + "HealthStatus": HealthStatus, + "PartitionHealth": PartitionHealth, + "HealthServiceGetRequest": HealthServiceGetRequest, + "HealthServiceGetResponse": HealthServiceGetResponse, + "ServiceStatus": ServiceStatus, + "Service": Service, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/health.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/health_pb2.py b/python/metalstack/api/v2/health_pb2.py deleted file mode 100644 index f539b62a..00000000 --- a/python/metalstack/api/v2/health_pb2.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/health.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/health.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/health.proto\x12\x11metalstack.api.v2\x1a\x1emetalstack/api/v2/common.proto\"E\n\x06Health\x12;\n\x08services\x18\x01 \x03(\x0b\x32\x1f.metalstack.api.v2.HealthStatusR\x08services\"\xc6\x02\n\x0cHealthStatus\x12.\n\x04name\x18\x01 \x01(\x0e\x32\x1a.metalstack.api.v2.ServiceR\x04name\x12\x38\n\x06status\x18\x02 \x01(\x0e\x32 .metalstack.api.v2.ServiceStatusR\x06status\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\x12O\n\npartitions\x18\x04 \x03(\x0b\x32/.metalstack.api.v2.HealthStatus.PartitionsEntryR\npartitions\x1a\x61\n\x0fPartitionsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.PartitionHealthR\x05value:\x02\x38\x01\"e\n\x0fPartitionHealth\x12\x38\n\x06status\x18\x01 \x01(\x0e\x32 .metalstack.api.v2.ServiceStatusR\x06status\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"\x19\n\x17HealthServiceGetRequest\"M\n\x18HealthServiceGetResponse\x12\x31\n\x06health\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.HealthR\x06health*\x86\x01\n\rServiceStatus\x12\x1e\n\x1aSERVICE_STATUS_UNSPECIFIED\x10\x00\x12\x1b\n\x17SERVICE_STATUS_DEGRADED\x10\x01\x12\x1c\n\x18SERVICE_STATUS_UNHEALTHY\x10\x02\x12\x1a\n\x16SERVICE_STATUS_HEALTHY\x10\x03*\xae\x02\n\x07Service\x12\x17\n\x13SERVICE_UNSPECIFIED\x10\x00\x12\x1a\n\x0cSERVICE_IPAM\x10\x01\x1a\x08\x82\xb2\x19\x04ipam\x12\"\n\x0fSERVICE_RETHINK\x10\x02\x1a\r\x82\xb2\x19\trethinkdb\x12\x32\n\x18SERVICE_TENANT_APISERVER\x10\x03\x1a\x14\x82\xb2\x19\x10tenant-apiserver\x12\"\n\x10SERVICE_MACHINES\x10\x04\x1a\x0c\x82\xb2\x19\x08machines\x12\x1c\n\rSERVICE_AUDIT\x10\x05\x1a\t\x82\xb2\x19\x05\x61udit\x12\x18\n\x0bSERVICE_VPN\x10\x06\x1a\x07\x82\xb2\x19\x03vpn\x12\x1c\n\rSERVICE_REDIS\x10\x07\x1a\t\x82\xb2\x19\x05redis\x12\x1c\n\rSERVICE_TASKS\x10\x08\x1a\t\x82\xb2\x19\x05tasks2y\n\rHealthService\x12h\n\x03Get\x12*.metalstack.api.v2.HealthServiceGetRequest\x1a+.metalstack.api.v2.HealthServiceGetResponse\"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x02\x42\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0bHealthProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.health_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013HealthProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_SERVICE'].values_by_name["SERVICE_IPAM"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_IPAM"]._serialized_options = b'\202\262\031\004ipam' - _globals['_SERVICE'].values_by_name["SERVICE_RETHINK"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_RETHINK"]._serialized_options = b'\202\262\031\trethinkdb' - _globals['_SERVICE'].values_by_name["SERVICE_TENANT_APISERVER"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_TENANT_APISERVER"]._serialized_options = b'\202\262\031\020tenant-apiserver' - _globals['_SERVICE'].values_by_name["SERVICE_MACHINES"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_MACHINES"]._serialized_options = b'\202\262\031\010machines' - _globals['_SERVICE'].values_by_name["SERVICE_AUDIT"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_AUDIT"]._serialized_options = b'\202\262\031\005audit' - _globals['_SERVICE'].values_by_name["SERVICE_VPN"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_VPN"]._serialized_options = b'\202\262\031\003vpn' - _globals['_SERVICE'].values_by_name["SERVICE_REDIS"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_REDIS"]._serialized_options = b'\202\262\031\005redis' - _globals['_SERVICE'].values_by_name["SERVICE_TASKS"]._loaded_options = None - _globals['_SERVICE'].values_by_name["SERVICE_TASKS"]._serialized_options = b'\202\262\031\005tasks' - _globals['_HEALTHSTATUS_PARTITIONSENTRY']._loaded_options = None - _globals['_HEALTHSTATUS_PARTITIONSENTRY']._serialized_options = b'8\001' - _globals['_HEALTHSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_HEALTHSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\001\340\363\030\002' - _globals['_SERVICESTATUS']._serialized_start=695 - _globals['_SERVICESTATUS']._serialized_end=829 - _globals['_SERVICE']._serialized_start=832 - _globals['_SERVICE']._serialized_end=1134 - _globals['_HEALTH']._serialized_start=85 - _globals['_HEALTH']._serialized_end=154 - _globals['_HEALTHSTATUS']._serialized_start=157 - _globals['_HEALTHSTATUS']._serialized_end=483 - _globals['_HEALTHSTATUS_PARTITIONSENTRY']._serialized_start=386 - _globals['_HEALTHSTATUS_PARTITIONSENTRY']._serialized_end=483 - _globals['_PARTITIONHEALTH']._serialized_start=485 - _globals['_PARTITIONHEALTH']._serialized_end=586 - _globals['_HEALTHSERVICEGETREQUEST']._serialized_start=588 - _globals['_HEALTHSERVICEGETREQUEST']._serialized_end=613 - _globals['_HEALTHSERVICEGETRESPONSE']._serialized_start=615 - _globals['_HEALTHSERVICEGETRESPONSE']._serialized_end=692 - _globals['_HEALTHSERVICE']._serialized_start=1136 - _globals['_HEALTHSERVICE']._serialized_end=1257 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/health_pb2.pyi b/python/metalstack/api/v2/health_pb2.pyi deleted file mode 100644 index 6f19f9d4..00000000 --- a/python/metalstack/api/v2/health_pb2.pyi +++ /dev/null @@ -1,84 +0,0 @@ -from metalstack.api.v2 import common_pb2 as _common_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ServiceStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SERVICE_STATUS_UNSPECIFIED: _ClassVar[ServiceStatus] - SERVICE_STATUS_DEGRADED: _ClassVar[ServiceStatus] - SERVICE_STATUS_UNHEALTHY: _ClassVar[ServiceStatus] - SERVICE_STATUS_HEALTHY: _ClassVar[ServiceStatus] - -class Service(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SERVICE_UNSPECIFIED: _ClassVar[Service] - SERVICE_IPAM: _ClassVar[Service] - SERVICE_RETHINK: _ClassVar[Service] - SERVICE_TENANT_APISERVER: _ClassVar[Service] - SERVICE_MACHINES: _ClassVar[Service] - SERVICE_AUDIT: _ClassVar[Service] - SERVICE_VPN: _ClassVar[Service] - SERVICE_REDIS: _ClassVar[Service] - SERVICE_TASKS: _ClassVar[Service] -SERVICE_STATUS_UNSPECIFIED: ServiceStatus -SERVICE_STATUS_DEGRADED: ServiceStatus -SERVICE_STATUS_UNHEALTHY: ServiceStatus -SERVICE_STATUS_HEALTHY: ServiceStatus -SERVICE_UNSPECIFIED: Service -SERVICE_IPAM: Service -SERVICE_RETHINK: Service -SERVICE_TENANT_APISERVER: Service -SERVICE_MACHINES: Service -SERVICE_AUDIT: Service -SERVICE_VPN: Service -SERVICE_REDIS: Service -SERVICE_TASKS: Service - -class Health(_message.Message): - __slots__ = ("services",) - SERVICES_FIELD_NUMBER: _ClassVar[int] - services: _containers.RepeatedCompositeFieldContainer[HealthStatus] - def __init__(self, services: _Optional[_Iterable[_Union[HealthStatus, _Mapping]]] = ...) -> None: ... - -class HealthStatus(_message.Message): - __slots__ = ("name", "status", "message", "partitions") - class PartitionsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: PartitionHealth - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[PartitionHealth, _Mapping]] = ...) -> None: ... - NAME_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - name: Service - status: ServiceStatus - message: str - partitions: _containers.MessageMap[str, PartitionHealth] - def __init__(self, name: _Optional[_Union[Service, str]] = ..., status: _Optional[_Union[ServiceStatus, str]] = ..., message: _Optional[str] = ..., partitions: _Optional[_Mapping[str, PartitionHealth]] = ...) -> None: ... - -class PartitionHealth(_message.Message): - __slots__ = ("status", "message") - STATUS_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - status: ServiceStatus - message: str - def __init__(self, status: _Optional[_Union[ServiceStatus, str]] = ..., message: _Optional[str] = ...) -> None: ... - -class HealthServiceGetRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class HealthServiceGetResponse(_message.Message): - __slots__ = ("health",) - HEALTH_FIELD_NUMBER: _ClassVar[int] - health: Health - def __init__(self, health: _Optional[_Union[Health, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/image_connect.py b/python/metalstack/api/v2/image_connect.py index f002625d..f9251544 100644 --- a/python/metalstack/api/v2/image_connect.py +++ b/python/metalstack/api/v2/image_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/image.proto +# Generated from metalstack/api/v2/image.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.image_pb2 as metalstack_dot_api_dot_v2_dot_image__pb2 + +from .image_pb import ImageServiceGetRequest, ImageServiceGetResponse, ImageServiceLatestRequest, ImageServiceLatestResponse, ImageServiceListRequest, ImageServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ImageService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: ImageServiceGetRequest, ctx: RequestContext[ImageServiceGetRequest, ImageServiceGetResponse]) -> ImageServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: ImageServiceListRequest, ctx: RequestContext[ImageServiceListRequest, ImageServiceListResponse]) -> ImageServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def latest(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def latest(self, request: ImageServiceLatestRequest, ctx: RequestContext[ImageServiceLatestRequest, ImageServiceLatestResponse]) -> ImageServiceLatestResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ImageServiceASGIApplication(ConnectASGIApplication[ImageService]): - def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ImageService | AsyncGenerator[ImageService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,8 +53,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Get", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse, + input=ImageServiceGetRequest, + output=ImageServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -47,8 +63,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="List", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse, + input=ImageServiceListRequest, + output=ImageServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -57,8 +73,8 @@ def __init__(self, service: ImageService | AsyncGenerator[ImageService], *, inte method=MethodInfo( name="Latest", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse, + input=ImageServiceLatestRequest, + output=ImageServiceLatestResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.latest, @@ -79,18 +95,18 @@ def path(self) -> str: class ImageServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, + request: ImageServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: + ) -> ImageServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse, + input=ImageServiceGetRequest, + output=ImageServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -99,18 +115,18 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, + request: ImageServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: + ) -> ImageServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse, + input=ImageServiceListRequest, + output=ImageServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -119,47 +135,52 @@ async def list( async def latest( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, + request: ImageServiceLatestRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: + ) -> ImageServiceLatestResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Latest", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse, + input=ImageServiceLatestRequest, + output=ImageServiceLatestResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class ImageServiceSync(Protocol): + def get(self, request: ImageServiceGetRequest, ctx: RequestContext[ImageServiceGetRequest, ImageServiceGetResponse]) -> ImageServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: ImageServiceListRequest, ctx: RequestContext[ImageServiceListRequest, ImageServiceListResponse]) -> ImageServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class ImageServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def latest(self, request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def latest(self, request: ImageServiceLatestRequest, ctx: RequestContext[ImageServiceLatestRequest, ImageServiceLatestResponse]) -> ImageServiceLatestResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ImageServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ImageServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ImageServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.ImageService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse, + input=ImageServiceGetRequest, + output=ImageServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -168,8 +189,8 @@ def __init__(self, service: ImageServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="List", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse, + input=ImageServiceListRequest, + output=ImageServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -178,8 +199,8 @@ def __init__(self, service: ImageServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Latest", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse, + input=ImageServiceLatestRequest, + output=ImageServiceLatestResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.latest, @@ -200,62 +221,58 @@ def path(self) -> str: class ImageServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, + request: ImageServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse: + ) -> ImageServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceGetResponse, + input=ImageServiceGetRequest, + output=ImageServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, + request: ImageServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse: + ) -> ImageServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceListResponse, + input=ImageServiceListRequest, + output=ImageServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def latest( self, - request: metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, + request: ImageServiceLatestRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse: + ) -> ImageServiceLatestResponse: return self.execute_unary( request=request, method=MethodInfo( name="Latest", service_name="metalstack.api.v2.ImageService", - input=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestRequest, - output=metalstack_dot_api_dot_v2_dot_image__pb2.ImageServiceLatestResponse, + input=ImageServiceLatestRequest, + output=ImageServiceLatestResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/image_pb.py b/python/metalstack/api/v2/image_pb.py new file mode 100644 index 00000000..5c4fb2fb --- /dev/null +++ b/python/metalstack/api/v2/image_pb.py @@ -0,0 +1,550 @@ +# Generated from metalstack/api/v2/image.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from .common_pb import Labels, Meta + + +_ImageServiceGetRequestFields: TypeAlias = Literal["id"] + +class ImageServiceGetRequest(Message[_ImageServiceGetRequestFields]): + """ + ImageServiceGetRequest is the request payload for an image get request + + ```proto + message metalstack.api.v2.ImageServiceGetRequest + ``` + + Attributes: + id: + ID of the image to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_ImageServiceListRequestFields: TypeAlias = Literal["query"] + +class ImageServiceListRequest(Message[_ImageServiceListRequestFields]): + """ + ImageServiceListRequest is the request payload for an image list request + + ```proto + message metalstack.api.v2.ImageServiceListRequest + ``` + + Attributes: + query: + Query for images + + ```proto + optional metalstack.api.v2.ImageQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: ImageQuery | None = None, + ) -> None: + pass + + query: ImageQuery | None + +_ImageServiceLatestRequestFields: TypeAlias = Literal["os", "classification"] + +class ImageServiceLatestRequest(Message[_ImageServiceLatestRequestFields]): + """ + ImageServiceLatestRequest is the request payload for an image latest request + + ```proto + message metalstack.api.v2.ImageServiceLatestRequest + ``` + + Attributes: + os: + OS for which the latest image should be fetched + should contain os and major.minor then latest patch version of this os is returned + + ```proto + string os = 1; + ``` + classification: + Classification of the image latest image + + ```proto + optional metalstack.api.v2.ImageClassification classification = 2; + ``` + """ + + __slots__ = ("os", "classification") + + if TYPE_CHECKING: + + def __init__( + self, + *, + os: str = "", + classification: ImageClassification | None = None, + ) -> None: + pass + + os: str + classification: ImageClassification + +_ImageServiceGetResponseFields: TypeAlias = Literal["image"] + +class ImageServiceGetResponse(Message[_ImageServiceGetResponseFields]): + """ + ImageServiceGetResponse is the response payload for an image get request + + ```proto + message metalstack.api.v2.ImageServiceGetResponse + ``` + + Attributes: + image: + Image the image + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageServiceListResponseFields: TypeAlias = Literal["images"] + +class ImageServiceListResponse(Message[_ImageServiceListResponseFields]): + """ + ImageServiceListResponse is the response payload for an image list request + + ```proto + message metalstack.api.v2.ImageServiceListResponse + ``` + + Attributes: + images: + Images the images + + ```proto + repeated metalstack.api.v2.Image images = 1; + ``` + """ + + __slots__ = ("images",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + images: list[Image] | None = None, + ) -> None: + pass + + images: list[Image] + +_ImageServiceLatestResponseFields: TypeAlias = Literal["image"] + +class ImageServiceLatestResponse(Message[_ImageServiceLatestResponseFields]): + """ + ImageServiceLatestResponse is the response payload for an image latest request + + ```proto + message metalstack.api.v2.ImageServiceLatestResponse + ``` + + Attributes: + image: + Image which is the latest for one os + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + """ + + __slots__ = ("image",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + ) -> None: + pass + + image: Image | None + +_ImageFields: TypeAlias = Literal["id", "meta", "url", "name", "description", "features", "classification", "expires_at"] + +class Image(Message[_ImageFields]): + """ + Image + + ```proto + message metalstack.api.v2.Image + ``` + + Attributes: + id: + Id of this image + + ```proto + string id = 1; + ``` + meta: + Meta for this image + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + url: + URL where this image is located + + ```proto + string url = 3; + ``` + name: + Name of this image + + ```proto + optional string name = 4; + ``` + description: + Description of this image + + ```proto + optional string description = 5; + ``` + features: + Features of this image + + ```proto + repeated metalstack.api.v2.ImageFeature features = 6 [packed = true]; + ``` + classification: + Classification of this image + + ```proto + metalstack.api.v2.ImageClassification classification = 7; + ``` + expires_at: + ExpiresAt usage is not possible after this date + + ```proto + optional google.protobuf.Timestamp expires_at = 8; + ``` + """ + + __slots__ = ("id", "meta", "url", "name", "description", "features", "classification", "expires_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + url: str = "", + name: str | None = None, + description: str | None = None, + features: list[ImageFeature] | None = None, + classification: ImageClassification | None = None, + expires_at: Timestamp | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + url: str + name: str + description: str + features: list[ImageFeature] + classification: ImageClassification + expires_at: Timestamp | None + +_ImageUsageFields: TypeAlias = Literal["image", "used_by"] + +class ImageUsage(Message[_ImageUsageFields]): + """ + ImageUsage reports which machines/firewalls actually use this image + + ```proto + message metalstack.api.v2.ImageUsage + ``` + + Attributes: + image: + Image with usage + + ```proto + optional metalstack.api.v2.Image image = 1; + ``` + used_by: + UsedBy the following machines/firewalls + + ```proto + repeated string used_by = 2; + ``` + """ + + __slots__ = ("image", "used_by") + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: Image | None = None, + used_by: list[str] | None = None, + ) -> None: + pass + + image: Image | None + used_by: list[str] + +_ImageQueryFields: TypeAlias = Literal["id", "os", "version", "name", "description", "url", "feature", "classification", "labels"] + +class ImageQuery(Message[_ImageQueryFields]): + """ + ImageQuery is used to search images + + ```proto + message metalstack.api.v2.ImageQuery + ``` + + Attributes: + id: + ID of the image to get + + ```proto + optional string id = 1; + ``` + os: + OS of the image + + ```proto + optional string os = 2; + ``` + version: + Version of the Image + + ```proto + optional string version = 3; + ``` + name: + Name of the image to query + + ```proto + optional string name = 4; + ``` + description: + Description of the image to query + + ```proto + optional string description = 5; + ``` + url: + Url of the image to query + + ```proto + optional string url = 6; + ``` + feature: + Feature of the image to query + + ```proto + optional metalstack.api.v2.ImageFeature feature = 7; + ``` + classification: + Classification of the image to query + + ```proto + optional metalstack.api.v2.ImageClassification classification = 8; + ``` + labels: + Labels lists only images containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 9; + ``` + """ + + __slots__ = ("id", "os", "version", "name", "description", "url", "feature", "classification", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + os: str | None = None, + version: str | None = None, + name: str | None = None, + description: str | None = None, + url: str | None = None, + feature: ImageFeature | None = None, + classification: ImageClassification | None = None, + labels: Labels | None = None, + ) -> None: + pass + + id: str + os: str + version: str + name: str + description: str + url: str + feature: ImageFeature + classification: ImageClassification + labels: Labels | None + +class ImageFeature(Enum): + """ + ImageFeature + + ```proto + enum metalstack.api.v2.ImageFeature + ``` + + Attributes: + UNSPECIFIED: + IMAGE_FEATURE_UNSPECIFIED is not specified + + ```proto + IMAGE_FEATURE_UNSPECIFIED = 0 + ``` + MACHINE: + IMAGE_FEATURE_MACHINE indicates this image is usable for a machine + + ```proto + IMAGE_FEATURE_MACHINE = 1 + ``` + FIREWALL: + IMAGE_FEATURE_FIREWALL indicates this image is usable for a firewall + + ```proto + IMAGE_FEATURE_FIREWALL = 2 + ``` + """ + + UNSPECIFIED = 0 + MACHINE = 1 + FIREWALL = 2 + +class ImageClassification(Enum): + """ + Image + + ```proto + enum metalstack.api.v2.ImageClassification + ``` + + Attributes: + UNSPECIFIED: + IMAGE_CLASSIFICATION_UNSPECIFIED is not specified + + ```proto + IMAGE_CLASSIFICATION_UNSPECIFIED = 0 + ``` + PREVIEW: + IMAGE_CLASSIFICATION_PREVIEW indicates that this image is in preview + + ```proto + IMAGE_CLASSIFICATION_PREVIEW = 1 + ``` + SUPPORTED: + IMAGE_CLASSIFICATION_SUPPORTED indicates that this image is supported + + ```proto + IMAGE_CLASSIFICATION_SUPPORTED = 2 + ``` + DEPRECATED: + IMAGE_CLASSIFICATION_DEPRECATED indicates that this image is deprecated + + ```proto + IMAGE_CLASSIFICATION_DEPRECATED = 3 + ``` + """ + + UNSPECIFIED = 0 + PREVIEW = 1 + SUPPORTED = 2 + DEPRECATED = 3 + + +_DESC = file_desc( + b'\n\x1dmetalstack/api/v2/image.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"5\n\x16ImageServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"N\n\x17ImageServiceListRequest\x123\n\x05query\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.ImageQueryR\x05query"\x9d\x01\n\x19ImageServiceLatestRequest\x12\x0e\n\x02os\x18\x01 \x01(\tR\x02os\x12]\n\x0eclassification\x18\x02 \x01(\x0e2&.metalstack.api.v2.ImageClassificationH\x00R\x0eclassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x11\n\x0f_classification"I\n\x17ImageServiceGetResponse\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"L\n\x18ImageServiceListResponse\x120\n\x06images\x18\x01 \x03(\x0b2\x18.metalstack.api.v2.ImageR\x06images"L\n\x1aImageServiceLatestResponse\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image"\xc6\x03\n\x05Image\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x1d\n\x03url\x18\x03 \x01(\tR\x03urlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12L\n\x08features\x18\x06 \x03(\x0e2\x1f.metalstack.api.v2.ImageFeatureR\x08featuresB\x0f\xbaH\x0c\x92\x01\t\x18\x01"\x05\x82\x01\x02\x10\x01\x12X\n\x0eclassification\x18\x07 \x01(\x0e2&.metalstack.api.v2.ImageClassificationR\x0eclassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01\x129\n\nexpires_at\x18\x08 \x01(\x0b2\x1a.google.protobuf.TimestampR\texpiresAtB\x07\n\x05_nameB\x0e\n\x0c_description"U\n\nImageUsage\x12.\n\x05image\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image\x12\x17\n\x07used_by\x18\x02 \x03(\tR\x06usedBy"\xbe\x04\n\nImageQuery\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\x1f\n\x02os\x18\x02 \x01(\tH\x01R\x02osB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01\x88\x01\x01\x12)\n\x07version\x18\x03 \x01(\tH\x02R\x07versionB\n\xbaH\x07r\x05\x10\x01\x18\x80\x01\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tH\x03R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x04R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12"\n\x03url\x18\x06 \x01(\tH\x05R\x03urlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12H\n\x07feature\x18\x07 \x01(\x0e2\x1f.metalstack.api.v2.ImageFeatureH\x06R\x07featureB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12]\n\x0eclassification\x18\x08 \x01(\x0e2&.metalstack.api.v2.ImageClassificationH\x07R\x0eclassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x126\n\x06labels\x18\t \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x08R\x06labels\x88\x01\x01B\x05\n\x03_idB\x05\n\x03_osB\n\n\x08_versionB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x06\n\x04_urlB\n\n\x08_featureB\x11\n\x0f_classificationB\t\n\x07_labels*\x7f\n\x0cImageFeature\x12\x1d\n\x19IMAGE_FEATURE_UNSPECIFIED\x10\x00\x12&\n\x15IMAGE_FEATURE_MACHINE\x10\x01\x1a\x0b\x82\xb2\x19\x07machine\x12(\n\x16IMAGE_FEATURE_FIREWALL\x10\x02\x1a\x0c\x82\xb2\x19\x08firewall*\xd2\x01\n\x13ImageClassification\x12$\n IMAGE_CLASSIFICATION_UNSPECIFIED\x10\x00\x12-\n\x1cIMAGE_CLASSIFICATION_PREVIEW\x10\x01\x1a\x0b\x82\xb2\x19\x07preview\x121\n\x1eIMAGE_CLASSIFICATION_SUPPORTED\x10\x02\x1a\r\x82\xb2\x19\tsupported\x123\n\x1fIMAGE_CLASSIFICATION_DEPRECATED\x10\x03\x1a\x0e\x82\xb2\x19\ndeprecated2\xd2\x02\n\x0cImageService\x12f\n\x03Get\x12).metalstack.api.v2.ImageServiceGetRequest\x1a*.metalstack.api.v2.ImageServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12i\n\x04List\x12*.metalstack.api.v2.ImageServiceListRequest\x1a+.metalstack.api.v2.ImageServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12o\n\x06Latest\x12,.metalstack.api.v2.ImageServiceLatestRequest\x1a-.metalstack.api.v2.ImageServiceLatestResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xc0\x01\n\x15com.metalstack.api.v2B\nImageProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "ImageServiceGetRequest": ImageServiceGetRequest, + "ImageServiceListRequest": ImageServiceListRequest, + "ImageServiceLatestRequest": ImageServiceLatestRequest, + "ImageServiceGetResponse": ImageServiceGetResponse, + "ImageServiceListResponse": ImageServiceListResponse, + "ImageServiceLatestResponse": ImageServiceLatestResponse, + "Image": Image, + "ImageUsage": ImageUsage, + "ImageQuery": ImageQuery, + "ImageFeature": ImageFeature, + "ImageClassification": ImageClassification, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/image.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/image_pb2.py b/python/metalstack/api/v2/image_pb2.py deleted file mode 100644 index 7922ec57..00000000 --- a/python/metalstack/api/v2/image_pb2.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/image.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/image.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/api/v2/image.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"5\n\x16ImageServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"N\n\x17ImageServiceListRequest\x12\x33\n\x05query\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.ImageQueryR\x05query\"\x9d\x01\n\x19ImageServiceLatestRequest\x12\x0e\n\x02os\x18\x01 \x01(\tR\x02os\x12]\n\x0e\x63lassification\x18\x02 \x01(\x0e\x32&.metalstack.api.v2.ImageClassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x0e\x63lassification\x88\x01\x01\x42\x11\n\x0f_classification\"I\n\x17ImageServiceGetResponse\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"L\n\x18ImageServiceListResponse\x12\x30\n\x06images\x18\x01 \x03(\x0b\x32\x18.metalstack.api.v2.ImageR\x06images\"L\n\x1aImageServiceLatestResponse\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\"\xc6\x03\n\x05Image\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x1d\n\x03url\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\x03url\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12L\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0e\x32\x1f.metalstack.api.v2.ImageFeatureB\x0f\xbaH\x0c\x92\x01\t\x18\x01\"\x05\x82\x01\x02\x10\x01R\x08\x66\x65\x61tures\x12X\n\x0e\x63lassification\x18\x07 \x01(\x0e\x32&.metalstack.api.v2.ImageClassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0e\x63lassification\x12\x39\n\nexpires_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAtB\x07\n\x05_nameB\x0e\n\x0c_description\"U\n\nImageUsage\x12.\n\x05image\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\x12\x17\n\x07used_by\x18\x02 \x03(\tR\x06usedBy\"\xbe\x04\n\nImageQuery\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12\x1f\n\x02os\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x01R\x02os\x88\x01\x01\x12)\n\x07version\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x01\x18\x80\x01H\x02R\x07version\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x04R\x0b\x64\x65scription\x88\x01\x01\x12\"\n\x03url\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x05R\x03url\x88\x01\x01\x12H\n\x07\x66\x65\x61ture\x18\x07 \x01(\x0e\x32\x1f.metalstack.api.v2.ImageFeatureB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x06R\x07\x66\x65\x61ture\x88\x01\x01\x12]\n\x0e\x63lassification\x18\x08 \x01(\x0e\x32&.metalstack.api.v2.ImageClassificationB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x07R\x0e\x63lassification\x88\x01\x01\x12\x36\n\x06labels\x18\t \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x08R\x06labels\x88\x01\x01\x42\x05\n\x03_idB\x05\n\x03_osB\n\n\x08_versionB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x06\n\x04_urlB\n\n\x08_featureB\x11\n\x0f_classificationB\t\n\x07_labels*\x7f\n\x0cImageFeature\x12\x1d\n\x19IMAGE_FEATURE_UNSPECIFIED\x10\x00\x12&\n\x15IMAGE_FEATURE_MACHINE\x10\x01\x1a\x0b\x82\xb2\x19\x07machine\x12(\n\x16IMAGE_FEATURE_FIREWALL\x10\x02\x1a\x0c\x82\xb2\x19\x08\x66irewall*\xd2\x01\n\x13ImageClassification\x12$\n IMAGE_CLASSIFICATION_UNSPECIFIED\x10\x00\x12-\n\x1cIMAGE_CLASSIFICATION_PREVIEW\x10\x01\x1a\x0b\x82\xb2\x19\x07preview\x12\x31\n\x1eIMAGE_CLASSIFICATION_SUPPORTED\x10\x02\x1a\r\x82\xb2\x19\tsupported\x12\x33\n\x1fIMAGE_CLASSIFICATION_DEPRECATED\x10\x03\x1a\x0e\x82\xb2\x19\ndeprecated2\xd2\x02\n\x0cImageService\x12\x66\n\x03Get\x12).metalstack.api.v2.ImageServiceGetRequest\x1a*.metalstack.api.v2.ImageServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12i\n\x04List\x12*.metalstack.api.v2.ImageServiceListRequest\x1a+.metalstack.api.v2.ImageServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12o\n\x06Latest\x12,.metalstack.api.v2.ImageServiceLatestRequest\x1a-.metalstack.api.v2.ImageServiceLatestResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xc0\x01\n\x15\x63om.metalstack.api.v2B\nImageProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.image_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\nImageProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_IMAGEFEATURE'].values_by_name["IMAGE_FEATURE_MACHINE"]._loaded_options = None - _globals['_IMAGEFEATURE'].values_by_name["IMAGE_FEATURE_MACHINE"]._serialized_options = b'\202\262\031\007machine' - _globals['_IMAGEFEATURE'].values_by_name["IMAGE_FEATURE_FIREWALL"]._loaded_options = None - _globals['_IMAGEFEATURE'].values_by_name["IMAGE_FEATURE_FIREWALL"]._serialized_options = b'\202\262\031\010firewall' - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_PREVIEW"]._loaded_options = None - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_PREVIEW"]._serialized_options = b'\202\262\031\007preview' - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_SUPPORTED"]._loaded_options = None - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_SUPPORTED"]._serialized_options = b'\202\262\031\tsupported' - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_DEPRECATED"]._loaded_options = None - _globals['_IMAGECLASSIFICATION'].values_by_name["IMAGE_CLASSIFICATION_DEPRECATED"]._serialized_options = b'\202\262\031\ndeprecated' - _globals['_IMAGESERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_IMAGESERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGESERVICELATESTREQUEST'].fields_by_name['classification']._loaded_options = None - _globals['_IMAGESERVICELATESTREQUEST'].fields_by_name['classification']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IMAGE'].fields_by_name['id']._loaded_options = None - _globals['_IMAGE'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGE'].fields_by_name['url']._loaded_options = None - _globals['_IMAGE'].fields_by_name['url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_IMAGE'].fields_by_name['name']._loaded_options = None - _globals['_IMAGE'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGE'].fields_by_name['description']._loaded_options = None - _globals['_IMAGE'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IMAGE'].fields_by_name['features']._loaded_options = None - _globals['_IMAGE'].fields_by_name['features']._serialized_options = b'\272H\014\222\001\t\030\001\"\005\202\001\002\020\001' - _globals['_IMAGE'].fields_by_name['classification']._loaded_options = None - _globals['_IMAGE'].fields_by_name['classification']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IMAGEQUERY'].fields_by_name['id']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGEQUERY'].fields_by_name['os']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['os']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_IMAGEQUERY'].fields_by_name['version']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['version']._serialized_options = b'\272H\007r\005\020\001\030\200\001' - _globals['_IMAGEQUERY'].fields_by_name['name']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGEQUERY'].fields_by_name['description']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IMAGEQUERY'].fields_by_name['url']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_IMAGEQUERY'].fields_by_name['feature']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['feature']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IMAGEQUERY'].fields_by_name['classification']._loaded_options = None - _globals['_IMAGEQUERY'].fields_by_name['classification']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IMAGESERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_IMAGESERVICE'].methods_by_name['List']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_IMAGESERVICE'].methods_by_name['Latest']._loaded_options = None - _globals['_IMAGESERVICE'].methods_by_name['Latest']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_IMAGEFEATURE']._serialized_start=1835 - _globals['_IMAGEFEATURE']._serialized_end=1962 - _globals['_IMAGECLASSIFICATION']._serialized_start=1965 - _globals['_IMAGECLASSIFICATION']._serialized_end=2175 - _globals['_IMAGESERVICEGETREQUEST']._serialized_start=188 - _globals['_IMAGESERVICEGETREQUEST']._serialized_end=241 - _globals['_IMAGESERVICELISTREQUEST']._serialized_start=243 - _globals['_IMAGESERVICELISTREQUEST']._serialized_end=321 - _globals['_IMAGESERVICELATESTREQUEST']._serialized_start=324 - _globals['_IMAGESERVICELATESTREQUEST']._serialized_end=481 - _globals['_IMAGESERVICEGETRESPONSE']._serialized_start=483 - _globals['_IMAGESERVICEGETRESPONSE']._serialized_end=556 - _globals['_IMAGESERVICELISTRESPONSE']._serialized_start=558 - _globals['_IMAGESERVICELISTRESPONSE']._serialized_end=634 - _globals['_IMAGESERVICELATESTRESPONSE']._serialized_start=636 - _globals['_IMAGESERVICELATESTRESPONSE']._serialized_end=712 - _globals['_IMAGE']._serialized_start=715 - _globals['_IMAGE']._serialized_end=1169 - _globals['_IMAGEUSAGE']._serialized_start=1171 - _globals['_IMAGEUSAGE']._serialized_end=1256 - _globals['_IMAGEQUERY']._serialized_start=1259 - _globals['_IMAGEQUERY']._serialized_end=1833 - _globals['_IMAGESERVICE']._serialized_start=2178 - _globals['_IMAGESERVICE']._serialized_end=2516 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/image_pb2.pyi b/python/metalstack/api/v2/image_pb2.pyi deleted file mode 100644 index b2051b1b..00000000 --- a/python/metalstack/api/v2/image_pb2.pyi +++ /dev/null @@ -1,122 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ImageFeature(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - IMAGE_FEATURE_UNSPECIFIED: _ClassVar[ImageFeature] - IMAGE_FEATURE_MACHINE: _ClassVar[ImageFeature] - IMAGE_FEATURE_FIREWALL: _ClassVar[ImageFeature] - -class ImageClassification(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - IMAGE_CLASSIFICATION_UNSPECIFIED: _ClassVar[ImageClassification] - IMAGE_CLASSIFICATION_PREVIEW: _ClassVar[ImageClassification] - IMAGE_CLASSIFICATION_SUPPORTED: _ClassVar[ImageClassification] - IMAGE_CLASSIFICATION_DEPRECATED: _ClassVar[ImageClassification] -IMAGE_FEATURE_UNSPECIFIED: ImageFeature -IMAGE_FEATURE_MACHINE: ImageFeature -IMAGE_FEATURE_FIREWALL: ImageFeature -IMAGE_CLASSIFICATION_UNSPECIFIED: ImageClassification -IMAGE_CLASSIFICATION_PREVIEW: ImageClassification -IMAGE_CLASSIFICATION_SUPPORTED: ImageClassification -IMAGE_CLASSIFICATION_DEPRECATED: ImageClassification - -class ImageServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class ImageServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: ImageQuery - def __init__(self, query: _Optional[_Union[ImageQuery, _Mapping]] = ...) -> None: ... - -class ImageServiceLatestRequest(_message.Message): - __slots__ = ("os", "classification") - OS_FIELD_NUMBER: _ClassVar[int] - CLASSIFICATION_FIELD_NUMBER: _ClassVar[int] - os: str - classification: ImageClassification - def __init__(self, os: _Optional[str] = ..., classification: _Optional[_Union[ImageClassification, str]] = ...) -> None: ... - -class ImageServiceGetResponse(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: Image - def __init__(self, image: _Optional[_Union[Image, _Mapping]] = ...) -> None: ... - -class ImageServiceListResponse(_message.Message): - __slots__ = ("images",) - IMAGES_FIELD_NUMBER: _ClassVar[int] - images: _containers.RepeatedCompositeFieldContainer[Image] - def __init__(self, images: _Optional[_Iterable[_Union[Image, _Mapping]]] = ...) -> None: ... - -class ImageServiceLatestResponse(_message.Message): - __slots__ = ("image",) - IMAGE_FIELD_NUMBER: _ClassVar[int] - image: Image - def __init__(self, image: _Optional[_Union[Image, _Mapping]] = ...) -> None: ... - -class Image(_message.Message): - __slots__ = ("id", "meta", "url", "name", "description", "features", "classification", "expires_at") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - FEATURES_FIELD_NUMBER: _ClassVar[int] - CLASSIFICATION_FIELD_NUMBER: _ClassVar[int] - EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - url: str - name: str - description: str - features: _containers.RepeatedScalarFieldContainer[ImageFeature] - classification: ImageClassification - expires_at: _timestamp_pb2.Timestamp - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., url: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., features: _Optional[_Iterable[_Union[ImageFeature, str]]] = ..., classification: _Optional[_Union[ImageClassification, str]] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class ImageUsage(_message.Message): - __slots__ = ("image", "used_by") - IMAGE_FIELD_NUMBER: _ClassVar[int] - USED_BY_FIELD_NUMBER: _ClassVar[int] - image: Image - used_by: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, image: _Optional[_Union[Image, _Mapping]] = ..., used_by: _Optional[_Iterable[str]] = ...) -> None: ... - -class ImageQuery(_message.Message): - __slots__ = ("id", "os", "version", "name", "description", "url", "feature", "classification", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - OS_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - FEATURE_FIELD_NUMBER: _ClassVar[int] - CLASSIFICATION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - os: str - version: str - name: str - description: str - url: str - feature: ImageFeature - classification: ImageClassification - labels: _common_pb2.Labels - def __init__(self, id: _Optional[str] = ..., os: _Optional[str] = ..., version: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., url: _Optional[str] = ..., feature: _Optional[_Union[ImageFeature, str]] = ..., classification: _Optional[_Union[ImageClassification, str]] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/ip_connect.py b/python/metalstack/api/v2/ip_connect.py index 0e87d82b..b51e72c8 100644 --- a/python/metalstack/api/v2/ip_connect.py +++ b/python/metalstack/api/v2/ip_connect.py @@ -1,41 +1,57 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/ip.proto +# Generated from metalstack/api/v2/ip.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.ip_pb2 as metalstack_dot_api_dot_v2_dot_ip__pb2 + +from .ip_pb import IPServiceCreateRequest, IPServiceCreateResponse, IPServiceDeleteRequest, IPServiceDeleteResponse, IPServiceGetRequest, IPServiceGetResponse, IPServiceListRequest, IPServiceListResponse, IPServiceUpdateRequest, IPServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class IPService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: IPServiceGetRequest, ctx: RequestContext[IPServiceGetRequest, IPServiceGetResponse]) -> IPServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: IPServiceCreateRequest, ctx: RequestContext[IPServiceCreateRequest, IPServiceCreateResponse]) -> IPServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: IPServiceUpdateRequest, ctx: RequestContext[IPServiceUpdateRequest, IPServiceUpdateResponse]) -> IPServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: IPServiceListRequest, ctx: RequestContext[IPServiceListRequest, IPServiceListResponse]) -> IPServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: IPServiceDeleteRequest, ctx: RequestContext[IPServiceDeleteRequest, IPServiceDeleteResponse]) -> IPServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class IPServiceASGIApplication(ConnectASGIApplication[IPService]): - def __init__(self, service: IPService | AsyncGenerator[IPService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: IPService | AsyncGenerator[IPService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -43,8 +59,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="Get", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse, + input=IPServiceGetRequest, + output=IPServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -53,8 +69,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="Create", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse, + input=IPServiceCreateRequest, + output=IPServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -63,8 +79,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="Update", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse, + input=IPServiceUpdateRequest, + output=IPServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -73,8 +89,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="List", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -83,8 +99,8 @@ def __init__(self, service: IPService | AsyncGenerator[IPService], *, intercepto method=MethodInfo( name="Delete", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse, + input=IPServiceDeleteRequest, + output=IPServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -105,18 +121,18 @@ def path(self) -> str: class IPServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, + request: IPServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse: + ) -> IPServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse, + input=IPServiceGetRequest, + output=IPServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -125,18 +141,18 @@ async def get( async def create( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, + request: IPServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse: + ) -> IPServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse, + input=IPServiceCreateRequest, + output=IPServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -145,18 +161,18 @@ async def create( async def update( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, + request: IPServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse: + ) -> IPServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse, + input=IPServiceUpdateRequest, + output=IPServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -165,18 +181,18 @@ async def update( async def list( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, + request: IPServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse: + ) -> IPServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -185,51 +201,58 @@ async def list( async def delete( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, + request: IPServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse: + ) -> IPServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse, + input=IPServiceDeleteRequest, + output=IPServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class IPServiceSync(Protocol): + def get(self, request: IPServiceGetRequest, ctx: RequestContext[IPServiceGetRequest, IPServiceGetResponse]) -> IPServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def create(self, request: IPServiceCreateRequest, ctx: RequestContext[IPServiceCreateRequest, IPServiceCreateResponse]) -> IPServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: IPServiceUpdateRequest, ctx: RequestContext[IPServiceUpdateRequest, IPServiceUpdateResponse]) -> IPServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: IPServiceListRequest, ctx: RequestContext[IPServiceListRequest, IPServiceListResponse]) -> IPServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class IPServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def delete(self, request: IPServiceDeleteRequest, ctx: RequestContext[IPServiceDeleteRequest, IPServiceDeleteResponse]) -> IPServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class IPServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: IPServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.IPService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse, + input=IPServiceGetRequest, + output=IPServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -238,8 +261,8 @@ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSyn method=MethodInfo( name="Create", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse, + input=IPServiceCreateRequest, + output=IPServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -248,8 +271,8 @@ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSyn method=MethodInfo( name="Update", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse, + input=IPServiceUpdateRequest, + output=IPServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -258,8 +281,8 @@ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSyn method=MethodInfo( name="List", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -268,8 +291,8 @@ def __init__(self, service: IPServiceSync, interceptors: Iterable[InterceptorSyn method=MethodInfo( name="Delete", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse, + input=IPServiceDeleteRequest, + output=IPServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -290,102 +313,96 @@ def path(self) -> str: class IPServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, + request: IPServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse: + ) -> IPServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceGetResponse, + input=IPServiceGetRequest, + output=IPServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, + request: IPServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse: + ) -> IPServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceCreateResponse, + input=IPServiceCreateRequest, + output=IPServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, + request: IPServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse: + ) -> IPServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceUpdateResponse, + input=IPServiceUpdateRequest, + output=IPServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, + request: IPServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse: + ) -> IPServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceListResponse, + input=IPServiceListRequest, + output=IPServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, + request: IPServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse: + ) -> IPServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.IPService", - input=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_ip__pb2.IPServiceDeleteResponse, + input=IPServiceDeleteRequest, + output=IPServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/ip_pb.py b/python/metalstack/api/v2/ip_pb.py new file mode 100644 index 00000000..59355a9a --- /dev/null +++ b/python/metalstack/api/v2/ip_pb.py @@ -0,0 +1,791 @@ +# Generated from metalstack/api/v2/ip.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Labels, Meta, UpdateLabels, UpdateMeta + + +_IPFields: TypeAlias = Literal["uuid", "meta", "ip", "name", "description", "network", "project", "type", "namespace"] + +class IP(Message[_IPFields]): + """ + IP is an IP address which can be used as loadbalancer addresses + + ```proto + message metalstack.api.v2.IP + ``` + + Attributes: + uuid: + Uuid of this ip + + ```proto + string uuid = 1; + ``` + meta: + Meta for this ip + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + ip: + Ip is either ipv4 or ipv6 address + + ```proto + string ip = 3; + ``` + name: + Name of this ip + + ```proto + string name = 4; + ``` + description: + Description of this ip + + ```proto + string description = 5; + ``` + network: + Network is the network this ip belongs to + + ```proto + string network = 6; + ``` + project: + Project where this ip address belongs to + + ```proto + string project = 7; + ``` + type: + Type of this ip + + ```proto + metalstack.api.v2.IPType type = 8; + ``` + namespace: + Namespace if specified this ip is from a namespaced network and can therefore overlap with others + Will be equal with project most of the time + + ```proto + optional string namespace = 9; + ``` + """ + + __slots__ = ("uuid", "meta", "ip", "name", "description", "network", "project", "type", "namespace") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + meta: Meta | None = None, + ip: str = "", + name: str = "", + description: str = "", + network: str = "", + project: str = "", + type: IPType | None = None, + namespace: str | None = None, + ) -> None: + pass + + uuid: str + meta: Meta | None + ip: str + name: str + description: str + network: str + project: str + type: IPType + namespace: str + +_IPServiceGetRequestFields: TypeAlias = Literal["ip", "project", "namespace"] + +class IPServiceGetRequest(Message[_IPServiceGetRequestFields]): + """ + IPServiceGetRequest is the request payload for an IP get request + + ```proto + message metalstack.api.v2.IPServiceGetRequest + ``` + + Attributes: + ip: + IP of the ip to get + + ```proto + string ip = 1; + ``` + project: + Project of the ip + + ```proto + string project = 2; + ``` + namespace: + Namespace can be specified to get the ip of a namespace. + + ```proto + optional string namespace = 3; + ``` + """ + + __slots__ = ("ip", "project", "namespace") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: str = "", + project: str = "", + namespace: str | None = None, + ) -> None: + pass + + ip: str + project: str + namespace: str + +_IPServiceCreateRequestFields: TypeAlias = Literal["network", "project", "name", "description", "ip", "machine", "labels", "type", "address_family"] + +class IPServiceCreateRequest(Message[_IPServiceCreateRequestFields]): + """ + IPServiceCreateRequest is the request payload for an IP create request + + ```proto + message metalstack.api.v2.IPServiceCreateRequest + ``` + + Attributes: + network: + Network from which the IP should be created + + ```proto + string network = 1; + ``` + project: + Project of the ip + + ```proto + string project = 2; + ``` + name: + Name of the ip + + ```proto + optional string name = 3; + ``` + description: + Description of the ip + + ```proto + optional string description = 4; + ``` + ip: + IP if given try to create this ip if still available + + ```proto + optional string ip = 5; + ``` + machine: + Machine for which this ip should get created + + ```proto + optional string machine = 6; + ``` + labels: + Labels to put onto the ip + + ```proto + optional metalstack.api.v2.Labels labels = 7; + ``` + type: + Type of the IP, ether ephemeral (default), or static + + ```proto + optional metalstack.api.v2.IPType type = 8; + ``` + address_family: + Addressfamily of the IP to create, defaults to ipv4 + + ```proto + optional metalstack.api.v2.IPAddressFamily address_family = 9; + ``` + """ + + __slots__ = ("network", "project", "name", "description", "ip", "machine", "labels", "type", "address_family") + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: str = "", + project: str = "", + name: str | None = None, + description: str | None = None, + ip: str | None = None, + machine: str | None = None, + labels: Labels | None = None, + type: IPType | None = None, + address_family: IPAddressFamily | None = None, + ) -> None: + pass + + network: str + project: str + name: str + description: str + ip: str + machine: str + labels: Labels | None + type: IPType + address_family: IPAddressFamily + +_IPServiceUpdateRequestFields: TypeAlias = Literal["ip", "update_meta", "project", "name", "description", "type", "labels"] + +class IPServiceUpdateRequest(Message[_IPServiceUpdateRequestFields]): + """ + IPServiceUpdateRequest is the request payload for an IP update request + + ```proto + message metalstack.api.v2.IPServiceUpdateRequest + ``` + + Attributes: + ip: + Ip the ip address to update + + ```proto + string ip = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + project: + Project id of the ip + + ```proto + string project = 3; + ``` + name: + Name of this ip + + ```proto + optional string name = 4; + ``` + description: + Description of this ip + + ```proto + optional string description = 5; + ``` + type: + Type of this ip + + ```proto + optional metalstack.api.v2.IPType type = 6; + ``` + labels: + Labels on this ip + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 7; + ``` + """ + + __slots__ = ("ip", "update_meta", "project", "name", "description", "type", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: str = "", + update_meta: UpdateMeta | None = None, + project: str = "", + name: str | None = None, + description: str | None = None, + type: IPType | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + ip: str + update_meta: UpdateMeta | None + project: str + name: str + description: str + type: IPType + labels: UpdateLabels | None + +_IPServiceListRequestFields: TypeAlias = Literal["project", "query"] + +class IPServiceListRequest(Message[_IPServiceListRequestFields]): + """ + IPServiceListRequest is the request payload for an IP list request + + ```proto + message metalstack.api.v2.IPServiceListRequest + ``` + + Attributes: + project: + Project of the ips to list + + ```proto + string project = 1; + ``` + query: + Query to list one or more IPs + + ```proto + optional metalstack.api.v2.IPQuery query = 2; + ``` + """ + + __slots__ = ("project", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + query: IPQuery | None = None, + ) -> None: + pass + + project: str + query: IPQuery | None + +_IPQueryFields: TypeAlias = Literal["ip", "network", "project", "name", "uuid", "machine", "parent_prefix_cidr", "labels", "type", "address_family", "namespace"] + +class IPQuery(Message[_IPQueryFields]): + """ + IPQuery can be used to query a IP or a list of IP + + ```proto + message metalstack.api.v2.IPQuery + ``` + + Attributes: + ip: + Ip the ip to list + + ```proto + optional string ip = 1; + ``` + network: + Network from which the IPs are to list + + ```proto + optional string network = 2; + ``` + project: + Project of the ips to list + + ```proto + optional string project = 3; + ``` + name: + Name of this ip + + ```proto + optional string name = 4; + ``` + uuid: + UUID for which these IPs should be filtered + + ```proto + optional string uuid = 5; + ``` + machine: + Machine for which these IPs should be filtered + + ```proto + optional string machine = 6; + ``` + parent_prefix_cidr: + ParentPrefixCidr for which this ips should get filtered + + ```proto + optional string parent_prefix_cidr = 7; + ``` + labels: + Labels for which these IPs should be filtered + + ```proto + optional metalstack.api.v2.Labels labels = 8; + ``` + type: + Static if set to true, this will be a Static ip + + ```proto + optional metalstack.api.v2.IPType type = 9; + ``` + address_family: + Address family of the IPs to list, defaults to all address families + + ```proto + optional metalstack.api.v2.IPAddressFamily address_family = 10; + ``` + namespace: + Namespace can be specified to get the ip of a namespace. + + ```proto + optional string namespace = 11; + ``` + """ + + __slots__ = ("ip", "network", "project", "name", "uuid", "machine", "parent_prefix_cidr", "labels", "type", "address_family", "namespace") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: str | None = None, + network: str | None = None, + project: str | None = None, + name: str | None = None, + uuid: str | None = None, + machine: str | None = None, + parent_prefix_cidr: str | None = None, + labels: Labels | None = None, + type: IPType | None = None, + address_family: IPAddressFamily | None = None, + namespace: str | None = None, + ) -> None: + pass + + ip: str + network: str + project: str + name: str + uuid: str + machine: str + parent_prefix_cidr: str + labels: Labels | None + type: IPType + address_family: IPAddressFamily + namespace: str + +_IPServiceDeleteRequestFields: TypeAlias = Literal["ip", "project"] + +class IPServiceDeleteRequest(Message[_IPServiceDeleteRequestFields]): + """ + IPServiceDeleteRequest is the request payload for a ip delete request + + ```proto + message metalstack.api.v2.IPServiceDeleteRequest + ``` + + Attributes: + ip: + IP of the ip to delete + + ```proto + string ip = 1; + ``` + project: + Project of the ip + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("ip", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: str = "", + project: str = "", + ) -> None: + pass + + ip: str + project: str + +_IPServiceGetResponseFields: TypeAlias = Literal["ip"] + +class IPServiceGetResponse(Message[_IPServiceGetResponseFields]): + """ + IPServiceGetResponse is the response payload for an IP get request + + ```proto + message metalstack.api.v2.IPServiceGetResponse + ``` + + Attributes: + ip: + Ip the ip + + ```proto + optional metalstack.api.v2.IP ip = 1; + ``` + """ + + __slots__ = ("ip",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: IP | None = None, + ) -> None: + pass + + ip: IP | None + +_IPServiceUpdateResponseFields: TypeAlias = Literal["ip"] + +class IPServiceUpdateResponse(Message[_IPServiceUpdateResponseFields]): + """ + IPServiceUpdateResponse is the response payload for a ip update request + + ```proto + message metalstack.api.v2.IPServiceUpdateResponse + ``` + + Attributes: + ip: + Ip the ip + + ```proto + optional metalstack.api.v2.IP ip = 1; + ``` + """ + + __slots__ = ("ip",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: IP | None = None, + ) -> None: + pass + + ip: IP | None + +_IPServiceCreateResponseFields: TypeAlias = Literal["ip"] + +class IPServiceCreateResponse(Message[_IPServiceCreateResponseFields]): + """ + IPServiceCreateResponse is the response payload for an IP create request + + ```proto + message metalstack.api.v2.IPServiceCreateResponse + ``` + + Attributes: + ip: + Ip the ip + + ```proto + optional metalstack.api.v2.IP ip = 1; + ``` + """ + + __slots__ = ("ip",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: IP | None = None, + ) -> None: + pass + + ip: IP | None + +_IPServiceListResponseFields: TypeAlias = Literal["ips"] + +class IPServiceListResponse(Message[_IPServiceListResponseFields]): + """ + IPServiceListResponse is the response payload for an IP list request + + ```proto + message metalstack.api.v2.IPServiceListResponse + ``` + + Attributes: + ips: + Ips the ips + + ```proto + repeated metalstack.api.v2.IP ips = 1; + ``` + """ + + __slots__ = ("ips",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ips: list[IP] | None = None, + ) -> None: + pass + + ips: list[IP] + +_IPServiceDeleteResponseFields: TypeAlias = Literal["ip"] + +class IPServiceDeleteResponse(Message[_IPServiceDeleteResponseFields]): + """ + IPServiceDeleteResponse is the response payload for an IP delete request + + ```proto + message metalstack.api.v2.IPServiceDeleteResponse + ``` + + Attributes: + ip: + Ip the ip + + ```proto + optional metalstack.api.v2.IP ip = 1; + ``` + """ + + __slots__ = ("ip",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: IP | None = None, + ) -> None: + pass + + ip: IP | None + +class IPType(Enum): + """ + IPType specifies different IP address types + + ```proto + enum metalstack.api.v2.IPType + ``` + + Attributes: + UNSPECIFIED: + IP_TYPE_UNSPECIFIED is not specified + + ```proto + IP_TYPE_UNSPECIFIED = 0 + ``` + EPHEMERAL: + IP_TYPE_EPHEMERAL defines an ephemeral IP address which is freed/deleted after usage + + ```proto + IP_TYPE_EPHEMERAL = 1 + ``` + STATIC: + IP_TYPE_STATIC defines a static ip address which must be freed/deleted explicitly + + ```proto + IP_TYPE_STATIC = 2 + ``` + """ + + UNSPECIFIED = 0 + EPHEMERAL = 1 + STATIC = 2 + +class IPAddressFamily(Enum): + """ + IPAddressFamily defines either IPv4 or IPv6 Addressfamily + + ```proto + enum metalstack.api.v2.IPAddressFamily + ``` + + Attributes: + UNSPECIFIED: + IP_ADDRESS_FAMILY_UNSPECIFIED is not specified + + ```proto + IP_ADDRESS_FAMILY_UNSPECIFIED = 0 + ``` + V4: + IP_ADDRESS_FAMILY_V4 defines a IPv4 address + + ```proto + IP_ADDRESS_FAMILY_V4 = 1 + ``` + V6: + IP_ADDRESS_FAMILY_V6 defines a IPv6 address + + ```proto + IP_ADDRESS_FAMILY_V6 = 2 + ``` + """ + + UNSPECIFIED = 0 + V4 = 1 + V6 = 2 + + +_DESC = file_desc( + b'\n\x1ametalstack/api/v2/ip.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xf7\x02\n\x02IP\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x17\n\x02ip\x18\x03 \x01(\tR\x02ipB\x07\xbaH\x04r\x02p\x01\x12\x1f\n\x04name\x18\x04 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x0bdescription\x18\x05 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12%\n\x07network\x18\x06 \x01(\tR\x07networkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12"\n\x07project\x18\x07 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x127\n\x04type\x18\x08 \x01(\x0e2\x19.metalstack.api.v2.IPTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12+\n\tnamespace\x18\t \x01(\tH\x00R\tnamespaceB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\x0c\n\n_namespace"\x8d\x01\n\x13IPServiceGetRequest\x12\x17\n\x02ip\x18\x01 \x01(\tR\x02ipB\x07\xbaH\x04r\x02p\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12+\n\tnamespace\x18\x03 \x01(\tH\x00R\tnamespaceB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\x0c\n\n_namespace"\xa7\x04\n\x16IPServiceCreateRequest\x12%\n\x07network\x18\x01 \x01(\tR\x07networkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\x1c\n\x02ip\x18\x05 \x01(\tH\x02R\x02ipB\x07\xbaH\x04r\x02p\x01\x88\x01\x01\x12\'\n\x07machine\x18\x06 \x01(\tH\x03R\x07machineB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x126\n\x06labels\x18\x07 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x04R\x06labels\x88\x01\x01\x12<\n\x04type\x18\x08 \x01(\x0e2\x19.metalstack.api.v2.IPTypeH\x05R\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12X\n\x0eaddress_family\x18\t \x01(\x0e2".metalstack.api.v2.IPAddressFamilyH\x06R\raddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x05\n\x03_ipB\n\n\x08_machineB\t\n\x07_labelsB\x07\n\x05_typeB\x11\n\x0f_address_family"\xa0\x03\n\x16IPServiceUpdateRequest\x12\x17\n\x02ip\x18\x01 \x01(\tR\x02ipB\x07\xbaH\x04r\x02p\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12"\n\x07project\x18\x03 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x04type\x18\x06 \x01(\x0e2\x19.metalstack.api.v2.IPTypeH\x02R\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_typeB\t\n\x07_labels"l\n\x14IPServiceListRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x120\n\x05query\x18\x02 \x01(\x0b2\x1a.metalstack.api.v2.IPQueryR\x05query"\xb1\x05\n\x07IPQuery\x12\x1c\n\x02ip\x18\x01 \x01(\tH\x00R\x02ipB\x07\xbaH\x04r\x02p\x01\x88\x01\x01\x12*\n\x07network\x18\x02 \x01(\tH\x01R\x07networkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tH\x02R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tH\x03R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12!\n\x04uuid\x18\x05 \x01(\tH\x04R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12\'\n\x07machine\x18\x06 \x01(\tH\x05R\x07machineB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12;\n\x12parent_prefix_cidr\x18\x07 \x01(\tH\x06R\x10parentPrefixCidrB\x08\xbaH\x05r\x03\xe8\x01\x01\x88\x01\x01\x126\n\x06labels\x18\x08 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x07R\x06labels\x88\x01\x01\x12<\n\x04type\x18\t \x01(\x0e2\x19.metalstack.api.v2.IPTypeH\x08R\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12X\n\x0eaddress_family\x18\n \x01(\x0e2".metalstack.api.v2.IPAddressFamilyH\tR\raddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12+\n\tnamespace\x18\x0b \x01(\tH\nR\tnamespaceB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\x05\n\x03_ipB\n\n\x08_networkB\n\n\x08_projectB\x07\n\x05_nameB\x07\n\x05_uuidB\n\n\x08_machineB\x15\n\x13_parent_prefix_cidrB\t\n\x07_labelsB\x07\n\x05_typeB\x11\n\x0f_address_familyB\x0c\n\n_namespace"U\n\x16IPServiceDeleteRequest\x12\x17\n\x02ip\x18\x01 \x01(\tR\x02ipB\x07\xbaH\x04r\x02p\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"=\n\x14IPServiceGetResponse\x12%\n\x02ip\x18\x01 \x01(\x0b2\x15.metalstack.api.v2.IPR\x02ip"@\n\x17IPServiceUpdateResponse\x12%\n\x02ip\x18\x01 \x01(\x0b2\x15.metalstack.api.v2.IPR\x02ip"@\n\x17IPServiceCreateResponse\x12%\n\x02ip\x18\x01 \x01(\x0b2\x15.metalstack.api.v2.IPR\x02ip"@\n\x15IPServiceListResponse\x12\'\n\x03ips\x18\x01 \x03(\x0b2\x15.metalstack.api.v2.IPR\x03ips"@\n\x17IPServiceDeleteResponse\x12%\n\x02ip\x18\x01 \x01(\x0b2\x15.metalstack.api.v2.IPR\x02ip*g\n\x06IPType\x12\x17\n\x13IP_TYPE_UNSPECIFIED\x10\x00\x12$\n\x11IP_TYPE_EPHEMERAL\x10\x01\x1a\r\x82\xb2\x19\tephemeral\x12\x1e\n\x0eIP_TYPE_STATIC\x10\x02\x1a\n\x82\xb2\x19\x06static*|\n\x0fIPAddressFamily\x12!\n\x1dIP_ADDRESS_FAMILY_UNSPECIFIED\x10\x00\x12"\n\x14IP_ADDRESS_FAMILY_V4\x10\x01\x1a\x08\x82\xb2\x19\x04ipv4\x12"\n\x14IP_ADDRESS_FAMILY_V6\x10\x02\x1a\x08\x82\xb2\x19\x04ipv62\x9f\x04\n\tIPService\x12c\n\x03Get\x12&.metalstack.api.v2.IPServiceGetRequest\x1a\'.metalstack.api.v2.IPServiceGetResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12k\n\x06Create\x12).metalstack.api.v2.IPServiceCreateRequest\x1a*.metalstack.api.v2.IPServiceCreateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12k\n\x06Update\x12).metalstack.api.v2.IPServiceUpdateRequest\x1a*.metalstack.api.v2.IPServiceUpdateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12f\n\x04List\x12\'.metalstack.api.v2.IPServiceListRequest\x1a(.metalstack.api.v2.IPServiceListResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12k\n\x06Delete\x12).metalstack.api.v2.IPServiceDeleteRequest\x1a*.metalstack.api.v2.IPServiceDeleteResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xbd\x01\n\x15com.metalstack.api.v2B\x07IpProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "IP": IP, + "IPServiceGetRequest": IPServiceGetRequest, + "IPServiceCreateRequest": IPServiceCreateRequest, + "IPServiceUpdateRequest": IPServiceUpdateRequest, + "IPServiceListRequest": IPServiceListRequest, + "IPQuery": IPQuery, + "IPServiceDeleteRequest": IPServiceDeleteRequest, + "IPServiceGetResponse": IPServiceGetResponse, + "IPServiceUpdateResponse": IPServiceUpdateResponse, + "IPServiceCreateResponse": IPServiceCreateResponse, + "IPServiceListResponse": IPServiceListResponse, + "IPServiceDeleteResponse": IPServiceDeleteResponse, + "IPType": IPType, + "IPAddressFamily": IPAddressFamily, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/ip.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/ip_pb2.py b/python/metalstack/api/v2/ip_pb2.py deleted file mode 100644 index 138d1c2b..00000000 --- a/python/metalstack/api/v2/ip_pb2.py +++ /dev/null @@ -1,162 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/ip.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/ip.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1ametalstack/api/v2/ip.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xf7\x02\n\x02IP\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x17\n\x02ip\x18\x03 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x02ip\x12\x1f\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12-\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12%\n\x07network\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07network\x12\"\n\x07project\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x37\n\x04type\x18\x08 \x01(\x0e\x32\x19.metalstack.api.v2.IPTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12+\n\tnamespace\x18\t \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\tnamespace\x88\x01\x01\x42\x0c\n\n_namespace\"\x8d\x01\n\x13IPServiceGetRequest\x12\x17\n\x02ip\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x02ip\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12+\n\tnamespace\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\tnamespace\x88\x01\x01\x42\x0c\n\n_namespace\"\xa7\x04\n\x16IPServiceCreateRequest\x12%\n\x07network\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07network\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x1c\n\x02ip\x18\x05 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x02R\x02ip\x88\x01\x01\x12\'\n\x07machine\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x03R\x07machine\x88\x01\x01\x12\x36\n\x06labels\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x04R\x06labels\x88\x01\x01\x12<\n\x04type\x18\x08 \x01(\x0e\x32\x19.metalstack.api.v2.IPTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x05R\x04type\x88\x01\x01\x12X\n\x0e\x61\x64\x64ress_family\x18\t \x01(\x0e\x32\".metalstack.api.v2.IPAddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x06R\raddressFamily\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x05\n\x03_ipB\n\n\x08_machineB\t\n\x07_labelsB\x07\n\x05_typeB\x11\n\x0f_address_family\"\xa0\x03\n\x16IPServiceUpdateRequest\x12\x17\n\x02ip\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x02ip\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\"\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12<\n\x04type\x18\x06 \x01(\x0e\x32\x19.metalstack.api.v2.IPTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x02R\x04type\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_typeB\t\n\x07_labels\"l\n\x14IPServiceListRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x30\n\x05query\x18\x02 \x01(\x0b\x32\x1a.metalstack.api.v2.IPQueryR\x05query\"\xb1\x05\n\x07IPQuery\x12\x1c\n\x02ip\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x00R\x02ip\x88\x01\x01\x12*\n\x07network\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x07network\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x02R\x07project\x88\x01\x01\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04name\x88\x01\x01\x12!\n\x04uuid\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\x04uuid\x88\x01\x01\x12\'\n\x07machine\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x05R\x07machine\x88\x01\x01\x12;\n\x12parent_prefix_cidr\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\xe8\x01\x01H\x06R\x10parentPrefixCidr\x88\x01\x01\x12\x36\n\x06labels\x18\x08 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x07R\x06labels\x88\x01\x01\x12<\n\x04type\x18\t \x01(\x0e\x32\x19.metalstack.api.v2.IPTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x08R\x04type\x88\x01\x01\x12X\n\x0e\x61\x64\x64ress_family\x18\n \x01(\x0e\x32\".metalstack.api.v2.IPAddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01H\tR\raddressFamily\x88\x01\x01\x12+\n\tnamespace\x18\x0b \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\nR\tnamespace\x88\x01\x01\x42\x05\n\x03_ipB\n\n\x08_networkB\n\n\x08_projectB\x07\n\x05_nameB\x07\n\x05_uuidB\n\n\x08_machineB\x15\n\x13_parent_prefix_cidrB\t\n\x07_labelsB\x07\n\x05_typeB\x11\n\x0f_address_familyB\x0c\n\n_namespace\"U\n\x16IPServiceDeleteRequest\x12\x17\n\x02ip\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x02ip\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"=\n\x14IPServiceGetResponse\x12%\n\x02ip\x18\x01 \x01(\x0b\x32\x15.metalstack.api.v2.IPR\x02ip\"@\n\x17IPServiceUpdateResponse\x12%\n\x02ip\x18\x01 \x01(\x0b\x32\x15.metalstack.api.v2.IPR\x02ip\"@\n\x17IPServiceCreateResponse\x12%\n\x02ip\x18\x01 \x01(\x0b\x32\x15.metalstack.api.v2.IPR\x02ip\"@\n\x15IPServiceListResponse\x12\'\n\x03ips\x18\x01 \x03(\x0b\x32\x15.metalstack.api.v2.IPR\x03ips\"@\n\x17IPServiceDeleteResponse\x12%\n\x02ip\x18\x01 \x01(\x0b\x32\x15.metalstack.api.v2.IPR\x02ip*g\n\x06IPType\x12\x17\n\x13IP_TYPE_UNSPECIFIED\x10\x00\x12$\n\x11IP_TYPE_EPHEMERAL\x10\x01\x1a\r\x82\xb2\x19\tephemeral\x12\x1e\n\x0eIP_TYPE_STATIC\x10\x02\x1a\n\x82\xb2\x19\x06static*|\n\x0fIPAddressFamily\x12!\n\x1dIP_ADDRESS_FAMILY_UNSPECIFIED\x10\x00\x12\"\n\x14IP_ADDRESS_FAMILY_V4\x10\x01\x1a\x08\x82\xb2\x19\x04ipv4\x12\"\n\x14IP_ADDRESS_FAMILY_V6\x10\x02\x1a\x08\x82\xb2\x19\x04ipv62\x9f\x04\n\tIPService\x12\x63\n\x03Get\x12&.metalstack.api.v2.IPServiceGetRequest\x1a\'.metalstack.api.v2.IPServiceGetResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12k\n\x06\x43reate\x12).metalstack.api.v2.IPServiceCreateRequest\x1a*.metalstack.api.v2.IPServiceCreateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12k\n\x06Update\x12).metalstack.api.v2.IPServiceUpdateRequest\x1a*.metalstack.api.v2.IPServiceUpdateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x66\n\x04List\x12\'.metalstack.api.v2.IPServiceListRequest\x1a(.metalstack.api.v2.IPServiceListResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12k\n\x06\x44\x65lete\x12).metalstack.api.v2.IPServiceDeleteRequest\x1a*.metalstack.api.v2.IPServiceDeleteResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xbd\x01\n\x15\x63om.metalstack.api.v2B\x07IpProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.ip_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\007IpProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_IPTYPE'].values_by_name["IP_TYPE_EPHEMERAL"]._loaded_options = None - _globals['_IPTYPE'].values_by_name["IP_TYPE_EPHEMERAL"]._serialized_options = b'\202\262\031\tephemeral' - _globals['_IPTYPE'].values_by_name["IP_TYPE_STATIC"]._loaded_options = None - _globals['_IPTYPE'].values_by_name["IP_TYPE_STATIC"]._serialized_options = b'\202\262\031\006static' - _globals['_IPADDRESSFAMILY'].values_by_name["IP_ADDRESS_FAMILY_V4"]._loaded_options = None - _globals['_IPADDRESSFAMILY'].values_by_name["IP_ADDRESS_FAMILY_V4"]._serialized_options = b'\202\262\031\004ipv4' - _globals['_IPADDRESSFAMILY'].values_by_name["IP_ADDRESS_FAMILY_V6"]._loaded_options = None - _globals['_IPADDRESSFAMILY'].values_by_name["IP_ADDRESS_FAMILY_V6"]._serialized_options = b'\202\262\031\004ipv6' - _globals['_IP'].fields_by_name['uuid']._loaded_options = None - _globals['_IP'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IP'].fields_by_name['ip']._loaded_options = None - _globals['_IP'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IP'].fields_by_name['name']._loaded_options = None - _globals['_IP'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IP'].fields_by_name['description']._loaded_options = None - _globals['_IP'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IP'].fields_by_name['network']._loaded_options = None - _globals['_IP'].fields_by_name['network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IP'].fields_by_name['project']._loaded_options = None - _globals['_IP'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IP'].fields_by_name['type']._loaded_options = None - _globals['_IP'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IP'].fields_by_name['namespace']._loaded_options = None - _globals['_IP'].fields_by_name['namespace']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICEGETREQUEST'].fields_by_name['ip']._loaded_options = None - _globals['_IPSERVICEGETREQUEST'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IPSERVICEGETREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_IPSERVICEGETREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICEGETREQUEST'].fields_by_name['namespace']._loaded_options = None - _globals['_IPSERVICEGETREQUEST'].fields_by_name['namespace']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['network']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['ip']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['machine']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['machine']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['type']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['address_family']._loaded_options = None - _globals['_IPSERVICECREATEREQUEST'].fields_by_name['address_family']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['ip']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['type']._loaded_options = None - _globals['_IPSERVICEUPDATEREQUEST'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IPSERVICELISTREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_IPSERVICELISTREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPQUERY'].fields_by_name['ip']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IPQUERY'].fields_by_name['network']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IPQUERY'].fields_by_name['project']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPQUERY'].fields_by_name['name']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IPQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPQUERY'].fields_by_name['machine']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['machine']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPQUERY'].fields_by_name['parent_prefix_cidr']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['parent_prefix_cidr']._serialized_options = b'\272H\005r\003\350\001\001' - _globals['_IPQUERY'].fields_by_name['type']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IPQUERY'].fields_by_name['address_family']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['address_family']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_IPQUERY'].fields_by_name['namespace']._loaded_options = None - _globals['_IPQUERY'].fields_by_name['namespace']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICEDELETEREQUEST'].fields_by_name['ip']._loaded_options = None - _globals['_IPSERVICEDELETEREQUEST'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_IPSERVICEDELETEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_IPSERVICEDELETEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_IPSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['Get']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_IPSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['Create']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_IPSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['Update']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_IPSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['List']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_IPSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_IPSERVICE'].methods_by_name['Delete']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_IPTYPE']._serialized_start=2863 - _globals['_IPTYPE']._serialized_end=2966 - _globals['_IPADDRESSFAMILY']._serialized_start=2968 - _globals['_IPADDRESSFAMILY']._serialized_end=3092 - _globals['_IP']._serialized_start=153 - _globals['_IP']._serialized_end=528 - _globals['_IPSERVICEGETREQUEST']._serialized_start=531 - _globals['_IPSERVICEGETREQUEST']._serialized_end=672 - _globals['_IPSERVICECREATEREQUEST']._serialized_start=675 - _globals['_IPSERVICECREATEREQUEST']._serialized_end=1226 - _globals['_IPSERVICEUPDATEREQUEST']._serialized_start=1229 - _globals['_IPSERVICEUPDATEREQUEST']._serialized_end=1645 - _globals['_IPSERVICELISTREQUEST']._serialized_start=1647 - _globals['_IPSERVICELISTREQUEST']._serialized_end=1755 - _globals['_IPQUERY']._serialized_start=1758 - _globals['_IPQUERY']._serialized_end=2447 - _globals['_IPSERVICEDELETEREQUEST']._serialized_start=2449 - _globals['_IPSERVICEDELETEREQUEST']._serialized_end=2534 - _globals['_IPSERVICEGETRESPONSE']._serialized_start=2536 - _globals['_IPSERVICEGETRESPONSE']._serialized_end=2597 - _globals['_IPSERVICEUPDATERESPONSE']._serialized_start=2599 - _globals['_IPSERVICEUPDATERESPONSE']._serialized_end=2663 - _globals['_IPSERVICECREATERESPONSE']._serialized_start=2665 - _globals['_IPSERVICECREATERESPONSE']._serialized_end=2729 - _globals['_IPSERVICELISTRESPONSE']._serialized_start=2731 - _globals['_IPSERVICELISTRESPONSE']._serialized_end=2795 - _globals['_IPSERVICEDELETERESPONSE']._serialized_start=2797 - _globals['_IPSERVICEDELETERESPONSE']._serialized_end=2861 - _globals['_IPSERVICE']._serialized_start=3095 - _globals['_IPSERVICE']._serialized_end=3638 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/ip_pb2.pyi b/python/metalstack/api/v2/ip_pb2.pyi deleted file mode 100644 index 354b0d8b..00000000 --- a/python/metalstack/api/v2/ip_pb2.pyi +++ /dev/null @@ -1,173 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class IPType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - IP_TYPE_UNSPECIFIED: _ClassVar[IPType] - IP_TYPE_EPHEMERAL: _ClassVar[IPType] - IP_TYPE_STATIC: _ClassVar[IPType] - -class IPAddressFamily(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - IP_ADDRESS_FAMILY_UNSPECIFIED: _ClassVar[IPAddressFamily] - IP_ADDRESS_FAMILY_V4: _ClassVar[IPAddressFamily] - IP_ADDRESS_FAMILY_V6: _ClassVar[IPAddressFamily] -IP_TYPE_UNSPECIFIED: IPType -IP_TYPE_EPHEMERAL: IPType -IP_TYPE_STATIC: IPType -IP_ADDRESS_FAMILY_UNSPECIFIED: IPAddressFamily -IP_ADDRESS_FAMILY_V4: IPAddressFamily -IP_ADDRESS_FAMILY_V6: IPAddressFamily - -class IP(_message.Message): - __slots__ = ("uuid", "meta", "ip", "name", "description", "network", "project", "type", "namespace") - UUID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - IP_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - NETWORK_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - NAMESPACE_FIELD_NUMBER: _ClassVar[int] - uuid: str - meta: _common_pb2.Meta - ip: str - name: str - description: str - network: str - project: str - type: IPType - namespace: str - def __init__(self, uuid: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., ip: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., network: _Optional[str] = ..., project: _Optional[str] = ..., type: _Optional[_Union[IPType, str]] = ..., namespace: _Optional[str] = ...) -> None: ... - -class IPServiceGetRequest(_message.Message): - __slots__ = ("ip", "project", "namespace") - IP_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAMESPACE_FIELD_NUMBER: _ClassVar[int] - ip: str - project: str - namespace: str - def __init__(self, ip: _Optional[str] = ..., project: _Optional[str] = ..., namespace: _Optional[str] = ...) -> None: ... - -class IPServiceCreateRequest(_message.Message): - __slots__ = ("network", "project", "name", "description", "ip", "machine", "labels", "type", "address_family") - NETWORK_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - IP_FIELD_NUMBER: _ClassVar[int] - MACHINE_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FAMILY_FIELD_NUMBER: _ClassVar[int] - network: str - project: str - name: str - description: str - ip: str - machine: str - labels: _common_pb2.Labels - type: IPType - address_family: IPAddressFamily - def __init__(self, network: _Optional[str] = ..., project: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., ip: _Optional[str] = ..., machine: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., type: _Optional[_Union[IPType, str]] = ..., address_family: _Optional[_Union[IPAddressFamily, str]] = ...) -> None: ... - -class IPServiceUpdateRequest(_message.Message): - __slots__ = ("ip", "update_meta", "project", "name", "description", "type", "labels") - IP_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - ip: str - update_meta: _common_pb2.UpdateMeta - project: str - name: str - description: str - type: IPType - labels: _common_pb2.UpdateLabels - def __init__(self, ip: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., project: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., type: _Optional[_Union[IPType, str]] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class IPServiceListRequest(_message.Message): - __slots__ = ("project", "query") - PROJECT_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - project: str - query: IPQuery - def __init__(self, project: _Optional[str] = ..., query: _Optional[_Union[IPQuery, _Mapping]] = ...) -> None: ... - -class IPQuery(_message.Message): - __slots__ = ("ip", "network", "project", "name", "uuid", "machine", "parent_prefix_cidr", "labels", "type", "address_family", "namespace") - IP_FIELD_NUMBER: _ClassVar[int] - NETWORK_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - UUID_FIELD_NUMBER: _ClassVar[int] - MACHINE_FIELD_NUMBER: _ClassVar[int] - PARENT_PREFIX_CIDR_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FAMILY_FIELD_NUMBER: _ClassVar[int] - NAMESPACE_FIELD_NUMBER: _ClassVar[int] - ip: str - network: str - project: str - name: str - uuid: str - machine: str - parent_prefix_cidr: str - labels: _common_pb2.Labels - type: IPType - address_family: IPAddressFamily - namespace: str - def __init__(self, ip: _Optional[str] = ..., network: _Optional[str] = ..., project: _Optional[str] = ..., name: _Optional[str] = ..., uuid: _Optional[str] = ..., machine: _Optional[str] = ..., parent_prefix_cidr: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., type: _Optional[_Union[IPType, str]] = ..., address_family: _Optional[_Union[IPAddressFamily, str]] = ..., namespace: _Optional[str] = ...) -> None: ... - -class IPServiceDeleteRequest(_message.Message): - __slots__ = ("ip", "project") - IP_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - ip: str - project: str - def __init__(self, ip: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class IPServiceGetResponse(_message.Message): - __slots__ = ("ip",) - IP_FIELD_NUMBER: _ClassVar[int] - ip: IP - def __init__(self, ip: _Optional[_Union[IP, _Mapping]] = ...) -> None: ... - -class IPServiceUpdateResponse(_message.Message): - __slots__ = ("ip",) - IP_FIELD_NUMBER: _ClassVar[int] - ip: IP - def __init__(self, ip: _Optional[_Union[IP, _Mapping]] = ...) -> None: ... - -class IPServiceCreateResponse(_message.Message): - __slots__ = ("ip",) - IP_FIELD_NUMBER: _ClassVar[int] - ip: IP - def __init__(self, ip: _Optional[_Union[IP, _Mapping]] = ...) -> None: ... - -class IPServiceListResponse(_message.Message): - __slots__ = ("ips",) - IPS_FIELD_NUMBER: _ClassVar[int] - ips: _containers.RepeatedCompositeFieldContainer[IP] - def __init__(self, ips: _Optional[_Iterable[_Union[IP, _Mapping]]] = ...) -> None: ... - -class IPServiceDeleteResponse(_message.Message): - __slots__ = ("ip",) - IP_FIELD_NUMBER: _ClassVar[int] - ip: IP - def __init__(self, ip: _Optional[_Union[IP, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/machine_connect.py b/python/metalstack/api/v2/machine_connect.py index d219d7b7..bb0df434 100644 --- a/python/metalstack/api/v2/machine_connect.py +++ b/python/metalstack/api/v2/machine_connect.py @@ -1,47 +1,63 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/machine.proto +# Generated from metalstack/api/v2/machine.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 + +from .machine_pb import MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse, MachineServiceCreateRequest, MachineServiceCreateResponse, MachineServiceDeleteRequest, MachineServiceDeleteResponse, MachineServiceGetBMCRequest, MachineServiceGetBMCResponse, MachineServiceGetRequest, MachineServiceGetResponse, MachineServiceListRequest, MachineServiceListResponse, MachineServiceUpdateRequest, MachineServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class MachineService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: MachineServiceGetRequest, ctx: RequestContext[MachineServiceGetRequest, MachineServiceGetResponse]) -> MachineServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: MachineServiceCreateRequest, ctx: RequestContext[MachineServiceCreateRequest, MachineServiceCreateResponse]) -> MachineServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: MachineServiceUpdateRequest, ctx: RequestContext[MachineServiceUpdateRequest, MachineServiceUpdateResponse]) -> MachineServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: MachineServiceListRequest, ctx: RequestContext[MachineServiceListRequest, MachineServiceListResponse]) -> MachineServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: MachineServiceDeleteRequest, ctx: RequestContext[MachineServiceDeleteRequest, MachineServiceDeleteResponse]) -> MachineServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def b_m_c_command(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def bmc_command(self, request: MachineServiceBMCCommandRequest, ctx: RequestContext[MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse]) -> MachineServiceBMCCommandResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def get_b_m_c(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get_bmc(self, request: MachineServiceGetBMCRequest, ctx: RequestContext[MachineServiceGetBMCRequest, MachineServiceGetBMCResponse]) -> MachineServiceGetBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MachineServiceASGIApplication(ConnectASGIApplication[MachineService]): - def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MachineService | AsyncGenerator[MachineService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -49,8 +65,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Get", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -59,8 +75,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Create", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse, + input=MachineServiceCreateRequest, + output=MachineServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -69,8 +85,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Update", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse, + input=MachineServiceUpdateRequest, + output=MachineServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -79,8 +95,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="List", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -89,8 +105,8 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -99,21 +115,21 @@ def __init__(self, service: MachineService | AsyncGenerator[MachineService], *, method=MethodInfo( name="BMCCommand", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.b_m_c_command, + function=svc.bmc_command, ), "/metalstack.api.v2.MachineService/GetBMC": Endpoint.unary( method=MethodInfo( name="GetBMC", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.get_b_m_c, + function=svc.get_bmc, ), }, interceptors=interceptors, @@ -131,18 +147,18 @@ def path(self) -> str: class MachineServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, + request: MachineServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse: + ) -> MachineServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -151,18 +167,18 @@ async def get( async def create( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, + request: MachineServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse: + ) -> MachineServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse, + input=MachineServiceCreateRequest, + output=MachineServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -171,18 +187,18 @@ async def create( async def update( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, + request: MachineServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse: + ) -> MachineServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse, + input=MachineServiceUpdateRequest, + output=MachineServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -191,18 +207,18 @@ async def update( async def list( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, + request: MachineServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse: + ) -> MachineServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -211,95 +227,104 @@ async def list( async def delete( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, + request: MachineServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: + ) -> MachineServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def b_m_c_command( + async def bmc_command( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, + request: MachineServiceBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: + ) -> MachineServiceBMCCommandResponse: return await self.execute_unary( request=request, method=MethodInfo( name="BMCCommand", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def get_b_m_c( + async def get_bmc( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, + request: MachineServiceGetBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: + ) -> MachineServiceGetBMCResponse: return await self.execute_unary( request=request, method=MethodInfo( name="GetBMC", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class MachineServiceSync(Protocol): + def get(self, request: MachineServiceGetRequest, ctx: RequestContext[MachineServiceGetRequest, MachineServiceGetResponse]) -> MachineServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def create(self, request: MachineServiceCreateRequest, ctx: RequestContext[MachineServiceCreateRequest, MachineServiceCreateResponse]) -> MachineServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: MachineServiceUpdateRequest, ctx: RequestContext[MachineServiceUpdateRequest, MachineServiceUpdateResponse]) -> MachineServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: MachineServiceListRequest, ctx: RequestContext[MachineServiceListRequest, MachineServiceListResponse]) -> MachineServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class MachineServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def b_m_c_command(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def get_b_m_c(self, request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def delete(self, request: MachineServiceDeleteRequest, ctx: RequestContext[MachineServiceDeleteRequest, MachineServiceDeleteResponse]) -> MachineServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def bmc_command(self, request: MachineServiceBMCCommandRequest, ctx: RequestContext[MachineServiceBMCCommandRequest, MachineServiceBMCCommandResponse]) -> MachineServiceBMCCommandResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def get_bmc(self, request: MachineServiceGetBMCRequest, ctx: RequestContext[MachineServiceGetBMCRequest, MachineServiceGetBMCResponse]) -> MachineServiceGetBMCResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MachineServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: MachineServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MachineServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.MachineService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -308,8 +333,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Create", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse, + input=MachineServiceCreateRequest, + output=MachineServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -318,8 +343,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Update", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse, + input=MachineServiceUpdateRequest, + output=MachineServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -328,8 +353,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="List", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -338,8 +363,8 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Delete", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -348,21 +373,21 @@ def __init__(self, service: MachineServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="BMCCommand", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.b_m_c_command, + function=service.bmc_command, ), "/metalstack.api.v2.MachineService/GetBMC": EndpointSync.unary( method=MethodInfo( name="GetBMC", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.get_b_m_c, + function=service.get_bmc, ), }, interceptors=interceptors, @@ -380,142 +405,134 @@ def path(self) -> str: class MachineServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, + request: MachineServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse: + ) -> MachineServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetResponse, + input=MachineServiceGetRequest, + output=MachineServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, + request: MachineServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse: + ) -> MachineServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceCreateResponse, + input=MachineServiceCreateRequest, + output=MachineServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, + request: MachineServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse: + ) -> MachineServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceUpdateResponse, + input=MachineServiceUpdateRequest, + output=MachineServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, + request: MachineServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse: + ) -> MachineServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceListResponse, + input=MachineServiceListRequest, + output=MachineServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, + request: MachineServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse: + ) -> MachineServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceDeleteResponse, + input=MachineServiceDeleteRequest, + output=MachineServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def b_m_c_command( + def bmc_command( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, + request: MachineServiceBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse: + ) -> MachineServiceBMCCommandResponse: return self.execute_unary( request=request, method=MethodInfo( name="BMCCommand", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceBMCCommandResponse, + input=MachineServiceBMCCommandRequest, + output=MachineServiceBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def get_b_m_c( + def get_bmc( self, - request: metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, + request: MachineServiceGetBMCRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse: + ) -> MachineServiceGetBMCResponse: return self.execute_unary( request=request, method=MethodInfo( name="GetBMC", service_name="metalstack.api.v2.MachineService", - input=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCRequest, - output=metalstack_dot_api_dot_v2_dot_machine__pb2.MachineServiceGetBMCResponse, + input=MachineServiceGetBMCRequest, + output=MachineServiceGetBMCResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/machine_pb.py b/python/metalstack/api/v2/machine_pb.py new file mode 100644 index 00000000..0c1cfe4c --- /dev/null +++ b/python/metalstack/api/v2/machine_pb.py @@ -0,0 +1,3688 @@ +# Generated from metalstack/api/v2/machine.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from . import common_pb, filesystem_pb, image_pb, network_pb, partition_pb, predefined_rules_pb, size_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from .common_pb import Labels, Meta, UpdateLabels, UpdateMeta + from .filesystem_pb import FilesystemLayout + from .image_pb import Image + from .network_pb import NATType, NetworkType + from .partition_pb import DNSServer, NTPServer, Partition + from .size_pb import Size + + +_MachineServiceGetRequestFields: TypeAlias = Literal["uuid", "project"] + +class MachineServiceGetRequest(Message[_MachineServiceGetRequestFields]): + """ + MachineServiceGetRequest is the request payload for a machine get request + + ```proto + message metalstack.api.v2.MachineServiceGetRequest + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + project: + Project of the machine + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("uuid", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + project: str = "", + ) -> None: + pass + + uuid: str + project: str + +_MachineServiceGetResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceGetResponse(Message[_MachineServiceGetResponseFields]): + """ + MachineServiceGetResponse is the response payload for a machine get request + + ```proto + message metalstack.api.v2.MachineServiceGetResponse + ``` + + Attributes: + machine: + Machine is the machine requested + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceCreateRequestFields: TypeAlias = Literal["project", "uuid", "name", "description", "hostname", "partition", "size", "image", "filesystem_layout", "ssh_public_keys", "userdata", "labels", "networks", "placement_tags", "dns_servers", "ntp_servers", "allocation_type", "firewall_spec"] + +class MachineServiceCreateRequest(Message[_MachineServiceCreateRequestFields]): + """ + MachineServiceCreateRequest is the request payload for a machine create request + + ```proto + message metalstack.api.v2.MachineServiceCreateRequest + ``` + + Attributes: + project: + Project of the machine + + ```proto + string project = 1; + ``` + uuid: + UUID if this field is set, this specific machine will be allocated if it is not in available state and not currently allocated. + this field takes precedence over size and partition. + Can only be used with ADMIN_ROLE_EDITOR + + ```proto + optional string uuid = 2; + ``` + name: + Name of this machine + + ```proto + string name = 3; + ``` + description: + Description for this machine + + ```proto + optional string description = 4; + ``` + hostname: + Hostname the hostname for the allocated machine (defaults to metal) + + ```proto + optional string hostname = 5; + ``` + partition: + Partition the partition id to assign this machine to, must be omitted if uuid is given + + ```proto + optional string partition = 6; + ``` + size: + Size of the machine to create, must be omitted if uuid is given + + ```proto + optional string size = 7; + ``` + image: + Image which should be installed on this machine + The image can be specified either in the fully qualified form, e.g. including os, major, minor and patch + - debian-13.0.20260402 + or in a simplified form which omits the patch version + - debian-13.0 + If the fully qualified form is specified, exactly this image is taken regardless of the image classification + if the short form is given, only the most recent images which has image classification supported is used. + + ```proto + string image = 8; + ``` + filesystem_layout: + FilesystemLayout which should be applied for the operating system installation + Is defaulted by a lookup at the available fsls for this size and image. + Can be specified to test new fsls during development of fsls + + ```proto + optional string filesystem_layout = 9; + ``` + ssh_public_keys: + SSHPublicKeys defines the ssh public key to be installed on the machine to access it via ssh + + ```proto + repeated string ssh_public_keys = 10; + ``` + userdata: + Userdata contains instructions required to bootstrap the machine + AWS limits the max userdata size to 16k, lets allow twice as much + + ```proto + optional string userdata = 11; + ``` + labels: + Labels to be attached to this machine allocation + + ```proto + optional metalstack.api.v2.Labels labels = 12; + ``` + networks: + Networks the networks that this machine will be placed in. + + ```proto + repeated metalstack.api.v2.MachineAllocationNetwork networks = 13; + ``` + placement_tags: + PlacementTags by default machines are spread across the racks inside a partition for every project. + if placement tags are provided, the machine candidate has an additional anti-affinity to other machines having the same tags + + ```proto + repeated string placement_tags = 14; + ``` + dns_servers: + DNSServer the dns servers used for the machine + + ```proto + repeated metalstack.api.v2.DNSServer dns_servers = 15; + ``` + ntp_servers: + NTPServer the ntp servers used for the machine + + ```proto + repeated metalstack.api.v2.NTPServer ntp_servers = 16; + ``` + allocation_type: + AllocationType of this machine + + ```proto + metalstack.api.v2.MachineAllocationType allocation_type = 17; + ``` + firewall_spec: + FirewallSpec provides firewall specific parameters if allocationType is firewall + + ```proto + optional metalstack.api.v2.FirewallSpec firewall_spec = 18; + ``` + """ + + __slots__ = ("project", "uuid", "name", "description", "hostname", "partition", "size", "image", "filesystem_layout", "ssh_public_keys", "userdata", "labels", "networks", "placement_tags", "dns_servers", "ntp_servers", "allocation_type", "firewall_spec") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + uuid: str | None = None, + name: str = "", + description: str | None = None, + hostname: str | None = None, + partition: str | None = None, + size: str | None = None, + image: str = "", + filesystem_layout: str | None = None, + ssh_public_keys: list[str] | None = None, + userdata: str | None = None, + labels: Labels | None = None, + networks: list[MachineAllocationNetwork] | None = None, + placement_tags: list[str] | None = None, + dns_servers: list[DNSServer] | None = None, + ntp_servers: list[NTPServer] | None = None, + allocation_type: MachineAllocationType | None = None, + firewall_spec: FirewallSpec | None = None, + ) -> None: + pass + + project: str + uuid: str + name: str + description: str + hostname: str + partition: str + size: str + image: str + filesystem_layout: str + ssh_public_keys: list[str] + userdata: str + labels: Labels | None + networks: list[MachineAllocationNetwork] + placement_tags: list[str] + dns_servers: list[DNSServer] + ntp_servers: list[NTPServer] + allocation_type: MachineAllocationType + firewall_spec: FirewallSpec | None + +_FirewallSpecFields: TypeAlias = Literal["firewall_rules"] + +class FirewallSpec(Message[_FirewallSpecFields]): + """ + FirewallSpec contains firewall specific firewall creation parameters + + ```proto + message metalstack.api.v2.FirewallSpec + ``` + + Attributes: + firewall_rules: + FirewallRules to be applied if this is a firewall + + ```proto + optional metalstack.api.v2.FirewallRules firewall_rules = 1; + ``` + """ + + __slots__ = ("firewall_rules",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + firewall_rules: FirewallRules | None = None, + ) -> None: + pass + + firewall_rules: FirewallRules | None + +_MachineServiceCreateResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceCreateResponse(Message[_MachineServiceCreateResponseFields]): + """ + MachineServiceCreateResponse is the response payload for a machine create request + + ```proto + message metalstack.api.v2.MachineServiceCreateResponse + ``` + + Attributes: + machine: + Machine which was created + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceUpdateRequestFields: TypeAlias = Literal["uuid", "update_meta", "project", "description", "labels", "ssh_public_keys"] + +class MachineServiceUpdateRequest(Message[_MachineServiceUpdateRequestFields]): + """ + MachineServiceUpdateRequest is the request payload for a machine update request + + ```proto + message metalstack.api.v2.MachineServiceUpdateRequest + ``` + + Attributes: + uuid: + UUID of the machine to modify + + ```proto + string uuid = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + project: + Project of the machine + + ```proto + string project = 3; + ``` + description: + Description of this machine allocation + + ```proto + optional string description = 4; + ``` + labels: + Labels to update on this machine allocation + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 5; + ``` + ssh_public_keys: + SSHPublicKeys which should be update of this machine allocation + + ```proto + repeated string ssh_public_keys = 6; + ``` + """ + + __slots__ = ("uuid", "update_meta", "project", "description", "labels", "ssh_public_keys") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + update_meta: UpdateMeta | None = None, + project: str = "", + description: str | None = None, + labels: UpdateLabels | None = None, + ssh_public_keys: list[str] | None = None, + ) -> None: + pass + + uuid: str + update_meta: UpdateMeta | None + project: str + description: str + labels: UpdateLabels | None + ssh_public_keys: list[str] + +_MachineServiceUpdateResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceUpdateResponse(Message[_MachineServiceUpdateResponseFields]): + """ + MachineServiceUpdateResponse is the response payload for a machine update request + + ```proto + message metalstack.api.v2.MachineServiceUpdateResponse + ``` + + Attributes: + machine: + Machine which was updated + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceListRequestFields: TypeAlias = Literal["project", "query"] + +class MachineServiceListRequest(Message[_MachineServiceListRequestFields]): + """ + MachineServiceListRequest is the request payload for a machine list request + + ```proto + message metalstack.api.v2.MachineServiceListRequest + ``` + + Attributes: + project: + Project of the machines to list + + ```proto + string project = 1; + ``` + query: + Query to list one ore more machines + + ```proto + optional metalstack.api.v2.MachineQuery query = 2; + ``` + """ + + __slots__ = ("project", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + query: MachineQuery | None = None, + ) -> None: + pass + + project: str + query: MachineQuery | None + +_MachineServiceListResponseFields: TypeAlias = Literal["machines"] + +class MachineServiceListResponse(Message[_MachineServiceListResponseFields]): + """ + MachineServiceListResponse is the response payload for a machine list request + + ```proto + message metalstack.api.v2.MachineServiceListResponse + ``` + + Attributes: + machines: + Machines are the machines requested by a list request + + ```proto + repeated metalstack.api.v2.Machine machines = 1; + ``` + """ + + __slots__ = ("machines",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machines: list[Machine] | None = None, + ) -> None: + pass + + machines: list[Machine] + +_MachineServiceDeleteRequestFields: TypeAlias = Literal["uuid", "project"] + +class MachineServiceDeleteRequest(Message[_MachineServiceDeleteRequestFields]): + """ + MachineServiceDeleteRequest is the request payload for a machine delete request + + ```proto + message metalstack.api.v2.MachineServiceDeleteRequest + ``` + + Attributes: + uuid: + UUID of the machine to delete + + ```proto + string uuid = 1; + ``` + project: + Project of the machine + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("uuid", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + project: str = "", + ) -> None: + pass + + uuid: str + project: str + +_MachineServiceDeleteResponseFields: TypeAlias = Literal["machine"] + +class MachineServiceDeleteResponse(Message[_MachineServiceDeleteResponseFields]): + """ + MachineServiceDeleteResponse is the response payload for a machine delete request + + ```proto + message metalstack.api.v2.MachineServiceDeleteResponse + ``` + + Attributes: + machine: + Machine which was deleted + + ```proto + optional metalstack.api.v2.Machine machine = 1; + ``` + """ + + __slots__ = ("machine",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine: Machine | None = None, + ) -> None: + pass + + machine: Machine | None + +_MachineServiceBMCCommandRequestFields: TypeAlias = Literal["uuid", "project", "command"] + +class MachineServiceBMCCommandRequest(Message[_MachineServiceBMCCommandRequestFields]): + """ + MachineServiceBMCCommandRequest is the request payload for a machine bmc command + + ```proto + message metalstack.api.v2.MachineServiceBMCCommandRequest + ``` + + Attributes: + uuid: + UUID of the machine to send the command to + + ```proto + string uuid = 1; + ``` + project: + Project of the machine + + ```proto + string project = 2; + ``` + command: + Command to send to the bmc of the machine + + ```proto + metalstack.api.v2.MachineBMCCommand command = 3; + ``` + """ + + __slots__ = ("uuid", "project", "command") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + project: str = "", + command: MachineBMCCommand | None = None, + ) -> None: + pass + + uuid: str + project: str + command: MachineBMCCommand + +_MachineServiceBMCCommandResponseFields: TypeAlias = NoReturn + +class MachineServiceBMCCommandResponse(Message[_MachineServiceBMCCommandResponseFields]): + """ + MachineServiceBMCCommandResponse is the response payload for a machine bmc command + + ```proto + message metalstack.api.v2.MachineServiceBMCCommandResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_MachineServiceGetBMCRequestFields: TypeAlias = Literal["uuid", "project"] + +class MachineServiceGetBMCRequest(Message[_MachineServiceGetBMCRequestFields]): + """ + MachineServiceGetBMCRequest is the request payload for a machine getbmc request + + ```proto + message metalstack.api.v2.MachineServiceGetBMCRequest + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + string uuid = 1; + ``` + project: + Project of the machine + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("uuid", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + project: str = "", + ) -> None: + pass + + uuid: str + project: str + +_MachineServiceGetBMCResponseFields: TypeAlias = Literal["uuid", "bmc"] + +class MachineServiceGetBMCResponse(Message[_MachineServiceGetBMCResponseFields]): + """ + MachineServiceGetBMCResponse is the response payload for a machine getbmc request + + ```proto + message metalstack.api.v2.MachineServiceGetBMCResponse + ``` + + Attributes: + uuid: + UUID of the machine + + ```proto + string uuid = 1; + ``` + bmc: + BMC contains the BMC details of this machine + + ```proto + optional metalstack.api.v2.MachineBMCReport bmc = 2; + ``` + """ + + __slots__ = ("uuid", "bmc") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + bmc: MachineBMCReport | None = None, + ) -> None: + pass + + uuid: str + bmc: MachineBMCReport | None + +_MachineFields: TypeAlias = Literal["uuid", "meta", "partition", "rack", "room", "size", "hardware", "allocation", "status", "recent_provisioning_events"] + +class Machine(Message[_MachineFields]): + """ + Machine represents a physical bare metal machine. + + ```proto + message metalstack.api.v2.Machine + ``` + + Attributes: + uuid: + UUID of this machine + + ```proto + string uuid = 1; + ``` + meta: + Meta for this machine + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + partition: + Partition where this machine resides + + ```proto + optional metalstack.api.v2.Partition partition = 3; + ``` + rack: + Rack where this machine is located + + ```proto + string rack = 4; + ``` + room: + Room where this machine is located + + ```proto + string room = 5; + ``` + size: + Size of this machine + + ```proto + optional metalstack.api.v2.Size size = 6; + ``` + hardware: + Hardware specs of this machine + + ```proto + optional metalstack.api.v2.MachineHardware hardware = 7; + ``` + allocation: + Allocation details + + ```proto + optional metalstack.api.v2.MachineAllocation allocation = 8; + ``` + status: + Status contains several status details related to this machine + + ```proto + optional metalstack.api.v2.MachineStatus status = 9; + ``` + recent_provisioning_events: + MachineRecentProvisioningEvents contains the recent provisioning events + + ```proto + optional metalstack.api.v2.MachineRecentProvisioningEvents recent_provisioning_events = 10; + ``` + """ + + __slots__ = ("uuid", "meta", "partition", "rack", "room", "size", "hardware", "allocation", "status", "recent_provisioning_events") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + meta: Meta | None = None, + partition: Partition | None = None, + rack: str = "", + room: str = "", + size: Size | None = None, + hardware: MachineHardware | None = None, + allocation: MachineAllocation | None = None, + status: MachineStatus | None = None, + recent_provisioning_events: MachineRecentProvisioningEvents | None = None, + ) -> None: + pass + + uuid: str + meta: Meta | None + partition: Partition | None + rack: str + room: str + size: Size | None + hardware: MachineHardware | None + allocation: MachineAllocation | None + status: MachineStatus | None + recent_provisioning_events: MachineRecentProvisioningEvents | None + +_MachineStatusFields: TypeAlias = Literal["condition", "led_state", "liveliness", "metal_hammer_version"] + +class MachineStatus(Message[_MachineStatusFields]): + """ + MachineStatus contains several status details related to this machine + + ```proto + message metalstack.api.v2.MachineStatus + ``` + + Attributes: + condition: + Condition describes the availability + + ```proto + optional metalstack.api.v2.MachineCondition condition = 1; + ``` + led_state: + LEDState indicates the state of the indicator LED on this machine + + ```proto + optional metalstack.api.v2.MachineChassisIdentifyLEDState led_state = 2; + ``` + liveliness: + Liveliness of this machine + + ```proto + metalstack.api.v2.MachineLiveliness liveliness = 3; + ``` + metal_hammer_version: + MetalHammerVersion the version of metal hammer which put the machine in waiting state + + ```proto + string metal_hammer_version = 4; + ``` + """ + + __slots__ = ("condition", "led_state", "liveliness", "metal_hammer_version") + + if TYPE_CHECKING: + + def __init__( + self, + *, + condition: MachineCondition | None = None, + led_state: MachineChassisIdentifyLEDState | None = None, + liveliness: MachineLiveliness | None = None, + metal_hammer_version: str = "", + ) -> None: + pass + + condition: MachineCondition | None + led_state: MachineChassisIdentifyLEDState | None + liveliness: MachineLiveliness + metal_hammer_version: str + +_MachineConditionFields: TypeAlias = Literal["state", "description", "issuer"] + +class MachineCondition(Message[_MachineConditionFields]): + """ + MachineCondition describes the availability of this machine + + ```proto + message metalstack.api.v2.MachineCondition + ``` + + Attributes: + state: + State the state of this machine. empty means available for all + + ```proto + metalstack.api.v2.MachineState state = 1; + ``` + description: + Description a description why this machine is in the given state + + ```proto + string description = 2; + ``` + issuer: + Issuer the user that changed the state + + ```proto + string issuer = 3; + ``` + """ + + __slots__ = ("state", "description", "issuer") + + if TYPE_CHECKING: + + def __init__( + self, + *, + state: MachineState | None = None, + description: str = "", + issuer: str = "", + ) -> None: + pass + + state: MachineState + description: str + issuer: str + +_MachineAllocationFields: TypeAlias = Literal["uuid", "meta", "name", "description", "created_by", "project", "image", "filesystem_layout", "networks", "hostname", "ssh_public_keys", "userdata", "allocation_type", "firewall_rules", "dns_servers", "ntp_servers", "vpn"] + +class MachineAllocation(Message[_MachineAllocationFields]): + """ + MachineAllocation contains properties if this machine is allocated + + ```proto + message metalstack.api.v2.MachineAllocation + ``` + + Attributes: + uuid: + UUID of this machine allocation + + ```proto + string uuid = 1; + ``` + meta: + Meta for this machine allocation + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this allocation + + ```proto + string name = 3; + ``` + description: + Description of this allocation + + ```proto + string description = 4; + ``` + created_by: + Created By indicates who created this machine allocation + + ```proto + string created_by = 5; + ``` + project: + Project of the allocation + + ```proto + string project = 6; + ``` + image: + Image to be used to install on this machine + + ```proto + optional metalstack.api.v2.Image image = 7; + ``` + filesystem_layout: + FilesystemLayout to create on the disks + + ```proto + optional metalstack.api.v2.FilesystemLayout filesystem_layout = 8; + ``` + networks: + Networks this machine should be attached to + Order of ips of external networks will be preserved. + + ```proto + repeated metalstack.api.v2.MachineNetwork networks = 9; + ``` + hostname: + Hostname of the allocated machine + + ```proto + string hostname = 10; + ``` + ssh_public_keys: + SSHPublicKeys which should be installed on this machine + + ```proto + repeated string ssh_public_keys = 11; + ``` + userdata: + Userdata contains instructions required to bootstrap the machine. + AWS limits the max userdata size to 16k, lets allow twice as much + + ```proto + string userdata = 12; + ``` + allocation_type: + AllocationType of this machine + + ```proto + metalstack.api.v2.MachineAllocationType allocation_type = 13; + ``` + firewall_rules: + FirewallRules to be applied if this is a firewall + + ```proto + optional metalstack.api.v2.FirewallRules firewall_rules = 14; + ``` + dns_servers: + DNSServers for this machine + + ```proto + repeated metalstack.api.v2.DNSServer dns_servers = 15; + ``` + ntp_servers: + NTPServers for this machine + + ```proto + repeated metalstack.api.v2.NTPServer ntp_servers = 16; + ``` + vpn: + VPN connection configuration + + ```proto + optional metalstack.api.v2.MachineVPN vpn = 17; + ``` + """ + + __slots__ = ("uuid", "meta", "name", "description", "created_by", "project", "image", "filesystem_layout", "networks", "hostname", "ssh_public_keys", "userdata", "allocation_type", "firewall_rules", "dns_servers", "ntp_servers", "vpn") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + meta: Meta | None = None, + name: str = "", + description: str = "", + created_by: str = "", + project: str = "", + image: Image | None = None, + filesystem_layout: FilesystemLayout | None = None, + networks: list[MachineNetwork] | None = None, + hostname: str = "", + ssh_public_keys: list[str] | None = None, + userdata: str = "", + allocation_type: MachineAllocationType | None = None, + firewall_rules: FirewallRules | None = None, + dns_servers: list[DNSServer] | None = None, + ntp_servers: list[NTPServer] | None = None, + vpn: MachineVPN | None = None, + ) -> None: + pass + + uuid: str + meta: Meta | None + name: str + description: str + created_by: str + project: str + image: Image | None + filesystem_layout: FilesystemLayout | None + networks: list[MachineNetwork] + hostname: str + ssh_public_keys: list[str] + userdata: str + allocation_type: MachineAllocationType + firewall_rules: FirewallRules | None + dns_servers: list[DNSServer] + ntp_servers: list[NTPServer] + vpn: MachineVPN | None + +_MachineAllocationNetworkFields: TypeAlias = Literal["network", "ips"] + +class MachineAllocationNetwork(Message[_MachineAllocationNetworkFields]): + """ + MachineAllocationNetwork defines which network should be attached to a machine and if ips should be autoacquired + + ```proto + message metalstack.api.v2.MachineAllocationNetwork + ``` + + Attributes: + network: + Network the id of the network that this machine will be placed in + + ```proto + string network = 1; + ``` + ips: + IPs to to attach to this machine additionally + If none given, one ip address is acquired per network for the machine + Order of ips is preserved on the loopback interface. + + ```proto + repeated string ips = 2; + ``` + """ + + __slots__ = ("network", "ips") + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: str = "", + ips: list[str] | None = None, + ) -> None: + pass + + network: str + ips: list[str] + +_FirewallRulesFields: TypeAlias = Literal["egress", "ingress"] + +class FirewallRules(Message[_FirewallRulesFields]): + """ + FirewallRules can be defined during firewall allocation + + ```proto + message metalstack.api.v2.FirewallRules + ``` + + Attributes: + egress: + Egress list of egress rules to be deployed during firewall allocation + + ```proto + repeated metalstack.api.v2.FirewallEgressRule egress = 1; + ``` + ingress: + Ingress list of ingress rules to be deployed during firewall allocation + + ```proto + repeated metalstack.api.v2.FirewallIngressRule ingress = 2; + ``` + """ + + __slots__ = ("egress", "ingress") + + if TYPE_CHECKING: + + def __init__( + self, + *, + egress: list[FirewallEgressRule] | None = None, + ingress: list[FirewallIngressRule] | None = None, + ) -> None: + pass + + egress: list[FirewallEgressRule] + ingress: list[FirewallIngressRule] + +_FirewallEgressRuleFields: TypeAlias = Literal["protocol", "ports", "to", "comment"] + +class FirewallEgressRule(Message[_FirewallEgressRuleFields]): + """ + FirewallEgressRule defines rules for outgoing traffic + + ```proto + message metalstack.api.v2.FirewallEgressRule + ``` + + Attributes: + protocol: + Protocol the protocol for the rule, defaults to tcp + + ```proto + metalstack.api.v2.IPProtocol protocol = 1; + ``` + ports: + Ports the ports affected by this rule + + ```proto + repeated uint32 ports = 2 [packed = true]; + ``` + to: + To the destination cidrs affected by this rule + + ```proto + repeated string to = 3; + ``` + comment: + Comment for this rule + + ```proto + string comment = 4; + ``` + """ + + __slots__ = ("protocol", "ports", "to", "comment") + + if TYPE_CHECKING: + + def __init__( + self, + *, + protocol: IPProtocol | None = None, + ports: list[int] | None = None, + to: list[str] | None = None, + comment: str = "", + ) -> None: + pass + + protocol: IPProtocol + ports: list[int] + to: list[str] + comment: str + +_FirewallIngressRuleFields: TypeAlias = Literal["protocol", "ports", "to", "from", "comment"] + +class FirewallIngressRule(Message[_FirewallIngressRuleFields]): + """ + FirewallIngressRule defines rules for incoming traffic + + ```proto + message metalstack.api.v2.FirewallIngressRule + ``` + + Attributes: + protocol: + Protocol the protocol for the rule, defaults to tcp + + ```proto + metalstack.api.v2.IPProtocol protocol = 1; + ``` + ports: + Ports the ports affected by this rule + + ```proto + repeated uint32 ports = 2 [packed = true]; + ``` + to: + To the destination cidrs affected by this rule + + ```proto + repeated string to = 3; + ``` + from_: + From the source cidrs affected by this rule + + ```proto + repeated string from = 4; + ``` + comment: + Comment for this rule + + ```proto + string comment = 5; + ``` + """ + + __slots__ = ("protocol", "ports", "to", "from_", "comment") + + if TYPE_CHECKING: + + def __init__( + self, + *, + protocol: IPProtocol | None = None, + ports: list[int] | None = None, + to: list[str] | None = None, + from_: list[str] | None = None, + comment: str = "", + ) -> None: + pass + + protocol: IPProtocol + ports: list[int] + to: list[str] + from_: list[str] + comment: str + +_MachineNetworkFields: TypeAlias = Literal["network", "prefixes", "destination_prefixes", "ips", "network_type", "nat_type", "vrf", "asn", "project"] + +class MachineNetwork(Message[_MachineNetworkFields]): + """ + MachineNetwork contains details which network should be created on a allocated machine + + ```proto + message metalstack.api.v2.MachineNetwork + ``` + + Attributes: + network: + Network the networkID of the allocated machine in this vrf + + ```proto + string network = 1; + ``` + prefixes: + Prefixes the prefixes of this network + + ```proto + repeated string prefixes = 2; + ``` + destination_prefixes: + DestinationPrefixes prefixes that are reachable within this network + + ```proto + repeated string destination_prefixes = 3; + ``` + ips: + IPs the ip addresses of the allocated machine in this vrf + + ```proto + repeated string ips = 4; + ``` + network_type: + NetworkType the type of network of this vrf + + ```proto + metalstack.api.v2.NetworkType network_type = 5; + ``` + nat_type: + NatType what type of nat if any should be used + + ```proto + metalstack.api.v2.NATType nat_type = 6; + ``` + vrf: + VRF the vrf id + + ```proto + uint64 vrf = 7; + ``` + asn: + ASN the autonomous system number for this network + + ```proto + uint32 asn = 8; + ``` + project: + Project is the project uuid associated with this network + + ```proto + optional string project = 9; + ``` + """ + + __slots__ = ("network", "prefixes", "destination_prefixes", "ips", "network_type", "nat_type", "vrf", "asn", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: str = "", + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + ips: list[str] | None = None, + network_type: NetworkType | None = None, + nat_type: NATType | None = None, + vrf: int = 0, + asn: int = 0, + project: str | None = None, + ) -> None: + pass + + network: str + prefixes: list[str] + destination_prefixes: list[str] + ips: list[str] + network_type: NetworkType + nat_type: NATType + vrf: int + asn: int + project: str + +_MachineHardwareFields: TypeAlias = Literal["memory", "disks", "cpus", "gpus", "nics"] + +class MachineHardware(Message[_MachineHardwareFields]): + """ + MachineHardware contains hardware details + + ```proto + message metalstack.api.v2.MachineHardware + ``` + + Attributes: + memory: + Memory the total memory of the machine in bytes + + ```proto + uint64 memory = 1; + ``` + disks: + Disks the list of block devices of this machine + + ```proto + repeated metalstack.api.v2.MachineBlockDevice disks = 2; + ``` + cpus: + CPUs the cpu details + + ```proto + repeated metalstack.api.v2.MetalCPU cpus = 3; + ``` + gpus: + GPUs the gpu details + + ```proto + repeated metalstack.api.v2.MetalGPU gpus = 4; + ``` + nics: + Nics the list of network interfaces of this machine + + ```proto + repeated metalstack.api.v2.MachineNic nics = 5; + ``` + """ + + __slots__ = ("memory", "disks", "cpus", "gpus", "nics") + + if TYPE_CHECKING: + + def __init__( + self, + *, + memory: int = 0, + disks: list[MachineBlockDevice] | None = None, + cpus: list[MetalCPU] | None = None, + gpus: list[MetalGPU] | None = None, + nics: list[MachineNic] | None = None, + ) -> None: + pass + + memory: int + disks: list[MachineBlockDevice] + cpus: list[MetalCPU] + gpus: list[MetalGPU] + nics: list[MachineNic] + +_MetalCPUFields: TypeAlias = Literal["vendor", "model", "cores", "threads"] + +class MetalCPU(Message[_MetalCPUFields]): + """ + MetalCPU contains details of a cpu in this machine + + ```proto + message metalstack.api.v2.MetalCPU + ``` + + Attributes: + vendor: + Vendor of this cpu + + ```proto + string vendor = 1; + ``` + model: + Model of this cpu + + ```proto + string model = 2; + ``` + cores: + Cores of this cpu + + ```proto + uint32 cores = 3; + ``` + threads: + Threads of this cpu + + ```proto + uint32 threads = 4; + ``` + """ + + __slots__ = ("vendor", "model", "cores", "threads") + + if TYPE_CHECKING: + + def __init__( + self, + *, + vendor: str = "", + model: str = "", + cores: int = 0, + threads: int = 0, + ) -> None: + pass + + vendor: str + model: str + cores: int + threads: int + +_MetalGPUFields: TypeAlias = Literal["vendor", "model"] + +class MetalGPU(Message[_MetalGPUFields]): + """ + MetalGPU contains details of a gpu in this machine + + ```proto + message metalstack.api.v2.MetalGPU + ``` + + Attributes: + vendor: + Vendor of this gpu + + ```proto + string vendor = 1; + ``` + model: + Model of this gpu + + ```proto + string model = 2; + ``` + """ + + __slots__ = ("vendor", "model") + + if TYPE_CHECKING: + + def __init__( + self, + *, + vendor: str = "", + model: str = "", + ) -> None: + pass + + vendor: str + model: str + +_MachineNicFields: TypeAlias = Literal["mac", "name", "identifier", "vendor", "model", "speed", "neighbors", "hostname"] + +class MachineNic(Message[_MachineNicFields]): + """ + MachineNic contains details of a network interface of this machine + + ```proto + message metalstack.api.v2.MachineNic + ``` + + Attributes: + mac: + Mac the macaddress of this interface + + ```proto + string mac = 1; + ``` + name: + Name of this interface + + ```proto + string name = 2; + ``` + identifier: + Identifier the unique identifier of this network interface + + ```proto + string identifier = 3; + ``` + vendor: + Vendor of this network card + + ```proto + string vendor = 4; + ``` + model: + Model of this network card + + ```proto + string model = 5; + ``` + speed: + Speed in bits/second of this network card + + ```proto + uint64 speed = 6; + ``` + neighbors: + Neighbors the neighbors visible to this network interface + + ```proto + repeated metalstack.api.v2.MachineNic neighbors = 7; + ``` + hostname: + Hostname the nic belongs to + + ```proto + string hostname = 8; + ``` + """ + + __slots__ = ("mac", "name", "identifier", "vendor", "model", "speed", "neighbors", "hostname") + + if TYPE_CHECKING: + + def __init__( + self, + *, + mac: str = "", + name: str = "", + identifier: str = "", + vendor: str = "", + model: str = "", + speed: int = 0, + neighbors: list[MachineNic] | None = None, + hostname: str = "", + ) -> None: + pass + + mac: str + name: str + identifier: str + vendor: str + model: str + speed: int + neighbors: list[MachineNic] + hostname: str + +_MachineBlockDeviceFields: TypeAlias = Literal["name", "size"] + +class MachineBlockDevice(Message[_MachineBlockDeviceFields]): + """ + MachineBlockDevice contains details of a block device of this machine + + ```proto + message metalstack.api.v2.MachineBlockDevice + ``` + + Attributes: + name: + Name of this block device + + ```proto + string name = 1; + ``` + size: + Size of this block device in bytes + + ```proto + uint64 size = 2; + ``` + """ + + __slots__ = ("name", "size") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + size: int = 0, + ) -> None: + pass + + name: str + size: int + +_MachineChassisIdentifyLEDStateFields: TypeAlias = Literal["value", "description"] + +class MachineChassisIdentifyLEDState(Message[_MachineChassisIdentifyLEDStateFields]): + """ + MachineChassisIdentifyLEDState describes the identifier led state + + ```proto + message metalstack.api.v2.MachineChassisIdentifyLEDState + ``` + + Attributes: + value: + Value the state of this chassis identify LED. empty means LED-OFF + + ```proto + string value = 1; + ``` + description: + Description a description why this chassis identify LED is in the given state + + ```proto + string description = 2; + ``` + """ + + __slots__ = ("value", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + value: str = "", + description: str = "", + ) -> None: + pass + + value: str + description: str + +_MachineBMCReportFields: TypeAlias = Literal["bmc", "bios", "fru", "power_metric", "power_supplies", "led_state", "updated_at"] + +class MachineBMCReport(Message[_MachineBMCReportFields]): + """ + MachineBMCReport is sent from the metal-bmc to update bmc and power related details + + ```proto + message metalstack.api.v2.MachineBMCReport + ``` + + Attributes: + bmc: + Bmc contains bmc details + + ```proto + optional metalstack.api.v2.MachineBMC bmc = 1; + ``` + bios: + Bios contains bios details + + ```proto + optional metalstack.api.v2.MachineBios bios = 2; + ``` + fru: + Fru contains field replaceable unit details + + ```proto + optional metalstack.api.v2.MachineFRU fru = 3; + ``` + power_metric: + PowerMetric contains the power statistics of the machine + + ```proto + optional metalstack.api.v2.MachinePowerMetric power_metric = 4; + ``` + power_supplies: + PowerSupplies contains details about all power supplies and their state + + ```proto + repeated metalstack.api.v2.MachinePowerSupply power_supplies = 5; + ``` + led_state: + LedState indicates the state of the indicator LED on this machine + + ```proto + optional metalstack.api.v2.MachineChassisIdentifyLEDState led_state = 6; + ``` + updated_at: + UpdatedAt contains the date when this data was last updated + + ```proto + optional google.protobuf.Timestamp updated_at = 7; + ``` + """ + + __slots__ = ("bmc", "bios", "fru", "power_metric", "power_supplies", "led_state", "updated_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + bmc: MachineBMC | None = None, + bios: MachineBios | None = None, + fru: MachineFRU | None = None, + power_metric: MachinePowerMetric | None = None, + power_supplies: list[MachinePowerSupply] | None = None, + led_state: MachineChassisIdentifyLEDState | None = None, + updated_at: Timestamp | None = None, + ) -> None: + pass + + bmc: MachineBMC | None + bios: MachineBios | None + fru: MachineFRU | None + power_metric: MachinePowerMetric | None + power_supplies: list[MachinePowerSupply] + led_state: MachineChassisIdentifyLEDState | None + updated_at: Timestamp | None + +_MachineBiosFields: TypeAlias = Literal["version", "vendor", "date"] + +class MachineBios(Message[_MachineBiosFields]): + """ + MachineBios contains BIOS details of this machine + + ```proto + message metalstack.api.v2.MachineBios + ``` + + Attributes: + version: + Version the bios version + + ```proto + string version = 1; + ``` + vendor: + Vendor the bios vendor + + ```proto + string vendor = 2; + ``` + date: + Date the bios date as string because every vendor has different ideas how to describe the date + + ```proto + string date = 3; + ``` + """ + + __slots__ = ("version", "vendor", "date") + + if TYPE_CHECKING: + + def __init__( + self, + *, + version: str = "", + vendor: str = "", + date: str = "", + ) -> None: + pass + + version: str + vendor: str + date: str + +_MachineBMCFields: TypeAlias = Literal["address", "mac", "user", "password", "interface", "version", "power_state"] + +class MachineBMC(Message[_MachineBMCFields]): + """ + MachineBMC describe details of the ipmi or out of band device + + ```proto + message metalstack.api.v2.MachineBMC + ``` + + Attributes: + address: + Address of this ipmi device from outside in the form of : + + ```proto + string address = 1; + ``` + mac: + Mac address of the network interface of this ipmi device + + ```proto + string mac = 2; + ``` + user: + User of this ipmi device + + ```proto + string user = 3; + ``` + password: + Password of this ipmi device + + ```proto + string password = 4; + ``` + interface: + Interface of this ipmi device + + ```proto + string interface = 5; + ``` + version: + Version of this bmc device + + ```proto + string version = 6; + ``` + power_state: + PowerState of this machine + + ```proto + string power_state = 7; + ``` + """ + + __slots__ = ("address", "mac", "user", "password", "interface", "version", "power_state") + + if TYPE_CHECKING: + + def __init__( + self, + *, + address: str = "", + mac: str = "", + user: str = "", + password: str = "", + interface: str = "", + version: str = "", + power_state: str = "", + ) -> None: + pass + + address: str + mac: str + user: str + password: str + interface: str + version: str + power_state: str + +_MachineFRUFields: TypeAlias = Literal["chassis_part_number", "chassis_part_serial", "board_mfg", "board_mfg_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial"] + +class MachineFRU(Message[_MachineFRUFields]): + """ + MachineFRU describes details to the machine which are required in case of a necessary replacement + + ```proto + message metalstack.api.v2.MachineFRU + ``` + + Attributes: + chassis_part_number: + ChassisPartNumber is the part number of the machine chassis + + ```proto + optional string chassis_part_number = 1; + ``` + chassis_part_serial: + ChassisPartSerial is the serial number of the machine chassis + + ```proto + optional string chassis_part_serial = 2; + ``` + board_mfg: + BoardMfg is the short description of the mainboard + + ```proto + optional string board_mfg = 3; + ``` + board_mfg_serial: + BoardMfgSerial is the serial number of the mainboard + + ```proto + optional string board_mfg_serial = 4; + ``` + board_part_number: + BoardPartNumber is the part number of the mainboard + + ```proto + optional string board_part_number = 5; + ``` + product_manufacturer: + ProductManufacturer is the manufacturer of the machine + + ```proto + optional string product_manufacturer = 6; + ``` + product_part_number: + ProductPartNumber is the part number of the machine + + ```proto + optional string product_part_number = 7; + ``` + product_serial: + ProductSerial is the serial number of the machine + + ```proto + optional string product_serial = 8; + ``` + """ + + __slots__ = ("chassis_part_number", "chassis_part_serial", "board_mfg", "board_mfg_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial") + + if TYPE_CHECKING: + + def __init__( + self, + *, + chassis_part_number: str | None = None, + chassis_part_serial: str | None = None, + board_mfg: str | None = None, + board_mfg_serial: str | None = None, + board_part_number: str | None = None, + product_manufacturer: str | None = None, + product_part_number: str | None = None, + product_serial: str | None = None, + ) -> None: + pass + + chassis_part_number: str + chassis_part_serial: str + board_mfg: str + board_mfg_serial: str + board_part_number: str + product_manufacturer: str + product_part_number: str + product_serial: str + +_MachinePowerMetricFields: TypeAlias = Literal["average_consumed_watts", "interval_in_min", "max_consumed_watts", "min_consumed_watts"] + +class MachinePowerMetric(Message[_MachinePowerMetricFields]): + """ + MachinePowerMetric contains metrics of the power consumption of a machine + + ```proto + message metalstack.api.v2.MachinePowerMetric + ``` + + Attributes: + average_consumed_watts: + AverageConsumedWatts shall represent the + average power level that occurred averaged over the last IntervalInMin + minutes. + + ```proto + float average_consumed_watts = 1; + ``` + interval_in_min: + IntervalInMin shall represent the time + interval (or window), in minutes, in which the PowerMetrics properties + are measured over. + Should be an integer, but some Dell implementations return as a float. + + ```proto + float interval_in_min = 2; + ``` + max_consumed_watts: + MaxConsumedWatts shall represent the + maximum power level in watts that occurred within the last + IntervalInMin minutes. + + ```proto + float max_consumed_watts = 3; + ``` + min_consumed_watts: + MinConsumedWatts shall represent the + minimum power level in watts that occurred within the last + IntervalInMin minutes. + + ```proto + float min_consumed_watts = 4; + ``` + """ + + __slots__ = ("average_consumed_watts", "interval_in_min", "max_consumed_watts", "min_consumed_watts") + + if TYPE_CHECKING: + + def __init__( + self, + *, + average_consumed_watts: float = 0, + interval_in_min: float = 0, + max_consumed_watts: float = 0, + min_consumed_watts: float = 0, + ) -> None: + pass + + average_consumed_watts: float + interval_in_min: float + max_consumed_watts: float + min_consumed_watts: float + +_MachinePowerSupplyFields: TypeAlias = Literal["health", "state"] + +class MachinePowerSupply(Message[_MachinePowerSupplyFields]): + """ + MachinePowerSupply contains details of the power supply of a machine + + ```proto + message metalstack.api.v2.MachinePowerSupply + ``` + + Attributes: + health: + Health of the powersupply + + ```proto + string health = 1; + ``` + state: + State of the powersupply + + ```proto + string state = 2; + ``` + """ + + __slots__ = ("health", "state") + + if TYPE_CHECKING: + + def __init__( + self, + *, + health: str = "", + state: str = "", + ) -> None: + pass + + health: str + state: str + +_MachineRecentProvisioningEventsFields: TypeAlias = Literal["events", "last_event_time", "last_error_event", "state"] + +class MachineRecentProvisioningEvents(Message[_MachineRecentProvisioningEventsFields]): + """ + MachineRecentProvisioningEvents the recent provisioning events for this machine + + ```proto + message metalstack.api.v2.MachineRecentProvisioningEvents + ``` + + Attributes: + events: + Events the log of recent machine provisioning events + + ```proto + repeated metalstack.api.v2.MachineProvisioningEvent events = 1; + ``` + last_event_time: + LastEventTime the time where the last event was received + + ```proto + optional google.protobuf.Timestamp last_event_time = 2; + ``` + last_error_event: + LastErrorEvent the last erroneous event received + + ```proto + optional metalstack.api.v2.MachineProvisioningEvent last_error_event = 3; + ``` + state: + State can be either CrashLoop, FailedReclaim or something else + + ```proto + metalstack.api.v2.MachineProvisioningEventState state = 4; + ``` + """ + + __slots__ = ("events", "last_event_time", "last_error_event", "state") + + if TYPE_CHECKING: + + def __init__( + self, + *, + events: list[MachineProvisioningEvent] | None = None, + last_event_time: Timestamp | None = None, + last_error_event: MachineProvisioningEvent | None = None, + state: MachineProvisioningEventState | None = None, + ) -> None: + pass + + events: list[MachineProvisioningEvent] + last_event_time: Timestamp | None + last_error_event: MachineProvisioningEvent | None + state: MachineProvisioningEventState + +_MachineProvisioningEventFields: TypeAlias = Literal["time", "event", "message"] + +class MachineProvisioningEvent(Message[_MachineProvisioningEventFields]): + """ + MachineProvisioningEvent is an event that has occurred during provisioning + + ```proto + message metalstack.api.v2.MachineProvisioningEvent + ``` + + Attributes: + time: + Time the time that this event was received + + ```proto + optional google.protobuf.Timestamp time = 1; + ``` + event: + Event the event emitted by the machine + + ```proto + metalstack.api.v2.MachineProvisioningEventType event = 2; + ``` + message: + Message an additional message to add to the event + + ```proto + string message = 3; + ``` + """ + + __slots__ = ("time", "event", "message") + + if TYPE_CHECKING: + + def __init__( + self, + *, + time: Timestamp | None = None, + event: MachineProvisioningEventType | None = None, + message: str = "", + ) -> None: + pass + + time: Timestamp | None + event: MachineProvisioningEventType + message: str + +_MachineVPNFields: TypeAlias = Literal["control_plane_address", "auth_key", "connected", "ips"] + +class MachineVPN(Message[_MachineVPNFields]): + """ + MachineVPN contains configuration data for the VPN connection + + ```proto + message metalstack.api.v2.MachineVPN + ``` + + Attributes: + control_plane_address: + Address of VPN control plane + + ```proto + string control_plane_address = 1; + ``` + auth_key: + Auth key used to connect to VPN + + ```proto + string auth_key = 2; + ``` + connected: + Connected indicate if this machine is connected to the VPN + + ```proto + bool connected = 3; + ``` + ips: + IPs of the machine connected to the vpn + + ```proto + repeated string ips = 4; + ``` + """ + + __slots__ = ("control_plane_address", "auth_key", "connected", "ips") + + if TYPE_CHECKING: + + def __init__( + self, + *, + control_plane_address: str = "", + auth_key: str = "", + connected: bool = False, + ips: list[str] | None = None, + ) -> None: + pass + + control_plane_address: str + auth_key: str + connected: bool + ips: list[str] + +_MachineQueryFields: TypeAlias = Literal["uuid", "name", "partition", "size", "rack", "room", "labels", "allocation", "network", "nic", "disk", "bmc", "fru", "hardware", "state", "waiting", "preallocated", "not_allocated"] + +class MachineQuery(Message[_MachineQueryFields]): + """ + MachineQuery contains fields which can be specified to list specific machines. + + ```proto + message metalstack.api.v2.MachineQuery + ``` + + Attributes: + uuid: + UUID of the machine to get + + ```proto + optional string uuid = 1; + ``` + name: + Name of the machine to get + + ```proto + optional string name = 2; + ``` + partition: + Partition of the machine to get + + ```proto + optional string partition = 3; + ``` + size: + Size of the machine to get + + ```proto + optional string size = 4; + ``` + rack: + Rack of the machine to get + + ```proto + optional string rack = 5; + ``` + room: + Room of the machine to get + + ```proto + optional string room = 6; + ``` + labels: + Labels for which this machine should get filtered + + ```proto + optional metalstack.api.v2.Labels labels = 7; + ``` + allocation: + Allocation specific machine queries + + ```proto + optional metalstack.api.v2.MachineAllocationQuery allocation = 8; + ``` + network: + Network specific machine queries + + ```proto + optional metalstack.api.v2.MachineNetworkQuery network = 9; + ``` + nic: + Nic specific machine queries + + ```proto + optional metalstack.api.v2.MachineNicQuery nic = 10; + ``` + disk: + Disk specific machine queries + + ```proto + optional metalstack.api.v2.MachineDiskQuery disk = 11; + ``` + bmc: + Bmc specific machine queries + + ```proto + optional metalstack.api.v2.MachineBMCQuery bmc = 12; + ``` + fru: + Fru specific machine queries + + ```proto + optional metalstack.api.v2.MachineFRUQuery fru = 13; + ``` + hardware: + Hardware specific machine query + + ```proto + optional metalstack.api.v2.MachineHardwareQuery hardware = 14; + ``` + state: + State this machine has + + ```proto + optional metalstack.api.v2.MachineState state = 15; + ``` + waiting: + Waiting if set to true, only waiting machines are returned. + Only useful for admins. + + ```proto + optional bool waiting = 16; + ``` + preallocated: + Preallocated if set to true, only machines which are preallocated are returned. + Only useful for admins. + + ```proto + optional bool preallocated = 17; + ``` + not_allocated: + NotAllocated if set to true, only machines which are not allocated are returned. + Only useful for admins. + + ```proto + optional bool not_allocated = 18; + ``` + """ + + __slots__ = ("uuid", "name", "partition", "size", "rack", "room", "labels", "allocation", "network", "nic", "disk", "bmc", "fru", "hardware", "state", "waiting", "preallocated", "not_allocated") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + name: str | None = None, + partition: str | None = None, + size: str | None = None, + rack: str | None = None, + room: str | None = None, + labels: Labels | None = None, + allocation: MachineAllocationQuery | None = None, + network: MachineNetworkQuery | None = None, + nic: MachineNicQuery | None = None, + disk: MachineDiskQuery | None = None, + bmc: MachineBMCQuery | None = None, + fru: MachineFRUQuery | None = None, + hardware: MachineHardwareQuery | None = None, + state: MachineState | None = None, + waiting: bool | None = None, + preallocated: bool | None = None, + not_allocated: bool | None = None, + ) -> None: + pass + + uuid: str + name: str + partition: str + size: str + rack: str + room: str + labels: Labels | None + allocation: MachineAllocationQuery | None + network: MachineNetworkQuery | None + nic: MachineNicQuery | None + disk: MachineDiskQuery | None + bmc: MachineBMCQuery | None + fru: MachineFRUQuery | None + hardware: MachineHardwareQuery | None + state: MachineState + waiting: bool + preallocated: bool + not_allocated: bool + +_MachineAllocationQueryFields: TypeAlias = Literal["uuid", "name", "project", "image", "filesystem_layout", "hostname", "allocation_type", "labels", "vpn"] + +class MachineAllocationQuery(Message[_MachineAllocationQueryFields]): + """ + MachineAllocationQuery allocation specific query parameters + + ```proto + message metalstack.api.v2.MachineAllocationQuery + ``` + + Attributes: + uuid: + UUID of the allocation of the machine to get + + ```proto + optional string uuid = 1; + ``` + name: + Name of the machine to get + + ```proto + optional string name = 2; + ``` + project: + Project of the machine to get + + ```proto + optional string project = 3; + ``` + image: + Image of the machine to get + + ```proto + optional string image = 4; + ``` + filesystem_layout: + FilesystemLayout of the machine to get + + ```proto + optional string filesystem_layout = 5; + ``` + hostname: + Hostname of the machine to get + + ```proto + optional string hostname = 6; + ``` + allocation_type: + AllocationType of this machine + + ```proto + optional metalstack.api.v2.MachineAllocationType allocation_type = 7; + ``` + labels: + Labels for which this machine allocation should get filtered + + ```proto + optional metalstack.api.v2.Labels labels = 8; + ``` + vpn: + VPN query if this machine has a vpn configuration + + ```proto + optional metalstack.api.v2.MachineVPN vpn = 9; + ``` + """ + + __slots__ = ("uuid", "name", "project", "image", "filesystem_layout", "hostname", "allocation_type", "labels", "vpn") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + name: str | None = None, + project: str | None = None, + image: str | None = None, + filesystem_layout: str | None = None, + hostname: str | None = None, + allocation_type: MachineAllocationType | None = None, + labels: Labels | None = None, + vpn: MachineVPN | None = None, + ) -> None: + pass + + uuid: str + name: str + project: str + image: str + filesystem_layout: str + hostname: str + allocation_type: MachineAllocationType + labels: Labels | None + vpn: MachineVPN | None + +_MachineNetworkQueryFields: TypeAlias = Literal["networks", "prefixes", "destination_prefixes", "ips", "vrfs", "asns"] + +class MachineNetworkQuery(Message[_MachineNetworkQueryFields]): + """ + MachineNetworkQuery network specific machine queries + + ```proto + message metalstack.api.v2.MachineNetworkQuery + ``` + + Attributes: + networks: + Networks this machine is connected to + + ```proto + repeated string networks = 1; + ``` + prefixes: + Prefixes this machine is connected to + + ```proto + repeated string prefixes = 2; + ``` + destination_prefixes: + DestinationPrefixes this machine is connected to + + ```proto + repeated string destination_prefixes = 3; + ``` + ips: + IPs this machine has + + ```proto + repeated string ips = 4; + ``` + vrfs: + VRFs this machine is connected to + + ```proto + repeated uint64 vrfs = 5 [packed = true]; + ``` + asns: + ASNs this machine is connected to + + ```proto + repeated uint32 asns = 6 [packed = true]; + ``` + """ + + __slots__ = ("networks", "prefixes", "destination_prefixes", "ips", "vrfs", "asns") + + if TYPE_CHECKING: + + def __init__( + self, + *, + networks: list[str] | None = None, + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + ips: list[str] | None = None, + vrfs: list[int] | None = None, + asns: list[int] | None = None, + ) -> None: + pass + + networks: list[str] + prefixes: list[str] + destination_prefixes: list[str] + ips: list[str] + vrfs: list[int] + asns: list[int] + +_MachineNicQueryFields: TypeAlias = Literal["macs", "names", "neighbor_macs", "neighbor_names"] + +class MachineNicQuery(Message[_MachineNicQueryFields]): + """ + MachineNicQuery nic specific machine queries + + ```proto + message metalstack.api.v2.MachineNicQuery + ``` + + Attributes: + macs: + Macs this machine nic has + + ```proto + repeated string macs = 1; + ``` + names: + Names this machine nic has + + ```proto + repeated string names = 2; + ``` + neighbor_macs: + NeighborMacs this machine nic has + + ```proto + repeated string neighbor_macs = 3; + ``` + neighbor_names: + NeighborNames this machine nic has + + ```proto + repeated string neighbor_names = 4; + ``` + """ + + __slots__ = ("macs", "names", "neighbor_macs", "neighbor_names") + + if TYPE_CHECKING: + + def __init__( + self, + *, + macs: list[str] | None = None, + names: list[str] | None = None, + neighbor_macs: list[str] | None = None, + neighbor_names: list[str] | None = None, + ) -> None: + pass + + macs: list[str] + names: list[str] + neighbor_macs: list[str] + neighbor_names: list[str] + +_MachineDiskQueryFields: TypeAlias = Literal["names", "sizes"] + +class MachineDiskQuery(Message[_MachineDiskQueryFields]): + """ + MachineDiskQuery disk specific machine queries + + ```proto + message metalstack.api.v2.MachineDiskQuery + ``` + + Attributes: + names: + Names of disks in this machine + + ```proto + repeated string names = 1; + ``` + sizes: + Sizes of disks in this machine + + ```proto + repeated uint64 sizes = 2 [packed = true]; + ``` + """ + + __slots__ = ("names", "sizes") + + if TYPE_CHECKING: + + def __init__( + self, + *, + names: list[str] | None = None, + sizes: list[int] | None = None, + ) -> None: + pass + + names: list[str] + sizes: list[int] + +_MachineBMCQueryFields: TypeAlias = Literal["address", "mac", "user", "interface"] + +class MachineBMCQuery(Message[_MachineBMCQueryFields]): + """ + MachineBMCQuery machine ipmi or bmc specific machine queries + + ```proto + message metalstack.api.v2.MachineBMCQuery + ``` + + Attributes: + address: + Address of the ipmi system of this machine + + ```proto + optional string address = 1; + ``` + mac: + Mac of the ipmi system of this machine + + ```proto + optional string mac = 2; + ``` + user: + User of the ipmi system of this machine + + ```proto + optional string user = 3; + ``` + interface: + Interface of the ipmi system of this machine + + ```proto + optional string interface = 4; + ``` + """ + + __slots__ = ("address", "mac", "user", "interface") + + if TYPE_CHECKING: + + def __init__( + self, + *, + address: str | None = None, + mac: str | None = None, + user: str | None = None, + interface: str | None = None, + ) -> None: + pass + + address: str + mac: str + user: str + interface: str + +_MachineFRUQueryFields: TypeAlias = Literal["chassis_part_number", "chassis_part_serial", "board_mfg", "board_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial"] + +class MachineFRUQuery(Message[_MachineFRUQueryFields]): + """ + MachineFRUQuery machine fru specific machine queries + + ```proto + message metalstack.api.v2.MachineFRUQuery + ``` + + Attributes: + chassis_part_number: + ChassisPartNumber of this machine + + ```proto + optional string chassis_part_number = 1; + ``` + chassis_part_serial: + ChassisPartSerial of this machine + + ```proto + optional string chassis_part_serial = 2; + ``` + board_mfg: + BoardMFG of this machine + + ```proto + optional string board_mfg = 3; + ``` + board_serial: + BoardSerial of this machine + + ```proto + optional string board_serial = 4; + ``` + board_part_number: + BoardPartNumber of this machine + + ```proto + optional string board_part_number = 5; + ``` + product_manufacturer: + ProductManufacturer of this machine + + ```proto + optional string product_manufacturer = 6; + ``` + product_part_number: + ProductPartNumber of this machine + + ```proto + optional string product_part_number = 7; + ``` + product_serial: + ProductSerial of this machine + + ```proto + optional string product_serial = 8; + ``` + """ + + __slots__ = ("chassis_part_number", "chassis_part_serial", "board_mfg", "board_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial") + + if TYPE_CHECKING: + + def __init__( + self, + *, + chassis_part_number: str | None = None, + chassis_part_serial: str | None = None, + board_mfg: str | None = None, + board_serial: str | None = None, + board_part_number: str | None = None, + product_manufacturer: str | None = None, + product_part_number: str | None = None, + product_serial: str | None = None, + ) -> None: + pass + + chassis_part_number: str + chassis_part_serial: str + board_mfg: str + board_serial: str + board_part_number: str + product_manufacturer: str + product_part_number: str + product_serial: str + +_MachineHardwareQueryFields: TypeAlias = Literal["memory", "cpu_cores"] + +class MachineHardwareQuery(Message[_MachineHardwareQueryFields]): + """ + MachineHardwareQuery machine hardware specific machine queries + + ```proto + message metalstack.api.v2.MachineHardwareQuery + ``` + + Attributes: + memory: + Memory the total memory of the machine in bytes + + ```proto + optional uint64 memory = 1; + ``` + cpu_cores: + CPUCores the number of cpu cores + + ```proto + optional uint32 cpu_cores = 2; + ``` + """ + + __slots__ = ("memory", "cpu_cores") + + if TYPE_CHECKING: + + def __init__( + self, + *, + memory: int | None = None, + cpu_cores: int | None = None, + ) -> None: + pass + + memory: int + cpu_cores: int + +_MachineIssuesQueryFields: TypeAlias = Literal["machine_query", "only", "omit", "severity", "last_error_threshold"] + +class MachineIssuesQuery(Message[_MachineIssuesQueryFields]): + """ + MachineIssuesQuery defines which machine issues should be listed + + ```proto + message metalstack.api.v2.MachineIssuesQuery + ``` + + Attributes: + machine_query: + MachineQuery to select specific machines + + ```proto + optional metalstack.api.v2.MachineQuery machine_query = 1; + ``` + only: + Only includes the specified machine issue types + + ```proto + repeated metalstack.api.v2.MachineIssueType only = 2 [packed = true]; + ``` + omit: + Omits the specified machine issues + + ```proto + repeated metalstack.api.v2.MachineIssueType omit = 3 [packed = true]; + ``` + severity: + Severity filters issue for given severity + + ```proto + optional metalstack.api.v2.MachineIssueSeverity severity = 4; + ``` + last_error_threshold: + LastErrorThreshold defines the last error threshold + + ```proto + optional google.protobuf.Duration last_error_threshold = 5; + ``` + """ + + __slots__ = ("machine_query", "only", "omit", "severity", "last_error_threshold") + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine_query: MachineQuery | None = None, + only: list[MachineIssueType] | None = None, + omit: list[MachineIssueType] | None = None, + severity: MachineIssueSeverity | None = None, + last_error_threshold: Duration | None = None, + ) -> None: + pass + + machine_query: MachineQuery | None + only: list[MachineIssueType] + omit: list[MachineIssueType] + severity: MachineIssueSeverity + last_error_threshold: Duration | None + +_MachineIssuesFields: TypeAlias = Literal["uuid", "issues"] + +class MachineIssues(Message[_MachineIssuesFields]): + """ + MachineIssues is a list of issues for a machine + + ```proto + message metalstack.api.v2.MachineIssues + ``` + + Attributes: + uuid: + UUID of the machine for which the issues are listed + + ```proto + string uuid = 1; + ``` + issues: + Issues of this machine + + ```proto + repeated metalstack.api.v2.MachineIssue issues = 2; + ``` + """ + + __slots__ = ("uuid", "issues") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + issues: list[MachineIssue] | None = None, + ) -> None: + pass + + uuid: str + issues: list[MachineIssue] + +_MachineIssueFields: TypeAlias = Literal["type", "severity", "description", "reference_url", "details"] + +class MachineIssue(Message[_MachineIssueFields]): + """ + MachineIssue contains details of one issue + + ```proto + message metalstack.api.v2.MachineIssue + ``` + + Attributes: + type: + Type specifies the issue type (id) + + ```proto + metalstack.api.v2.MachineIssueType type = 1; + ``` + severity: + Severity specifies the severity of an issue + + ```proto + metalstack.api.v2.MachineIssueSeverity severity = 2; + ``` + description: + Description provides an issue description + + ```proto + string description = 3; + ``` + reference_url: + RefURL provides a link to a more detailed issue description in the metal-stack documentation + + ```proto + string reference_url = 4; + ``` + details: + Details may contain additional details on an evaluated issue + + ```proto + string details = 5; + ``` + """ + + __slots__ = ("type", "severity", "description", "reference_url", "details") + + if TYPE_CHECKING: + + def __init__( + self, + *, + type: MachineIssueType | None = None, + severity: MachineIssueSeverity | None = None, + description: str = "", + reference_url: str = "", + details: str = "", + ) -> None: + pass + + type: MachineIssueType + severity: MachineIssueSeverity + description: str + reference_url: str + details: str + +class IPProtocol(Enum): + """ + IPProtocol defines tcp|udp + + ```proto + enum metalstack.api.v2.IPProtocol + ``` + + Attributes: + UNSPECIFIED: + IP_PROTOCOL_UNSPECIFIED is not specified + + ```proto + IP_PROTOCOL_UNSPECIFIED = 0 + ``` + TCP: + IP_PROTOCOL_TCP is tcp + + ```proto + IP_PROTOCOL_TCP = 1 + ``` + UDP: + IP_PROTOCOL_UDP is udp + + ```proto + IP_PROTOCOL_UDP = 2 + ``` + """ + + UNSPECIFIED = 0 + TCP = 1 + UDP = 2 + +class MachineState(Enum): + """ + MachineState defines if the machine was locked or reserved from a operator + + ```proto + enum metalstack.api.v2.MachineState + ``` + + Attributes: + UNSPECIFIED: + MACHINE_STATE_UNSPECIFIED is not specified + + ```proto + MACHINE_STATE_UNSPECIFIED = 0 + ``` + TAINTED: + MACHINE_STATE_TAINTED this machine is tainted, i.e. this machine is not considered during random machine allocation, but still by specifying the uuid + + ```proto + MACHINE_STATE_TAINTED = 1 + ``` + LOCKED: + MACHINE_STATE_LOCKED this machine is locked, i.e. this machine cannot be allocated or deleted + + ```proto + MACHINE_STATE_LOCKED = 2 + ``` + AVAILABLE: + MACHINE_STATE_AVAILABLE this machine is available for all + + ```proto + MACHINE_STATE_AVAILABLE = 3 + ``` + """ + + UNSPECIFIED = 0 + TAINTED = 1 + LOCKED = 2 + AVAILABLE = 3 + +class MachineProvisioningEventState(Enum): + """ + MachineProvisioningEventState possible event states + + ```proto + enum metalstack.api.v2.MachineProvisioningEventState + ``` + + Attributes: + UNSPECIFIED: + MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED is not specified + + ```proto + MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED = 0 + ``` + CRASHLOOP: + MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP machine is in crash loop + + ```proto + MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP = 1 + ``` + FAILED_RECLAIM: + MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM machine is in failed reclaim + + ```proto + MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM = 2 + ``` + """ + + UNSPECIFIED = 0 + CRASHLOOP = 1 + FAILED_RECLAIM = 2 + +class MachineProvisioningEventType(Enum): + """ + MachineProvisioningEventType defines in which phase the machine actually is + + ```proto + enum metalstack.api.v2.MachineProvisioningEventType + ``` + + Attributes: + UNSPECIFIED: + MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED is not specified + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED = 0 + ``` + ALIVE: + MACHINE_PROVISIONING_EVENT_TYPE_ALIVE machine is alive + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_ALIVE = 1 + ``` + CRASHED: + MACHINE_PROVISIONING_EVENT_TYPE_CRASHED machine crashed + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_CRASHED = 2 + ``` + PXE_BOOTING: + MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING machine is pxe booting into metal-hammer + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING = 3 + ``` + PLANNED_REBOOT: + MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT machine got a reboot instruction + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT = 4 + ``` + PREPARING: + MACHINE_PROVISIONING_EVENT_TYPE_PREPARING metal-hammer is preparing the machine + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_PREPARING = 5 + ``` + REGISTERING: + MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING metal-hammer registers machine at the apiserver + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING = 6 + ``` + WAITING: + MACHINE_PROVISIONING_EVENT_TYPE_WAITING machine is waiting for installation + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_WAITING = 7 + ``` + INSTALLING: + MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING metal-hammer is installing the desired os + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING = 8 + ``` + BOOTING_NEW_KERNEL: + MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL metal-hammer completed installation and boots into target os + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL = 9 + ``` + PHONED_HOME: + MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME machine is installed and phones home + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME = 10 + ``` + MACHINE_RECLAIM: + MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM machine is not allocated, but phones home + + ```proto + MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM = 11 + ``` + """ + + UNSPECIFIED = 0 + ALIVE = 1 + CRASHED = 2 + PXE_BOOTING = 3 + PLANNED_REBOOT = 4 + PREPARING = 5 + REGISTERING = 6 + WAITING = 7 + INSTALLING = 8 + BOOTING_NEW_KERNEL = 9 + PHONED_HOME = 10 + MACHINE_RECLAIM = 11 + +class MachineLiveliness(Enum): + """ + MachineLiveliness specifies the liveliness of a machine + + ```proto + enum metalstack.api.v2.MachineLiveliness + ``` + + Attributes: + UNSPECIFIED: + MACHINE_LIVELINESS_UNSPECIFIED is not defined + + ```proto + MACHINE_LIVELINESS_UNSPECIFIED = 0 + ``` + ALIVE: + MACHINE_LIVELINESS_ALIVE liveliness is alive + + ```proto + MACHINE_LIVELINESS_ALIVE = 1 + ``` + DEAD: + MACHINE_LIVELINESS_DEAD liveliness is dead + + ```proto + MACHINE_LIVELINESS_DEAD = 2 + ``` + UNKNOWN: + MACHINE_LIVELINESS_UNKNOWN liveliness is unknown + + ```proto + MACHINE_LIVELINESS_UNKNOWN = 3 + ``` + """ + + UNSPECIFIED = 0 + ALIVE = 1 + DEAD = 2 + UNKNOWN = 3 + +class MachineAllocationType(Enum): + """ + MachineAllocationType defines if this is a machine or a firewall + + ```proto + enum metalstack.api.v2.MachineAllocationType + ``` + + Attributes: + UNSPECIFIED: + MACHINE_ALLOCATION_TYPE_UNSPECIFIED is unspecified + + ```proto + MACHINE_ALLOCATION_TYPE_UNSPECIFIED = 0 + ``` + MACHINE: + MACHINE_ALLOCATION_TYPE_MACHINE is a machine + + ```proto + MACHINE_ALLOCATION_TYPE_MACHINE = 1 + ``` + FIREWALL: + MACHINE_ALLOCATION_TYPE_FIREWALL is a firewall + + ```proto + MACHINE_ALLOCATION_TYPE_FIREWALL = 2 + ``` + """ + + UNSPECIFIED = 0 + MACHINE = 1 + FIREWALL = 2 + +class MachineBMCCommand(Enum): + """ + MachineBMCCommand defines commands send to the BMC of the machine + + ```proto + enum metalstack.api.v2.MachineBMCCommand + ``` + + Attributes: + UNSPECIFIED: + MACHINE_BMC_COMMAND_UNSPECIFIED is not defined + + ```proto + MACHINE_BMC_COMMAND_UNSPECIFIED = 0 + ``` + ON: + MACHINE_BMC_COMMAND_ON Power on the machine + + ```proto + MACHINE_BMC_COMMAND_ON = 1 + ``` + OFF: + MACHINE_BMC_COMMAND_OFF Power off the machine + + ```proto + MACHINE_BMC_COMMAND_OFF = 2 + ``` + RESET: + MACHINE_BMC_COMMAND_RESET Power reset the machine + + ```proto + MACHINE_BMC_COMMAND_RESET = 3 + ``` + CYCLE: + MACHINE_BMC_COMMAND_CYCLE Power cycle the machine + + ```proto + MACHINE_BMC_COMMAND_CYCLE = 4 + ``` + BOOT_TO_BIOS: + MACHINE_BMC_COMMAND_BOOT_TO_BIOS boot the machine into bios + + ```proto + MACHINE_BMC_COMMAND_BOOT_TO_BIOS = 5 + ``` + BOOT_FROM_DISK: + MACHINE_BMC_COMMAND_BOOT_FROM_DISK boot the machine from hard disk + + ```proto + MACHINE_BMC_COMMAND_BOOT_FROM_DISK = 6 + ``` + BOOT_FROM_PXE: + MACHINE_BMC_COMMAND_BOOT_FROM_PXE boot the machine from pxe + + ```proto + MACHINE_BMC_COMMAND_BOOT_FROM_PXE = 7 + ``` + IDENTIFY_LED_ON: + MACHINE_BMC_COMMAND_IDENTIFY_LED_ON set identify led of the machine chassis to on + + ```proto + MACHINE_BMC_COMMAND_IDENTIFY_LED_ON = 8 + ``` + IDENTIFY_LED_OFF: + MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF set identify led of the machine chassis to off + + ```proto + MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF = 9 + ``` + MACHINE_DELETED: + MACHINE_BMC_COMMAND_MACHINE_DELETED should be called if the machine was deleted to power cycle and boot into pxe + + ```proto + MACHINE_BMC_COMMAND_MACHINE_DELETED = 10 + ``` + MACHINE_CREATED: + MACHINE_BMC_COMMAND_MACHINE_CREATED should be called if the machine was created to set the boot order to boot from disk + + ```proto + MACHINE_BMC_COMMAND_MACHINE_CREATED = 11 + ``` + """ + + UNSPECIFIED = 0 + ON = 1 + OFF = 2 + RESET = 3 + CYCLE = 4 + BOOT_TO_BIOS = 5 + BOOT_FROM_DISK = 6 + BOOT_FROM_PXE = 7 + IDENTIFY_LED_ON = 8 + IDENTIFY_LED_OFF = 9 + MACHINE_DELETED = 10 + MACHINE_CREATED = 11 + +class MachineIssueType(Enum): + """ + MachineIssueType defines which type of issue it is + + ```proto + enum metalstack.api.v2.MachineIssueType + ``` + + Attributes: + UNSPECIFIED: + MACHINE_ISSUE_TYPE_UNSPECIFIED type is not specified + + ```proto + MACHINE_ISSUE_TYPE_UNSPECIFIED = 0 + ``` + ASN_UNIQUENESS: + MACHINE_ISSUE_TYPE_ASN_UNIQUENESS machine asn is not unique + + ```proto + MACHINE_ISSUE_TYPE_ASN_UNIQUENESS = 1 + ``` + BMC_INFO_OUTDATED: + MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED machine bmc info out of date + + ```proto + MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED = 2 + ``` + BMC_NON_DISTINCT_IP: + MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP machine bmc ip is not distinct + + ```proto + MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP = 3 + ``` + BMC_WITHOUT_IP: + MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP machine bmc without ip + + ```proto + MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP = 4 + ``` + BMC_WITHOUT_MAC: + MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC machine bmc without mac address + + ```proto + MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC = 5 + ``` + CRASH_LOOP: + MACHINE_ISSUE_TYPE_CRASH_LOOP machine is in crashloop + + ```proto + MACHINE_ISSUE_TYPE_CRASH_LOOP = 6 + ``` + FAILED_MACHINE_RECLAIM: + MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM machine was not freed after delete + + ```proto + MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM = 7 + ``` + LAST_EVENT_ERROR: + MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR machine last event error + + ```proto + MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR = 8 + ``` + LIVELINESS_DEAD: + MACHINE_ISSUE_TYPE_LIVELINESS_DEAD machine is dead + + ```proto + MACHINE_ISSUE_TYPE_LIVELINESS_DEAD = 9 + ``` + LIVELINESS_NOT_AVAILABLE: + MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE machine liveliness is not available + + ```proto + MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE = 10 + ``` + LIVELINESS_UNKNOWN: + MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN machine liveliness is unknown + + ```proto + MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN = 11 + ``` + NO_EVENT_CONTAINER: + MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER machine does not have a event container + + ```proto + MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER = 12 + ``` + NO_PARTITION: + MACHINE_ISSUE_TYPE_NO_PARTITION no partition set + + ```proto + MACHINE_ISSUE_TYPE_NO_PARTITION = 13 + ``` + """ + + UNSPECIFIED = 0 + ASN_UNIQUENESS = 1 + BMC_INFO_OUTDATED = 2 + BMC_NON_DISTINCT_IP = 3 + BMC_WITHOUT_IP = 4 + BMC_WITHOUT_MAC = 5 + CRASH_LOOP = 6 + FAILED_MACHINE_RECLAIM = 7 + LAST_EVENT_ERROR = 8 + LIVELINESS_DEAD = 9 + LIVELINESS_NOT_AVAILABLE = 10 + LIVELINESS_UNKNOWN = 11 + NO_EVENT_CONTAINER = 12 + NO_PARTITION = 13 + +class MachineIssueSeverity(Enum): + """ + MachineIssueSeverity defines the severity of an issue + + ```proto + enum metalstack.api.v2.MachineIssueSeverity + ``` + + Attributes: + UNSPECIFIED: + MACHINE_ISSUE_SEVERITY_UNSPECIFIED severity is not specified + + ```proto + MACHINE_ISSUE_SEVERITY_UNSPECIFIED = 0 + ``` + MINOR: + MACHINE_ISSUE_SEVERITY_MINOR machine issues is of severity minor + + ```proto + MACHINE_ISSUE_SEVERITY_MINOR = 1 + ``` + MAJOR: + MACHINE_ISSUE_SEVERITY_MAJOR machine issues is of severity major + + ```proto + MACHINE_ISSUE_SEVERITY_MAJOR = 2 + ``` + CRITICAL: + MACHINE_ISSUE_SEVERITY_CRITICAL machine issues is of severity critical + + ```proto + MACHINE_ISSUE_SEVERITY_CRITICAL = 3 + ``` + """ + + UNSPECIFIED = 0 + MINOR = 1 + MAJOR = 2 + CRITICAL = 3 + + +_DESC = file_desc( + b'\n\x1fmetalstack/api/v2/machine.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a"metalstack/api/v2/filesystem.proto\x1a\x1dmetalstack/api/v2/image.proto\x1a\x1fmetalstack/api/v2/network.proto\x1a!metalstack/api/v2/partition.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1cmetalstack/api/v2/size.proto"\\\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"Q\n\x19MachineServiceGetResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"\xdb\x08\n\x1bMachineServiceCreateRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12!\n\x04uuid\x18\x02 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12\x1f\n\x04name\x18\x03 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12(\n\x08hostname\x18\x05 \x01(\tH\x02R\x08hostnameB\x07\xbaH\x04r\x02h\x01\x88\x01\x01\x12.\n\tpartition\x18\x06 \x01(\tH\x03R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04size\x18\x07 \x01(\tH\x04R\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12!\n\x05image\x18\x08 \x01(\tR\x05imageB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12=\n\x11filesystem_layout\x18\t \x01(\tH\x05R\x10filesystemLayoutB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12@\n\x0fssh_public_keys\x18\n \x03(\tR\rsshPublicKeysB\x18\xbaH\x15\x92\x01\x12\xd0\xa4\xb3\xb1\x02\x01\x102"\x08r\x06\x88\xb4\xae\xb1\x02\x01\x120\n\x08userdata\x18\x0b \x01(\tH\x06R\x08userdataB\x0f\xbaH\x0cr\n\xf0\xb3\xae\xb1\x02\x01\x18\x80\x80\x02\x88\x01\x01\x121\n\x06labels\x18\x0c \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labels\x12Q\n\x08networks\x18\r \x03(\x0b2+.metalstack.api.v2.MachineAllocationNetworkR\x08networksB\x08\xbaH\x05\x92\x01\x02\x08\x01\x12/\n\x0eplacement_tags\x18\x0e \x03(\tR\rplacementTagsB\x08\xbaH\x05\x92\x01\x02\x10@\x12G\n\x0bdns_servers\x18\x0f \x03(\x0b2\x1c.metalstack.api.v2.DNSServerR\ndnsServersB\x08\xbaH\x05\x92\x01\x02\x10\x03\x12G\n\x0bntp_servers\x18\x10 \x03(\x0b2\x1c.metalstack.api.v2.NTPServerR\nntpServersB\x08\xbaH\x05\x92\x01\x02\x10\n\x12[\n\x0fallocation_type\x18\x11 \x01(\x0e2(.metalstack.api.v2.MachineAllocationTypeR\x0eallocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12D\n\rfirewall_spec\x18\x12 \x01(\x0b2\x1f.metalstack.api.v2.FirewallSpecR\x0cfirewallSpecB\x07\n\x05_uuidB\x0e\n\x0c_descriptionB\x0b\n\t_hostnameB\x0c\n\n_partitionB\x07\n\x05_sizeB\x14\n\x12_filesystem_layoutB\x0b\n\t_userdata"W\n\x0cFirewallSpec\x12G\n\x0efirewall_rules\x18\x01 \x01(\x0b2 .metalstack.api.v2.FirewallRulesR\rfirewallRules"T\n\x1cMachineServiceCreateResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"\xf6\x02\n\x1bMachineServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12"\n\x07project\x18\x03 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x06labels\x18\x05 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x01R\x06labels\x88\x01\x01\x12@\n\x0fssh_public_keys\x18\x06 \x03(\tR\rsshPublicKeysB\x18\xbaH\x15\x92\x01\x12\xd0\xa4\xb3\xb1\x02\x01\x102"\x08r\x06\x88\xb4\xae\xb1\x02\x01B\x0e\n\x0c_descriptionB\t\n\x07_labels"T\n\x1cMachineServiceUpdateResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"v\n\x19MachineServiceListRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x125\n\x05query\x18\x02 \x01(\x0b2\x1f.metalstack.api.v2.MachineQueryR\x05query"T\n\x1aMachineServiceListResponse\x126\n\x08machines\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.MachineR\x08machines"_\n\x1bMachineServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"T\n\x1cMachineServiceDeleteResponse\x124\n\x07machine\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine"\xad\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12H\n\x07command\x18\x03 \x01(\x0e2$.metalstack.api.v2.MachineBMCCommandR\x07commandB\x08\xbaH\x05\x82\x01\x02\x10\x01""\n MachineServiceBMCCommandResponse"_\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x125\n\x03bmc\x18\x02 \x01(\x0b2#.metalstack.api.v2.MachineBMCReportR\x03bmc"\xab\x04\n\x07Machine\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12:\n\tpartition\x18\x03 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition\x12\x1c\n\x04rack\x18\x04 \x01(\tR\x04rackB\x08\xbaH\x05r\x03\x18\x80\x01\x12\x1c\n\x04room\x18\x05 \x01(\tR\x04roomB\x08\xbaH\x05r\x03\x18\x80\x01\x12+\n\x04size\x18\x06 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size\x12>\n\x08hardware\x18\x07 \x01(\x0b2".metalstack.api.v2.MachineHardwareR\x08hardware\x12D\n\nallocation\x18\x08 \x01(\x0b2$.metalstack.api.v2.MachineAllocationR\nallocation\x128\n\x06status\x18\t \x01(\x0b2 .metalstack.api.v2.MachineStatusR\x06status\x12p\n\x1arecent_provisioning_events\x18\n \x01(\x0b22.metalstack.api.v2.MachineRecentProvisioningEventsR\x18recentProvisioningEvents"\xa4\x02\n\rMachineStatus\x12A\n\tcondition\x18\x01 \x01(\x0b2#.metalstack.api.v2.MachineConditionR\tcondition\x12N\n\tled_state\x18\x02 \x01(\x0b21.metalstack.api.v2.MachineChassisIdentifyLEDStateR\x08ledState\x12N\n\nliveliness\x18\x03 \x01(\x0e2$.metalstack.api.v2.MachineLivelinessR\nlivelinessB\x08\xbaH\x05\x82\x01\x02\x10\x01\x120\n\x14metal_hammer_version\x18\x04 \x01(\tR\x12metalHammerVersion"\xa4\x01\n\x10MachineCondition\x12?\n\x05state\x18\x01 \x01(\x0e2\x1f.metalstack.api.v2.MachineStateR\x05stateB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12-\n\x0bdescription\x18\x02 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12 \n\x06issuer\x18\x03 \x01(\tR\x06issuerB\x08\xbaH\x05r\x03\x18\x80\x02"\xb9\x07\n\x11MachineAllocation\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x0bdescription\x18\x04 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\'\n\ncreated_by\x18\x05 \x01(\tR\tcreatedByB\x08\xbaH\x05r\x03\x18\x80\x01\x12"\n\x07project\x18\x06 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12.\n\x05image\x18\x07 \x01(\x0b2\x18.metalstack.api.v2.ImageR\x05image\x12P\n\x11filesystem_layout\x18\x08 \x01(\x0b2#.metalstack.api.v2.FilesystemLayoutR\x10filesystemLayout\x12=\n\x08networks\x18\t \x03(\x0b2!.metalstack.api.v2.MachineNetworkR\x08networks\x12#\n\x08hostname\x18\n \x01(\tR\x08hostnameB\x07\xbaH\x04r\x02h\x01\x12@\n\x0fssh_public_keys\x18\x0b \x03(\tR\rsshPublicKeysB\x18\xbaH\x15\x92\x01\x12\xd0\xa4\xb3\xb1\x02\x01\x102"\x08r\x06\x88\xb4\xae\xb1\x02\x01\x12+\n\x08userdata\x18\x0c \x01(\tR\x08userdataB\x0f\xbaH\x0cr\n\xf0\xb3\xae\xb1\x02\x01\x18\x80\x80\x02\x12[\n\x0fallocation_type\x18\r \x01(\x0e2(.metalstack.api.v2.MachineAllocationTypeR\x0eallocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12G\n\x0efirewall_rules\x18\x0e \x01(\x0b2 .metalstack.api.v2.FirewallRulesR\rfirewallRules\x12G\n\x0bdns_servers\x18\x0f \x03(\x0b2\x1c.metalstack.api.v2.DNSServerR\ndnsServersB\x08\xbaH\x05\x92\x01\x02\x10\x03\x12G\n\x0bntp_servers\x18\x10 \x03(\x0b2\x1c.metalstack.api.v2.NTPServerR\nntpServersB\x08\xbaH\x05\x92\x01\x02\x10\n\x12/\n\x03vpn\x18\x11 \x01(\x0b2\x1d.metalstack.api.v2.MachineVPNR\x03vpn"a\n\x18MachineAllocationNetwork\x12%\n\x07network\x18\x01 \x01(\tR\x07networkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1e\n\x03ips\x18\x02 \x03(\tR\x03ipsB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01"\x90\x01\n\rFirewallRules\x12=\n\x06egress\x18\x01 \x03(\x0b2%.metalstack.api.v2.FirewallEgressRuleR\x06egress\x12@\n\x07ingress\x18\x02 \x03(\x0b2&.metalstack.api.v2.FirewallIngressRuleR\x07ingress"\xd0\x01\n\x12FirewallEgressRule\x12C\n\x08protocol\x18\x01 \x01(\x0e2\x1d.metalstack.api.v2.IPProtocolR\x08protocolB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12$\n\x05ports\x18\x02 \x03(\rR\x05portsB\x0e\xbaH\x0b\x92\x01\x08"\x06*\x04\x18\xfc\xff\x03\x12\x1c\n\x02to\x18\x03 \x03(\tR\x02toB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x121\n\x07comment\x18\x04 \x01(\tR\x07commentB\x17\xbaH\x14\xd8\x01\x01r\x0f\x18d2\x0b^[a-z_ -]*$"\xf3\x01\n\x13FirewallIngressRule\x12C\n\x08protocol\x18\x01 \x01(\x0e2\x1d.metalstack.api.v2.IPProtocolR\x08protocolB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12$\n\x05ports\x18\x02 \x03(\rR\x05portsB\x0e\xbaH\x0b\x92\x01\x08"\x06*\x04\x18\xfc\xff\x03\x12\x1c\n\x02to\x18\x03 \x03(\tR\x02toB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12 \n\x04from\x18\x04 \x03(\tR\x04fromB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x121\n\x07comment\x18\x05 \x01(\tR\x07commentB\x17\xbaH\x14\xd8\x01\x01r\x0f\x18d2\x0b^[a-z_ -]*$"\x9c\x03\n\x0eMachineNetwork\x12\x18\n\x07network\x18\x01 \x01(\tR\x07network\x12(\n\x08prefixes\x18\x02 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\x03 \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12\x1e\n\x03ips\x18\x04 \x03(\tR\x03ipsB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01\x12K\n\x0cnetwork_type\x18\x05 \x01(\x0e2\x1e.metalstack.api.v2.NetworkTypeR\x0bnetworkTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12?\n\x08nat_type\x18\x06 \x01(\x0e2\x1a.metalstack.api.v2.NATTypeR\x07natTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x10\n\x03vrf\x18\x07 \x01(\x04R\x03vrf\x12\x10\n\x03asn\x18\x08 \x01(\rR\x03asn\x12\'\n\x07project\x18\t \x01(\tH\x00R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\n\n\x08_project"\xfb\x01\n\x0fMachineHardware\x12\x16\n\x06memory\x18\x01 \x01(\x04R\x06memory\x12;\n\x05disks\x18\x02 \x03(\x0b2%.metalstack.api.v2.MachineBlockDeviceR\x05disks\x12/\n\x04cpus\x18\x03 \x03(\x0b2\x1b.metalstack.api.v2.MetalCPUR\x04cpus\x12/\n\x04gpus\x18\x04 \x03(\x0b2\x1b.metalstack.api.v2.MetalGPUR\x04gpus\x121\n\x04nics\x18\x05 \x03(\x0b2\x1d.metalstack.api.v2.MachineNicR\x04nics"|\n\x08MetalCPU\x12 \n\x06vendor\x18\x01 \x01(\tR\x06vendorB\x08\xbaH\x05r\x03\x18\x80\x02\x12\x1e\n\x05model\x18\x02 \x01(\tR\x05modelB\x08\xbaH\x05r\x03\x18\x80\x02\x12\x14\n\x05cores\x18\x03 \x01(\rR\x05cores\x12\x18\n\x07threads\x18\x04 \x01(\rR\x07threads"L\n\x08MetalGPU\x12 \n\x06vendor\x18\x01 \x01(\tR\x06vendorB\x08\xbaH\x05r\x03\x18\x80\x02\x12\x1e\n\x05model\x18\x02 \x01(\tR\x05modelB\x08\xbaH\x05r\x03\x18\x80\x02"\xa7\x02\n\nMachineNic\x12\x1d\n\x03mac\x18\x01 \x01(\tR\x03macB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x12\x1f\n\x04name\x18\x02 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12(\n\nidentifier\x18\x03 \x01(\tR\nidentifierB\x08\xbaH\x05r\x03\x18\x80\x01\x12 \n\x06vendor\x18\x04 \x01(\tR\x06vendorB\x08\xbaH\x05r\x03\x18\x80\x01\x12\x1e\n\x05model\x18\x05 \x01(\tR\x05modelB\x08\xbaH\x05r\x03\x18\x80\x01\x12\x14\n\x05speed\x18\x06 \x01(\x04R\x05speed\x12;\n\tneighbors\x18\x07 \x03(\x0b2\x1d.metalstack.api.v2.MachineNicR\tneighbors\x12\x1a\n\x08hostname\x18\x08 \x01(\tR\x08hostname"I\n\x12MachineBlockDevice\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x12\n\x04size\x18\x02 \x01(\x04R\x04size"o\n\x1eMachineChassisIdentifyLEDState\x12\x1e\n\x05value\x18\x01 \x01(\tR\x05valueB\x08\xbaH\x05r\x03\x18\x80\x01\x12-\n\x0bdescription\x18\x02 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"\xcb\x03\n\x10MachineBMCReport\x12/\n\x03bmc\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.MachineBMCR\x03bmc\x122\n\x04bios\x18\x02 \x01(\x0b2\x1e.metalstack.api.v2.MachineBiosR\x04bios\x12/\n\x03fru\x18\x03 \x01(\x0b2\x1d.metalstack.api.v2.MachineFRUR\x03fru\x12H\n\x0cpower_metric\x18\x04 \x01(\x0b2%.metalstack.api.v2.MachinePowerMetricR\x0bpowerMetric\x12L\n\x0epower_supplies\x18\x05 \x03(\x0b2%.metalstack.api.v2.MachinePowerSupplyR\rpowerSupplies\x12N\n\tled_state\x18\x06 \x01(\x0b21.metalstack.api.v2.MachineChassisIdentifyLEDStateR\x08ledState\x129\n\nupdated_at\x18\x07 \x01(\x0b2\x1a.google.protobuf.TimestampR\tupdatedAt"z\n\x0bMachineBios\x12%\n\x07version\x18\x01 \x01(\tR\x07versionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12#\n\x06vendor\x18\x02 \x01(\tR\x06vendorB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\x1f\n\x04date\x18\x03 \x01(\tR\x04dateB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"\x99\x02\n\nMachineBMC\x12"\n\x07address\x18\x01 \x01(\tR\x07addressB\x08\xbaH\x05r\x03\x80\x02\x01\x12\x1d\n\x03mac\x18\x02 \x01(\tR\x03macB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x12\x1f\n\x04user\x18\x03 \x01(\tR\x04userB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\'\n\x08password\x18\x04 \x01(\tR\x08passwordB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12)\n\tinterface\x18\x05 \x01(\tR\tinterfaceB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12%\n\x07version\x18\x06 \x01(\tR\x07versionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12,\n\x0bpower_state\x18\x07 \x01(\tR\npowerStateB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"\xa6\x05\n\nMachineFRU\x12@\n\x13chassis_part_number\x18\x01 \x01(\tH\x00R\x11chassisPartNumberB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12@\n\x13chassis_part_serial\x18\x02 \x01(\tH\x01R\x11chassisPartSerialB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12-\n\tboard_mfg\x18\x03 \x01(\tH\x02R\x08boardMfgB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12:\n\x10board_mfg_serial\x18\x04 \x01(\tH\x03R\x0eboardMfgSerialB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x11board_part_number\x18\x05 \x01(\tH\x04R\x0fboardPartNumberB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12C\n\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturerB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12@\n\x13product_part_number\x18\x07 \x01(\tH\x06R\x11productPartNumberB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x127\n\x0eproduct_serial\x18\x08 \x01(\tH\x07R\rproductSerialB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x13\n\x11_board_mfg_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial"\xce\x01\n\x12MachinePowerMetric\x124\n\x16average_consumed_watts\x18\x01 \x01(\x02R\x14averageConsumedWatts\x12&\n\x0finterval_in_min\x18\x02 \x01(\x02R\rintervalInMin\x12,\n\x12max_consumed_watts\x18\x03 \x01(\x02R\x10maxConsumedWatts\x12,\n\x12min_consumed_watts\x18\x04 \x01(\x02R\x10minConsumedWatts"B\n\x12MachinePowerSupply\x12\x16\n\x06health\x18\x01 \x01(\tR\x06health\x12\x14\n\x05state\x18\x02 \x01(\tR\x05state"\xd3\x02\n\x1fMachineRecentProvisioningEvents\x12C\n\x06events\x18\x01 \x03(\x0b2+.metalstack.api.v2.MachineProvisioningEventR\x06events\x12B\n\x0flast_event_time\x18\x02 \x01(\x0b2\x1a.google.protobuf.TimestampR\rlastEventTime\x12U\n\x10last_error_event\x18\x03 \x01(\x0b2+.metalstack.api.v2.MachineProvisioningEventR\x0elastErrorEvent\x12P\n\x05state\x18\x04 \x01(\x0e20.metalstack.api.v2.MachineProvisioningEventStateR\x05stateB\x08\xbaH\x05\x82\x01\x02\x10\x01"\xb5\x01\n\x18MachineProvisioningEvent\x12.\n\x04time\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampR\x04time\x12O\n\x05event\x18\x02 \x01(\x0e2/.metalstack.api.v2.MachineProvisioningEventTypeR\x05eventB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message"\x99\x01\n\nMachineVPN\x122\n\x15control_plane_address\x18\x01 \x01(\tR\x13controlPlaneAddress\x12\x19\n\x08auth_key\x18\x02 \x01(\tR\x07authKey\x12\x1c\n\tconnected\x18\x03 \x01(\x08R\tconnected\x12\x1e\n\x03ips\x18\x04 \x03(\tR\x03ipsB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01"\xf7\x08\n\x0cMachineQuery\x12!\n\x04uuid\x18\x01 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12.\n\tpartition\x18\x03 \x01(\tH\x02R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04size\x18\x04 \x01(\tH\x03R\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04rack\x18\x05 \x01(\tH\x04R\x04rackB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04room\x18\x06 \x01(\tH\x05R\x04roomB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x07 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x06R\x06labels\x88\x01\x01\x12N\n\nallocation\x18\x08 \x01(\x0b2).metalstack.api.v2.MachineAllocationQueryH\x07R\nallocation\x88\x01\x01\x12E\n\x07network\x18\t \x01(\x0b2&.metalstack.api.v2.MachineNetworkQueryH\x08R\x07network\x88\x01\x01\x129\n\x03nic\x18\n \x01(\x0b2".metalstack.api.v2.MachineNicQueryH\tR\x03nic\x88\x01\x01\x12<\n\x04disk\x18\x0b \x01(\x0b2#.metalstack.api.v2.MachineDiskQueryH\nR\x04disk\x88\x01\x01\x129\n\x03bmc\x18\x0c \x01(\x0b2".metalstack.api.v2.MachineBMCQueryH\x0bR\x03bmc\x88\x01\x01\x129\n\x03fru\x18\r \x01(\x0b2".metalstack.api.v2.MachineFRUQueryH\x0cR\x03fru\x88\x01\x01\x12H\n\x08hardware\x18\x0e \x01(\x0b2\'.metalstack.api.v2.MachineHardwareQueryH\rR\x08hardware\x88\x01\x01\x12:\n\x05state\x18\x0f \x01(\x0e2\x1f.metalstack.api.v2.MachineStateH\x0eR\x05state\x88\x01\x01\x12\x1d\n\x07waiting\x18\x10 \x01(\x08H\x0fR\x07waiting\x88\x01\x01\x12\'\n\x0cpreallocated\x18\x11 \x01(\x08H\x10R\x0cpreallocated\x88\x01\x01\x12(\n\rnot_allocated\x18\x12 \x01(\x08H\x11R\x0cnotAllocated\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_nameB\x0c\n\n_partitionB\x07\n\x05_sizeB\x07\n\x05_rackB\x07\n\x05_roomB\t\n\x07_labelsB\r\n\x0b_allocationB\n\n\x08_networkB\x06\n\x04_nicB\x07\n\x05_diskB\x06\n\x04_bmcB\x06\n\x04_fruB\x0b\n\t_hardwareB\x08\n\x06_stateB\n\n\x08_waitingB\x0f\n\r_preallocatedB\x10\n\x0e_not_allocated"\xdd\x04\n\x16MachineAllocationQuery\x12!\n\x04uuid\x18\x01 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tH\x02R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12&\n\x05image\x18\x04 \x01(\tH\x03R\x05imageB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12=\n\x11filesystem_layout\x18\x05 \x01(\tH\x04R\x10filesystemLayoutB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12(\n\x08hostname\x18\x06 \x01(\tH\x05R\x08hostnameB\x07\xbaH\x04r\x02h\x01\x88\x01\x01\x12`\n\x0fallocation_type\x18\x07 \x01(\x0e2(.metalstack.api.v2.MachineAllocationTypeH\x06R\x0eallocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x126\n\x06labels\x18\x08 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x07R\x06labels\x88\x01\x01\x124\n\x03vpn\x18\t \x01(\x0b2\x1d.metalstack.api.v2.MachineVPNH\x08R\x03vpn\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_nameB\n\n\x08_projectB\x08\n\x06_imageB\x14\n\x12_filesystem_layoutB\x0b\n\t_hostnameB\x12\n\x10_allocation_typeB\t\n\x07_labelsB\x06\n\x04_vpn"\xe4\x01\n\x13MachineNetworkQuery\x12\x1a\n\x08networks\x18\x01 \x03(\tR\x08networks\x12(\n\x08prefixes\x18\x02 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\x03 \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12\x1e\n\x03ips\x18\x04 \x03(\tR\x03ipsB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01\x12\x12\n\x04vrfs\x18\x05 \x03(\x04R\x04vrfs\x12\x12\n\x04asns\x18\x06 \x03(\rR\x04asns"\xd9\x01\n\x0fMachineNicQuery\x12(\n\x04macs\x18\x01 \x03(\tR\x04macsB\x14\xbaH\x11\x92\x01\x0e\x10d\x18\x01"\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x12\'\n\x05names\x18\x02 \x03(\tR\x05namesB\x11\xbaH\x0e\x92\x01\x0b\x10d\x18\x01"\x05r\x03\x18\x80\x01\x129\n\rneighbor_macs\x18\x03 \x03(\tR\x0cneighborMacsB\x14\xbaH\x11\x92\x01\x0e\x10d\x18\x01"\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x128\n\x0eneighbor_names\x18\x04 \x03(\tR\rneighborNamesB\x11\xbaH\x0e\x92\x01\x0b\x10d\x18\x01"\x05r\x03\x18\x80\x01"Y\n\x10MachineDiskQuery\x12%\n\x05names\x18\x01 \x03(\tR\x05namesB\x0f\xbaH\x0c\x92\x01\t\x10d"\x05r\x03\x18\x80\x01\x12\x1e\n\x05sizes\x18\x02 \x03(\x04R\x05sizesB\x08\xbaH\x05\x92\x01\x02\x10d"\xd8\x01\n\x0fMachineBMCQuery\x12&\n\x07address\x18\x01 \x01(\tH\x00R\x07addressB\x07\xbaH\x04r\x02p\x01\x88\x01\x01\x12"\n\x03mac\x18\x02 \x01(\tH\x01R\x03macB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12!\n\x04user\x18\x03 \x01(\tH\x02R\x04userB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x12+\n\tinterface\x18\x04 \x01(\tH\x03R\tinterfaceB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01B\n\n\x08_addressB\x06\n\x04_macB\x07\n\x05_userB\x0c\n\n_interface"\x88\x05\n\x0fMachineFRUQuery\x12=\n\x13chassis_part_number\x18\x01 \x01(\tH\x00R\x11chassisPartNumberB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x12=\n\x13chassis_part_serial\x18\x02 \x01(\tH\x01R\x11chassisPartSerialB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x12*\n\tboard_mfg\x18\x03 \x01(\tH\x02R\x08boardMfgB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x120\n\x0cboard_serial\x18\x04 \x01(\tH\x03R\x0bboardSerialB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x129\n\x11board_part_number\x18\x05 \x01(\tH\x04R\x0fboardPartNumberB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x12@\n\x14product_manufacturer\x18\x06 \x01(\tH\x05R\x13productManufacturerB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x12=\n\x13product_part_number\x18\x07 \x01(\tH\x06R\x11productPartNumberB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01\x124\n\x0eproduct_serial\x18\x08 \x01(\tH\x07R\rproductSerialB\x08\xbaH\x05r\x03\x18\x80\x01\x88\x01\x01B\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x0f\n\r_board_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial"n\n\x14MachineHardwareQuery\x12\x1b\n\x06memory\x18\x01 \x01(\x04H\x00R\x06memory\x88\x01\x01\x12 \n\tcpu_cores\x18\x02 \x01(\rH\x01R\x08cpuCores\x88\x01\x01B\t\n\x07_memoryB\x0c\n\n_cpu_cores"\x98\x03\n\x12MachineIssuesQuery\x12D\n\rmachine_query\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.MachineQueryR\x0cmachineQuery\x12F\n\x04only\x18\x02 \x03(\x0e2#.metalstack.api.v2.MachineIssueTypeR\x04onlyB\r\xbaH\n\x92\x01\x07"\x05\x82\x01\x02\x10\x01\x12F\n\x04omit\x18\x03 \x03(\x0e2#.metalstack.api.v2.MachineIssueTypeR\x04omitB\r\xbaH\n\x92\x01\x07"\x05\x82\x01\x02\x10\x01\x12R\n\x08severity\x18\x04 \x01(\x0e2\'.metalstack.api.v2.MachineIssueSeverityH\x00R\x08severityB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12K\n\x14last_error_threshold\x18\x05 \x01(\x0b2\x19.google.protobuf.DurationR\x12lastErrorThresholdB\x0b\n\t_severity"f\n\rMachineIssues\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x127\n\x06issues\x18\x02 \x03(\x0b2\x1f.metalstack.api.v2.MachineIssueR\x06issues"\x9b\x02\n\x0cMachineIssue\x12A\n\x04type\x18\x01 \x01(\x0e2#.metalstack.api.v2.MachineIssueTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12M\n\x08severity\x18\x02 \x01(\x0e2\'.metalstack.api.v2.MachineIssueSeverityR\x08severityB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12-\n\x0bdescription\x18\x03 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x120\n\rreference_url\x18\x04 \x01(\tR\x0creferenceUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12\x18\n\x07details\x18\x05 \x01(\tR\x07details*e\n\nIPProtocol\x12\x1b\n\x17IP_PROTOCOL_UNSPECIFIED\x10\x00\x12\x1c\n\x0fIP_PROTOCOL_TCP\x10\x01\x1a\x07\x82\xb2\x19\x03tcp\x12\x1c\n\x0fIP_PROTOCOL_UDP\x10\x02\x1a\x07\x82\xb2\x19\x03udp*\xad\x01\n\x0cMachineState\x12#\n\x19MACHINE_STATE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12&\n\x15MACHINE_STATE_TAINTED\x10\x01\x1a\x0b\x82\xb2\x19\x07tainted\x12$\n\x14MACHINE_STATE_LOCKED\x10\x02\x1a\n\x82\xb2\x19\x06locked\x12*\n\x17MACHINE_STATE_AVAILABLE\x10\x03\x1a\r\x82\xb2\x19\tavailable*\xdf\x01\n\x1dMachineProvisioningEventState\x126\n,MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12=\n*MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP\x10\x01\x1a\r\x82\xb2\x19\tcrashloop\x12G\n/MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM\x10\x02\x1a\x12\x82\xb2\x19\x0efailed-reclaim*\x9f\x06\n\x1cMachineProvisioningEventType\x12/\n+MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED\x10\x00\x124\n%MACHINE_PROVISIONING_EVENT_TYPE_ALIVE\x10\x01\x1a\t\x82\xb2\x19\x05Alive\x128\n\'MACHINE_PROVISIONING_EVENT_TYPE_CRASHED\x10\x02\x1a\x0b\x82\xb2\x19\x07Crashed\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING\x10\x03\x1a\x0f\x82\xb2\x19\x0bPXE Booting\x12F\n.MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT\x10\x04\x1a\x12\x82\xb2\x19\x0ePlanned Reboot\x12<\n)MACHINE_PROVISIONING_EVENT_TYPE_PREPARING\x10\x05\x1a\r\x82\xb2\x19\tPreparing\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING\x10\x06\x1a\x0f\x82\xb2\x19\x0bRegistering\x128\n\'MACHINE_PROVISIONING_EVENT_TYPE_WAITING\x10\x07\x1a\x0b\x82\xb2\x19\x07Waiting\x12>\n*MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING\x10\x08\x1a\x0e\x82\xb2\x19\nInstalling\x12N\n2MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL\x10\t\x1a\x16\x82\xb2\x19\x12Booting New Kernel\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME\x10\n\x1a\x0f\x82\xb2\x19\x0bPhoned Home\x12H\n/MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM\x10\x0b\x1a\x13\x82\xb2\x19\x0fMachine Reclaim*\xba\x01\n\x11MachineLiveliness\x12(\n\x1eMACHINE_LIVELINESS_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12\'\n\x18MACHINE_LIVELINESS_ALIVE\x10\x01\x1a\t\x82\xb2\x19\x05alive\x12%\n\x17MACHINE_LIVELINESS_DEAD\x10\x02\x1a\x08\x82\xb2\x19\x04dead\x12+\n\x1aMACHINE_LIVELINESS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknown*\xac\x01\n\x15MachineAllocationType\x12-\n#MACHINE_ALLOCATION_TYPE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x120\n\x1fMACHINE_ALLOCATION_TYPE_MACHINE\x10\x01\x1a\x0b\x82\xb2\x19\x07machine\x122\n MACHINE_ALLOCATION_TYPE_FIREWALL\x10\x02\x1a\x0c\x82\xb2\x19\x08firewall*\xfe\x04\n\x11MachineBMCCommand\x12#\n\x1fMACHINE_BMC_COMMAND_UNSPECIFIED\x10\x00\x12"\n\x16MACHINE_BMC_COMMAND_ON\x10\x01\x1a\x06\x82\xb2\x19\x02on\x12$\n\x17MACHINE_BMC_COMMAND_OFF\x10\x02\x1a\x07\x82\xb2\x19\x03off\x12(\n\x19MACHINE_BMC_COMMAND_RESET\x10\x03\x1a\t\x82\xb2\x19\x05reset\x12(\n\x19MACHINE_BMC_COMMAND_CYCLE\x10\x04\x1a\t\x82\xb2\x19\x05cycle\x126\n MACHINE_BMC_COMMAND_BOOT_TO_BIOS\x10\x05\x1a\x10\x82\xb2\x19\x0cboot-to-bios\x12:\n"MACHINE_BMC_COMMAND_BOOT_FROM_DISK\x10\x06\x1a\x12\x82\xb2\x19\x0eboot-from-disk\x128\n!MACHINE_BMC_COMMAND_BOOT_FROM_PXE\x10\x07\x1a\x11\x82\xb2\x19\rboot-from-pxe\x12<\n#MACHINE_BMC_COMMAND_IDENTIFY_LED_ON\x10\x08\x1a\x13\x82\xb2\x19\x0fidentify-led-on\x12>\n$MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF\x10\t\x1a\x14\x82\xb2\x19\x10identify-led-off\x12<\n#MACHINE_BMC_COMMAND_MACHINE_DELETED\x10\n\x1a\x13\x82\xb2\x19\x0fmachine-deleted\x12<\n#MACHINE_BMC_COMMAND_MACHINE_CREATED\x10\x0b\x1a\x13\x82\xb2\x19\x0fmachine-created*\xf3\x06\n\x10MachineIssueType\x12"\n\x1eMACHINE_ISSUE_TYPE_UNSPECIFIED\x10\x00\x129\n!MACHINE_ISSUE_TYPE_ASN_UNIQUENESS\x10\x01\x1a\x12\x82\xb2\x19\x0easn-not-unique\x12?\n$MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED\x10\x02\x1a\x15\x82\xb2\x19\x11bmc-info-outdated\x12B\n&MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP\x10\x03\x1a\x16\x82\xb2\x19\x12bmc-no-distinct-ip\x129\n!MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP\x10\x04\x1a\x12\x82\xb2\x19\x0ebmc-without-ip\x12;\n"MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC\x10\x05\x1a\x13\x82\xb2\x19\x0fbmc-without-mac\x120\n\x1dMACHINE_ISSUE_TYPE_CRASH_LOOP\x10\x06\x1a\r\x82\xb2\x19\tcrashloop\x12I\n)MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM\x10\x07\x1a\x1a\x82\xb2\x19\x16failed-machine-reclaim\x12=\n#MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR\x10\x08\x1a\x14\x82\xb2\x19\x10last-event-error\x12;\n"MACHINE_ISSUE_TYPE_LIVELINESS_DEAD\x10\t\x1a\x13\x82\xb2\x19\x0fliveliness-dead\x12M\n+MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE\x10\n\x1a\x1c\x82\xb2\x19\x18liveliness-not-available\x12A\n%MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN\x10\x0b\x1a\x16\x82\xb2\x19\x12liveliness-unknown\x12A\n%MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER\x10\x0c\x1a\x16\x82\xb2\x19\x12no-event-container\x125\n\x1fMACHINE_ISSUE_TYPE_NO_PARTITION\x10\r\x1a\x10\x82\xb2\x19\x0cno-partition*\xcb\x01\n\x14MachineIssueSeverity\x12&\n"MACHINE_ISSUE_SEVERITY_UNSPECIFIED\x10\x00\x12+\n\x1cMACHINE_ISSUE_SEVERITY_MINOR\x10\x01\x1a\t\x82\xb2\x19\x05minor\x12+\n\x1cMACHINE_ISSUE_SEVERITY_MAJOR\x10\x02\x1a\t\x82\xb2\x19\x05major\x121\n\x1fMACHINE_ISSUE_SEVERITY_CRITICAL\x10\x03\x1a\x0c\x82\xb2\x19\x08critical2\xd1\x06\n\x0eMachineService\x12m\n\x03Get\x12+.metalstack.api.v2.MachineServiceGetRequest\x1a,.metalstack.api.v2.MachineServiceGetResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06Create\x12..metalstack.api.v2.MachineServiceCreateRequest\x1a/.metalstack.api.v2.MachineServiceCreateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.MachineServiceUpdateRequest\x1a/.metalstack.api.v2.MachineServiceUpdateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12p\n\x04List\x12,.metalstack.api.v2.MachineServiceListRequest\x1a-.metalstack.api.v2.MachineServiceListResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06Delete\x12..metalstack.api.v2.MachineServiceDeleteRequest\x1a/.metalstack.api.v2.MachineServiceDeleteResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x81\x01\n\nBMCCommand\x122.metalstack.api.v2.MachineServiceBMCCommandRequest\x1a3.metalstack.api.v2.MachineServiceBMCCommandResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06GetBMC\x12..metalstack.api.v2.MachineServiceGetBMCRequest\x1a/.metalstack.api.v2.MachineServiceGetBMCResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xc2\x01\n\x15com.metalstack.api.v2B\x0cMachineProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + filesystem_pb.desc(), + image_pb.desc(), + network_pb.desc(), + partition_pb.desc(), + predefined_rules_pb.desc(), + size_pb.desc(), + ], + { + "MachineServiceGetRequest": MachineServiceGetRequest, + "MachineServiceGetResponse": MachineServiceGetResponse, + "MachineServiceCreateRequest": MachineServiceCreateRequest, + "FirewallSpec": FirewallSpec, + "MachineServiceCreateResponse": MachineServiceCreateResponse, + "MachineServiceUpdateRequest": MachineServiceUpdateRequest, + "MachineServiceUpdateResponse": MachineServiceUpdateResponse, + "MachineServiceListRequest": MachineServiceListRequest, + "MachineServiceListResponse": MachineServiceListResponse, + "MachineServiceDeleteRequest": MachineServiceDeleteRequest, + "MachineServiceDeleteResponse": MachineServiceDeleteResponse, + "MachineServiceBMCCommandRequest": MachineServiceBMCCommandRequest, + "MachineServiceBMCCommandResponse": MachineServiceBMCCommandResponse, + "MachineServiceGetBMCRequest": MachineServiceGetBMCRequest, + "MachineServiceGetBMCResponse": MachineServiceGetBMCResponse, + "Machine": Machine, + "MachineStatus": MachineStatus, + "MachineCondition": MachineCondition, + "MachineAllocation": MachineAllocation, + "MachineAllocationNetwork": MachineAllocationNetwork, + "FirewallRules": FirewallRules, + "FirewallEgressRule": FirewallEgressRule, + "FirewallIngressRule": FirewallIngressRule, + "MachineNetwork": MachineNetwork, + "MachineHardware": MachineHardware, + "MetalCPU": MetalCPU, + "MetalGPU": MetalGPU, + "MachineNic": MachineNic, + "MachineBlockDevice": MachineBlockDevice, + "MachineChassisIdentifyLEDState": MachineChassisIdentifyLEDState, + "MachineBMCReport": MachineBMCReport, + "MachineBios": MachineBios, + "MachineBMC": MachineBMC, + "MachineFRU": MachineFRU, + "MachinePowerMetric": MachinePowerMetric, + "MachinePowerSupply": MachinePowerSupply, + "MachineRecentProvisioningEvents": MachineRecentProvisioningEvents, + "MachineProvisioningEvent": MachineProvisioningEvent, + "MachineVPN": MachineVPN, + "MachineQuery": MachineQuery, + "MachineAllocationQuery": MachineAllocationQuery, + "MachineNetworkQuery": MachineNetworkQuery, + "MachineNicQuery": MachineNicQuery, + "MachineDiskQuery": MachineDiskQuery, + "MachineBMCQuery": MachineBMCQuery, + "MachineFRUQuery": MachineFRUQuery, + "MachineHardwareQuery": MachineHardwareQuery, + "MachineIssuesQuery": MachineIssuesQuery, + "MachineIssues": MachineIssues, + "MachineIssue": MachineIssue, + "IPProtocol": IPProtocol, + "MachineState": MachineState, + "MachineProvisioningEventState": MachineProvisioningEventState, + "MachineProvisioningEventType": MachineProvisioningEventType, + "MachineLiveliness": MachineLiveliness, + "MachineAllocationType": MachineAllocationType, + "MachineBMCCommand": MachineBMCCommand, + "MachineIssueType": MachineIssueType, + "MachineIssueSeverity": MachineIssueSeverity, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/machine.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/machine_pb2.py b/python/metalstack/api/v2/machine_pb2.py deleted file mode 100644 index f3efadb9..00000000 --- a/python/metalstack/api/v2/machine_pb2.py +++ /dev/null @@ -1,571 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/machine.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/machine.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import filesystem_pb2 as metalstack_dot_api_dot_v2_dot_filesystem__pb2 -from metalstack.api.v2 import image_pb2 as metalstack_dot_api_dot_v2_dot_image__pb2 -from metalstack.api.v2 import network_pb2 as metalstack_dot_api_dot_v2_dot_network__pb2 -from metalstack.api.v2 import partition_pb2 as metalstack_dot_api_dot_v2_dot_partition__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import size_pb2 as metalstack_dot_api_dot_v2_dot_size__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/api/v2/machine.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\"metalstack/api/v2/filesystem.proto\x1a\x1dmetalstack/api/v2/image.proto\x1a\x1fmetalstack/api/v2/network.proto\x1a!metalstack/api/v2/partition.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1cmetalstack/api/v2/size.proto\"\\\n\x18MachineServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"Q\n\x19MachineServiceGetResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\xdb\x08\n\x1bMachineServiceCreateRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12!\n\x04uuid\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12\x1f\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12(\n\x08hostname\x18\x05 \x01(\tB\x07\xbaH\x04r\x02h\x01H\x02R\x08hostname\x88\x01\x01\x12.\n\tpartition\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x03R\tpartition\x88\x01\x01\x12$\n\x04size\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x04R\x04size\x88\x01\x01\x12!\n\x05image\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05image\x12=\n\x11\x66ilesystem_layout\x18\t \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x05R\x10\x66ilesystemLayout\x88\x01\x01\x12@\n\x0fssh_public_keys\x18\n \x03(\tB\x18\xbaH\x15\x92\x01\x12\x10\x32\"\x08r\x06\x88\xb4\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\rsshPublicKeys\x12\x30\n\x08userdata\x18\x0b \x01(\tB\x0f\xbaH\x0cr\n\x18\x80\x80\x02\xf0\xb3\xae\xb1\x02\x01H\x06R\x08userdata\x88\x01\x01\x12\x31\n\x06labels\x18\x0c \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labels\x12Q\n\x08networks\x18\r \x03(\x0b\x32+.metalstack.api.v2.MachineAllocationNetworkB\x08\xbaH\x05\x92\x01\x02\x08\x01R\x08networks\x12/\n\x0eplacement_tags\x18\x0e \x03(\tB\x08\xbaH\x05\x92\x01\x02\x10@R\rplacementTags\x12G\n\x0b\x64ns_servers\x18\x0f \x03(\x0b\x32\x1c.metalstack.api.v2.DNSServerB\x08\xbaH\x05\x92\x01\x02\x10\x03R\ndnsServers\x12G\n\x0bntp_servers\x18\x10 \x03(\x0b\x32\x1c.metalstack.api.v2.NTPServerB\x08\xbaH\x05\x92\x01\x02\x10\nR\nntpServers\x12[\n\x0f\x61llocation_type\x18\x11 \x01(\x0e\x32(.metalstack.api.v2.MachineAllocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0e\x61llocationType\x12\x44\n\rfirewall_spec\x18\x12 \x01(\x0b\x32\x1f.metalstack.api.v2.FirewallSpecR\x0c\x66irewallSpecB\x07\n\x05_uuidB\x0e\n\x0c_descriptionB\x0b\n\t_hostnameB\x0c\n\n_partitionB\x07\n\x05_sizeB\x14\n\x12_filesystem_layoutB\x0b\n\t_userdata\"W\n\x0c\x46irewallSpec\x12G\n\x0e\x66irewall_rules\x18\x01 \x01(\x0b\x32 .metalstack.api.v2.FirewallRulesR\rfirewallRules\"T\n\x1cMachineServiceCreateResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\xf6\x02\n\x1bMachineServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\"\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12<\n\x06labels\x18\x05 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x01R\x06labels\x88\x01\x01\x12@\n\x0fssh_public_keys\x18\x06 \x03(\tB\x18\xbaH\x15\x92\x01\x12\x10\x32\"\x08r\x06\x88\xb4\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\rsshPublicKeysB\x0e\n\x0c_descriptionB\t\n\x07_labels\"T\n\x1cMachineServiceUpdateResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"v\n\x19MachineServiceListRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x35\n\x05query\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x05query\"T\n\x1aMachineServiceListResponse\x12\x36\n\x08machines\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.MachineR\x08machines\"_\n\x1bMachineServiceDeleteRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"T\n\x1cMachineServiceDeleteResponse\x12\x34\n\x07machine\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\"\xad\x01\n\x1fMachineServiceBMCCommandRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12H\n\x07\x63ommand\x18\x03 \x01(\x0e\x32$.metalstack.api.v2.MachineBMCCommandB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07\x63ommand\"\"\n MachineServiceBMCCommandResponse\"_\n\x1bMachineServiceGetBMCRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"s\n\x1cMachineServiceGetBMCResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x03\x62mc\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x03\x62mc\"\xab\x04\n\x07Machine\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12:\n\tpartition\x18\x03 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\x12\x1c\n\x04rack\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\x04rack\x12\x1c\n\x04room\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\x04room\x12+\n\x04size\x18\x06 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size\x12>\n\x08hardware\x18\x07 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x44\n\nallocation\x18\x08 \x01(\x0b\x32$.metalstack.api.v2.MachineAllocationR\nallocation\x12\x38\n\x06status\x18\t \x01(\x0b\x32 .metalstack.api.v2.MachineStatusR\x06status\x12p\n\x1arecent_provisioning_events\x18\n \x01(\x0b\x32\x32.metalstack.api.v2.MachineRecentProvisioningEventsR\x18recentProvisioningEvents\"\xa4\x02\n\rMachineStatus\x12\x41\n\tcondition\x18\x01 \x01(\x0b\x32#.metalstack.api.v2.MachineConditionR\tcondition\x12N\n\tled_state\x18\x02 \x01(\x0b\x32\x31.metalstack.api.v2.MachineChassisIdentifyLEDStateR\x08ledState\x12N\n\nliveliness\x18\x03 \x01(\x0e\x32$.metalstack.api.v2.MachineLivelinessB\x08\xbaH\x05\x82\x01\x02\x10\x01R\nliveliness\x12\x30\n\x14metal_hammer_version\x18\x04 \x01(\tR\x12metalHammerVersion\"\xa4\x01\n\x10MachineCondition\x12?\n\x05state\x18\x01 \x01(\x0e\x32\x1f.metalstack.api.v2.MachineStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05state\x12-\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12 \n\x06issuer\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x06issuer\"\xb9\x07\n\x11MachineAllocation\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12-\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12\'\n\ncreated_by\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\tcreatedBy\x12\"\n\x07project\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12.\n\x05image\x18\x07 \x01(\x0b\x32\x18.metalstack.api.v2.ImageR\x05image\x12P\n\x11\x66ilesystem_layout\x18\x08 \x01(\x0b\x32#.metalstack.api.v2.FilesystemLayoutR\x10\x66ilesystemLayout\x12=\n\x08networks\x18\t \x03(\x0b\x32!.metalstack.api.v2.MachineNetworkR\x08networks\x12#\n\x08hostname\x18\n \x01(\tB\x07\xbaH\x04r\x02h\x01R\x08hostname\x12@\n\x0fssh_public_keys\x18\x0b \x03(\tB\x18\xbaH\x15\x92\x01\x12\x10\x32\"\x08r\x06\x88\xb4\xae\xb1\x02\x01\xd0\xa4\xb3\xb1\x02\x01R\rsshPublicKeys\x12+\n\x08userdata\x18\x0c \x01(\tB\x0f\xbaH\x0cr\n\x18\x80\x80\x02\xf0\xb3\xae\xb1\x02\x01R\x08userdata\x12[\n\x0f\x61llocation_type\x18\r \x01(\x0e\x32(.metalstack.api.v2.MachineAllocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0e\x61llocationType\x12G\n\x0e\x66irewall_rules\x18\x0e \x01(\x0b\x32 .metalstack.api.v2.FirewallRulesR\rfirewallRules\x12G\n\x0b\x64ns_servers\x18\x0f \x03(\x0b\x32\x1c.metalstack.api.v2.DNSServerB\x08\xbaH\x05\x92\x01\x02\x10\x03R\ndnsServers\x12G\n\x0bntp_servers\x18\x10 \x03(\x0b\x32\x1c.metalstack.api.v2.NTPServerB\x08\xbaH\x05\x92\x01\x02\x10\nR\nntpServers\x12/\n\x03vpn\x18\x11 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineVPNR\x03vpn\"a\n\x18MachineAllocationNetwork\x12%\n\x07network\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07network\x12\x1e\n\x03ips\x18\x02 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01R\x03ips\"\x90\x01\n\rFirewallRules\x12=\n\x06\x65gress\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.FirewallEgressRuleR\x06\x65gress\x12@\n\x07ingress\x18\x02 \x03(\x0b\x32&.metalstack.api.v2.FirewallIngressRuleR\x07ingress\"\xd0\x01\n\x12\x46irewallEgressRule\x12\x43\n\x08protocol\x18\x01 \x01(\x0e\x32\x1d.metalstack.api.v2.IPProtocolB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x08protocol\x12$\n\x05ports\x18\x02 \x03(\rB\x0e\xbaH\x0b\x92\x01\x08\"\x06*\x04\x18\xfc\xff\x03R\x05ports\x12\x1c\n\x02to\x18\x03 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x02to\x12\x31\n\x07\x63omment\x18\x04 \x01(\tB\x17\xbaH\x14r\x0f\x18\x64\x32\x0b^[a-z_ -]*$\xd8\x01\x01R\x07\x63omment\"\xf3\x01\n\x13\x46irewallIngressRule\x12\x43\n\x08protocol\x18\x01 \x01(\x0e\x32\x1d.metalstack.api.v2.IPProtocolB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x08protocol\x12$\n\x05ports\x18\x02 \x03(\rB\x0e\xbaH\x0b\x92\x01\x08\"\x06*\x04\x18\xfc\xff\x03R\x05ports\x12\x1c\n\x02to\x18\x03 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x02to\x12 \n\x04\x66rom\x18\x04 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x04\x66rom\x12\x31\n\x07\x63omment\x18\x05 \x01(\tB\x17\xbaH\x14r\x0f\x18\x64\x32\x0b^[a-z_ -]*$\xd8\x01\x01R\x07\x63omment\"\x9c\x03\n\x0eMachineNetwork\x12\x18\n\x07network\x18\x01 \x01(\tR\x07network\x12(\n\x08prefixes\x18\x02 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\x03 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12\x1e\n\x03ips\x18\x04 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01R\x03ips\x12K\n\x0cnetwork_type\x18\x05 \x01(\x0e\x32\x1e.metalstack.api.v2.NetworkTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0bnetworkType\x12?\n\x08nat_type\x18\x06 \x01(\x0e\x32\x1a.metalstack.api.v2.NATTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07natType\x12\x10\n\x03vrf\x18\x07 \x01(\x04R\x03vrf\x12\x10\n\x03\x61sn\x18\x08 \x01(\rR\x03\x61sn\x12\'\n\x07project\x18\t \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x07project\x88\x01\x01\x42\n\n\x08_project\"\xfb\x01\n\x0fMachineHardware\x12\x16\n\x06memory\x18\x01 \x01(\x04R\x06memory\x12;\n\x05\x64isks\x18\x02 \x03(\x0b\x32%.metalstack.api.v2.MachineBlockDeviceR\x05\x64isks\x12/\n\x04\x63pus\x18\x03 \x03(\x0b\x32\x1b.metalstack.api.v2.MetalCPUR\x04\x63pus\x12/\n\x04gpus\x18\x04 \x03(\x0b\x32\x1b.metalstack.api.v2.MetalGPUR\x04gpus\x12\x31\n\x04nics\x18\x05 \x03(\x0b\x32\x1d.metalstack.api.v2.MachineNicR\x04nics\"|\n\x08MetalCPU\x12 \n\x06vendor\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x06vendor\x12\x1e\n\x05model\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x05model\x12\x14\n\x05\x63ores\x18\x03 \x01(\rR\x05\x63ores\x12\x18\n\x07threads\x18\x04 \x01(\rR\x07threads\"L\n\x08MetalGPU\x12 \n\x06vendor\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x06vendor\x12\x1e\n\x05model\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x05model\"\xa7\x02\n\nMachineNic\x12\x1d\n\x03mac\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12\x1f\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12(\n\nidentifier\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\nidentifier\x12 \n\x06vendor\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\x06vendor\x12\x1e\n\x05model\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\x05model\x12\x14\n\x05speed\x18\x06 \x01(\x04R\x05speed\x12;\n\tneighbors\x18\x07 \x03(\x0b\x32\x1d.metalstack.api.v2.MachineNicR\tneighbors\x12\x1a\n\x08hostname\x18\x08 \x01(\tR\x08hostname\"I\n\x12MachineBlockDevice\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x12\n\x04size\x18\x02 \x01(\x04R\x04size\"o\n\x1eMachineChassisIdentifyLEDState\x12\x1e\n\x05value\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01R\x05value\x12-\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\"\xcb\x03\n\x10MachineBMCReport\x12/\n\x03\x62mc\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineBMCR\x03\x62mc\x12\x32\n\x04\x62ios\x18\x02 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12/\n\x03\x66ru\x18\x03 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineFRUR\x03\x66ru\x12H\n\x0cpower_metric\x18\x04 \x01(\x0b\x32%.metalstack.api.v2.MachinePowerMetricR\x0bpowerMetric\x12L\n\x0epower_supplies\x18\x05 \x03(\x0b\x32%.metalstack.api.v2.MachinePowerSupplyR\rpowerSupplies\x12N\n\tled_state\x18\x06 \x01(\x0b\x32\x31.metalstack.api.v2.MachineChassisIdentifyLEDStateR\x08ledState\x12\x39\n\nupdated_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\"z\n\x0bMachineBios\x12%\n\x07version\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x07version\x12#\n\x06vendor\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x06vendor\x12\x1f\n\x04\x64\x61te\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x04\x64\x61te\"\x99\x02\n\nMachineBMC\x12\"\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x80\x02\x01R\x07\x61\x64\x64ress\x12\x1d\n\x03mac\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12\x1f\n\x04user\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x04user\x12\'\n\x08password\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x08password\x12)\n\tinterface\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\tinterface\x12%\n\x07version\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x07version\x12,\n\x0bpower_state\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\npowerState\"\xa6\x05\n\nMachineFRU\x12@\n\x13\x63hassis_part_number\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x11\x63hassisPartNumber\x88\x01\x01\x12@\n\x13\x63hassis_part_serial\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x11\x63hassisPartSerial\x88\x01\x01\x12-\n\tboard_mfg\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x08\x62oardMfg\x88\x01\x01\x12:\n\x10\x62oard_mfg_serial\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x03R\x0e\x62oardMfgSerial\x88\x01\x01\x12<\n\x11\x62oard_part_number\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x04R\x0f\x62oardPartNumber\x88\x01\x01\x12\x43\n\x14product_manufacturer\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x05R\x13productManufacturer\x88\x01\x01\x12@\n\x13product_part_number\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x06R\x11productPartNumber\x88\x01\x01\x12\x37\n\x0eproduct_serial\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x07R\rproductSerial\x88\x01\x01\x42\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x13\n\x11_board_mfg_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial\"\xce\x01\n\x12MachinePowerMetric\x12\x34\n\x16\x61verage_consumed_watts\x18\x01 \x01(\x02R\x14\x61verageConsumedWatts\x12&\n\x0finterval_in_min\x18\x02 \x01(\x02R\rintervalInMin\x12,\n\x12max_consumed_watts\x18\x03 \x01(\x02R\x10maxConsumedWatts\x12,\n\x12min_consumed_watts\x18\x04 \x01(\x02R\x10minConsumedWatts\"B\n\x12MachinePowerSupply\x12\x16\n\x06health\x18\x01 \x01(\tR\x06health\x12\x14\n\x05state\x18\x02 \x01(\tR\x05state\"\xd3\x02\n\x1fMachineRecentProvisioningEvents\x12\x43\n\x06\x65vents\x18\x01 \x03(\x0b\x32+.metalstack.api.v2.MachineProvisioningEventR\x06\x65vents\x12\x42\n\x0flast_event_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\rlastEventTime\x12U\n\x10last_error_event\x18\x03 \x01(\x0b\x32+.metalstack.api.v2.MachineProvisioningEventR\x0elastErrorEvent\x12P\n\x05state\x18\x04 \x01(\x0e\x32\x30.metalstack.api.v2.MachineProvisioningEventStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05state\"\xb5\x01\n\x18MachineProvisioningEvent\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12O\n\x05\x65vent\x18\x02 \x01(\x0e\x32/.metalstack.api.v2.MachineProvisioningEventTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x05\x65vent\x12\x18\n\x07message\x18\x03 \x01(\tR\x07message\"\x99\x01\n\nMachineVPN\x12\x32\n\x15\x63ontrol_plane_address\x18\x01 \x01(\tR\x13\x63ontrolPlaneAddress\x12\x19\n\x08\x61uth_key\x18\x02 \x01(\tR\x07\x61uthKey\x12\x1c\n\tconnected\x18\x03 \x01(\x08R\tconnected\x12\x1e\n\x03ips\x18\x04 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01R\x03ips\"\xf7\x08\n\x0cMachineQuery\x12!\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12.\n\tpartition\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x02R\tpartition\x88\x01\x01\x12$\n\x04size\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04size\x88\x01\x01\x12$\n\x04rack\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x04R\x04rack\x88\x01\x01\x12$\n\x04room\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x05R\x04room\x88\x01\x01\x12\x36\n\x06labels\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x06R\x06labels\x88\x01\x01\x12N\n\nallocation\x18\x08 \x01(\x0b\x32).metalstack.api.v2.MachineAllocationQueryH\x07R\nallocation\x88\x01\x01\x12\x45\n\x07network\x18\t \x01(\x0b\x32&.metalstack.api.v2.MachineNetworkQueryH\x08R\x07network\x88\x01\x01\x12\x39\n\x03nic\x18\n \x01(\x0b\x32\".metalstack.api.v2.MachineNicQueryH\tR\x03nic\x88\x01\x01\x12<\n\x04\x64isk\x18\x0b \x01(\x0b\x32#.metalstack.api.v2.MachineDiskQueryH\nR\x04\x64isk\x88\x01\x01\x12\x39\n\x03\x62mc\x18\x0c \x01(\x0b\x32\".metalstack.api.v2.MachineBMCQueryH\x0bR\x03\x62mc\x88\x01\x01\x12\x39\n\x03\x66ru\x18\r \x01(\x0b\x32\".metalstack.api.v2.MachineFRUQueryH\x0cR\x03\x66ru\x88\x01\x01\x12H\n\x08hardware\x18\x0e \x01(\x0b\x32\'.metalstack.api.v2.MachineHardwareQueryH\rR\x08hardware\x88\x01\x01\x12:\n\x05state\x18\x0f \x01(\x0e\x32\x1f.metalstack.api.v2.MachineStateH\x0eR\x05state\x88\x01\x01\x12\x1d\n\x07waiting\x18\x10 \x01(\x08H\x0fR\x07waiting\x88\x01\x01\x12\'\n\x0cpreallocated\x18\x11 \x01(\x08H\x10R\x0cpreallocated\x88\x01\x01\x12(\n\rnot_allocated\x18\x12 \x01(\x08H\x11R\x0cnotAllocated\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_nameB\x0c\n\n_partitionB\x07\n\x05_sizeB\x07\n\x05_rackB\x07\n\x05_roomB\t\n\x07_labelsB\r\n\x0b_allocationB\n\n\x08_networkB\x06\n\x04_nicB\x07\n\x05_diskB\x06\n\x04_bmcB\x06\n\x04_fruB\x0b\n\t_hardwareB\x08\n\x06_stateB\n\n\x08_waitingB\x0f\n\r_preallocatedB\x10\n\x0e_not_allocated\"\xdd\x04\n\x16MachineAllocationQuery\x12!\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\'\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x02R\x07project\x88\x01\x01\x12&\n\x05image\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x05image\x88\x01\x01\x12=\n\x11\x66ilesystem_layout\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x04R\x10\x66ilesystemLayout\x88\x01\x01\x12(\n\x08hostname\x18\x06 \x01(\tB\x07\xbaH\x04r\x02h\x01H\x05R\x08hostname\x88\x01\x01\x12`\n\x0f\x61llocation_type\x18\x07 \x01(\x0e\x32(.metalstack.api.v2.MachineAllocationTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x06R\x0e\x61llocationType\x88\x01\x01\x12\x36\n\x06labels\x18\x08 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x07R\x06labels\x88\x01\x01\x12\x34\n\x03vpn\x18\t \x01(\x0b\x32\x1d.metalstack.api.v2.MachineVPNH\x08R\x03vpn\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_nameB\n\n\x08_projectB\x08\n\x06_imageB\x14\n\x12_filesystem_layoutB\x0b\n\t_hostnameB\x12\n\x10_allocation_typeB\t\n\x07_labelsB\x06\n\x04_vpn\"\xe4\x01\n\x13MachineNetworkQuery\x12\x1a\n\x08networks\x18\x01 \x03(\tR\x08networks\x12(\n\x08prefixes\x18\x02 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\x03 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12\x1e\n\x03ips\x18\x04 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01R\x03ips\x12\x12\n\x04vrfs\x18\x05 \x03(\x04R\x04vrfs\x12\x12\n\x04\x61sns\x18\x06 \x03(\rR\x04\x61sns\"\xd9\x01\n\x0fMachineNicQuery\x12(\n\x04macs\x18\x01 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x10\x64\x18\x01\"\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x04macs\x12\'\n\x05names\x18\x02 \x03(\tB\x11\xbaH\x0e\x92\x01\x0b\x10\x64\x18\x01\"\x05r\x03\x18\x80\x01R\x05names\x12\x39\n\rneighbor_macs\x18\x03 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x10\x64\x18\x01\"\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x0cneighborMacs\x12\x38\n\x0eneighbor_names\x18\x04 \x03(\tB\x11\xbaH\x0e\x92\x01\x0b\x10\x64\x18\x01\"\x05r\x03\x18\x80\x01R\rneighborNames\"Y\n\x10MachineDiskQuery\x12%\n\x05names\x18\x01 \x03(\tB\x0f\xbaH\x0c\x92\x01\t\x10\x64\"\x05r\x03\x18\x80\x01R\x05names\x12\x1e\n\x05sizes\x18\x02 \x03(\x04\x42\x08\xbaH\x05\x92\x01\x02\x10\x64R\x05sizes\"\xd8\x01\n\x0fMachineBMCQuery\x12&\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x00R\x07\x61\x64\x64ress\x88\x01\x01\x12\"\n\x03mac\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01H\x01R\x03mac\x88\x01\x01\x12!\n\x04user\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x02R\x04user\x88\x01\x01\x12+\n\tinterface\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x03R\tinterface\x88\x01\x01\x42\n\n\x08_addressB\x06\n\x04_macB\x07\n\x05_userB\x0c\n\n_interface\"\x88\x05\n\x0fMachineFRUQuery\x12=\n\x13\x63hassis_part_number\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x00R\x11\x63hassisPartNumber\x88\x01\x01\x12=\n\x13\x63hassis_part_serial\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x01R\x11\x63hassisPartSerial\x88\x01\x01\x12*\n\tboard_mfg\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x02R\x08\x62oardMfg\x88\x01\x01\x12\x30\n\x0c\x62oard_serial\x18\x04 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x03R\x0b\x62oardSerial\x88\x01\x01\x12\x39\n\x11\x62oard_part_number\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x04R\x0f\x62oardPartNumber\x88\x01\x01\x12@\n\x14product_manufacturer\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x05R\x13productManufacturer\x88\x01\x01\x12=\n\x13product_part_number\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x06R\x11productPartNumber\x88\x01\x01\x12\x34\n\x0eproduct_serial\x18\x08 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x01H\x07R\rproductSerial\x88\x01\x01\x42\x16\n\x14_chassis_part_numberB\x16\n\x14_chassis_part_serialB\x0c\n\n_board_mfgB\x0f\n\r_board_serialB\x14\n\x12_board_part_numberB\x17\n\x15_product_manufacturerB\x16\n\x14_product_part_numberB\x11\n\x0f_product_serial\"n\n\x14MachineHardwareQuery\x12\x1b\n\x06memory\x18\x01 \x01(\x04H\x00R\x06memory\x88\x01\x01\x12 \n\tcpu_cores\x18\x02 \x01(\rH\x01R\x08\x63puCores\x88\x01\x01\x42\t\n\x07_memoryB\x0c\n\n_cpu_cores\"\x98\x03\n\x12MachineIssuesQuery\x12\x44\n\rmachine_query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x0cmachineQuery\x12\x46\n\x04only\x18\x02 \x03(\x0e\x32#.metalstack.api.v2.MachineIssueTypeB\r\xbaH\n\x92\x01\x07\"\x05\x82\x01\x02\x10\x01R\x04only\x12\x46\n\x04omit\x18\x03 \x03(\x0e\x32#.metalstack.api.v2.MachineIssueTypeB\r\xbaH\n\x92\x01\x07\"\x05\x82\x01\x02\x10\x01R\x04omit\x12R\n\x08severity\x18\x04 \x01(\x0e\x32\'.metalstack.api.v2.MachineIssueSeverityB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x08severity\x88\x01\x01\x12K\n\x14last_error_threshold\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationR\x12lastErrorThresholdB\x0b\n\t_severity\"f\n\rMachineIssues\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x37\n\x06issues\x18\x02 \x03(\x0b\x32\x1f.metalstack.api.v2.MachineIssueR\x06issues\"\x9b\x02\n\x0cMachineIssue\x12\x41\n\x04type\x18\x01 \x01(\x0e\x32#.metalstack.api.v2.MachineIssueTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12M\n\x08severity\x18\x02 \x01(\x0e\x32\'.metalstack.api.v2.MachineIssueSeverityB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x08severity\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12\x30\n\rreference_url\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\x0creferenceUrl\x12\x18\n\x07\x64\x65tails\x18\x05 \x01(\tR\x07\x64\x65tails*e\n\nIPProtocol\x12\x1b\n\x17IP_PROTOCOL_UNSPECIFIED\x10\x00\x12\x1c\n\x0fIP_PROTOCOL_TCP\x10\x01\x1a\x07\x82\xb2\x19\x03tcp\x12\x1c\n\x0fIP_PROTOCOL_UDP\x10\x02\x1a\x07\x82\xb2\x19\x03udp*\xad\x01\n\x0cMachineState\x12#\n\x19MACHINE_STATE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12&\n\x15MACHINE_STATE_TAINTED\x10\x01\x1a\x0b\x82\xb2\x19\x07tainted\x12$\n\x14MACHINE_STATE_LOCKED\x10\x02\x1a\n\x82\xb2\x19\x06locked\x12*\n\x17MACHINE_STATE_AVAILABLE\x10\x03\x1a\r\x82\xb2\x19\tavailable*\xdf\x01\n\x1dMachineProvisioningEventState\x12\x36\n,MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12=\n*MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP\x10\x01\x1a\r\x82\xb2\x19\tcrashloop\x12G\n/MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM\x10\x02\x1a\x12\x82\xb2\x19\x0e\x66\x61iled-reclaim*\x9f\x06\n\x1cMachineProvisioningEventType\x12/\n+MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x34\n%MACHINE_PROVISIONING_EVENT_TYPE_ALIVE\x10\x01\x1a\t\x82\xb2\x19\x05\x41live\x12\x38\n\'MACHINE_PROVISIONING_EVENT_TYPE_CRASHED\x10\x02\x1a\x0b\x82\xb2\x19\x07\x43rashed\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING\x10\x03\x1a\x0f\x82\xb2\x19\x0bPXE Booting\x12\x46\n.MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT\x10\x04\x1a\x12\x82\xb2\x19\x0ePlanned Reboot\x12<\n)MACHINE_PROVISIONING_EVENT_TYPE_PREPARING\x10\x05\x1a\r\x82\xb2\x19\tPreparing\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING\x10\x06\x1a\x0f\x82\xb2\x19\x0bRegistering\x12\x38\n\'MACHINE_PROVISIONING_EVENT_TYPE_WAITING\x10\x07\x1a\x0b\x82\xb2\x19\x07Waiting\x12>\n*MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING\x10\x08\x1a\x0e\x82\xb2\x19\nInstalling\x12N\n2MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL\x10\t\x1a\x16\x82\xb2\x19\x12\x42ooting New Kernel\x12@\n+MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME\x10\n\x1a\x0f\x82\xb2\x19\x0bPhoned Home\x12H\n/MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM\x10\x0b\x1a\x13\x82\xb2\x19\x0fMachine Reclaim*\xba\x01\n\x11MachineLiveliness\x12(\n\x1eMACHINE_LIVELINESS_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12\'\n\x18MACHINE_LIVELINESS_ALIVE\x10\x01\x1a\t\x82\xb2\x19\x05\x61live\x12%\n\x17MACHINE_LIVELINESS_DEAD\x10\x02\x1a\x08\x82\xb2\x19\x04\x64\x65\x61\x64\x12+\n\x1aMACHINE_LIVELINESS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknown*\xac\x01\n\x15MachineAllocationType\x12-\n#MACHINE_ALLOCATION_TYPE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12\x30\n\x1fMACHINE_ALLOCATION_TYPE_MACHINE\x10\x01\x1a\x0b\x82\xb2\x19\x07machine\x12\x32\n MACHINE_ALLOCATION_TYPE_FIREWALL\x10\x02\x1a\x0c\x82\xb2\x19\x08\x66irewall*\xfe\x04\n\x11MachineBMCCommand\x12#\n\x1fMACHINE_BMC_COMMAND_UNSPECIFIED\x10\x00\x12\"\n\x16MACHINE_BMC_COMMAND_ON\x10\x01\x1a\x06\x82\xb2\x19\x02on\x12$\n\x17MACHINE_BMC_COMMAND_OFF\x10\x02\x1a\x07\x82\xb2\x19\x03off\x12(\n\x19MACHINE_BMC_COMMAND_RESET\x10\x03\x1a\t\x82\xb2\x19\x05reset\x12(\n\x19MACHINE_BMC_COMMAND_CYCLE\x10\x04\x1a\t\x82\xb2\x19\x05\x63ycle\x12\x36\n MACHINE_BMC_COMMAND_BOOT_TO_BIOS\x10\x05\x1a\x10\x82\xb2\x19\x0c\x62oot-to-bios\x12:\n\"MACHINE_BMC_COMMAND_BOOT_FROM_DISK\x10\x06\x1a\x12\x82\xb2\x19\x0e\x62oot-from-disk\x12\x38\n!MACHINE_BMC_COMMAND_BOOT_FROM_PXE\x10\x07\x1a\x11\x82\xb2\x19\rboot-from-pxe\x12<\n#MACHINE_BMC_COMMAND_IDENTIFY_LED_ON\x10\x08\x1a\x13\x82\xb2\x19\x0fidentify-led-on\x12>\n$MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF\x10\t\x1a\x14\x82\xb2\x19\x10identify-led-off\x12<\n#MACHINE_BMC_COMMAND_MACHINE_DELETED\x10\n\x1a\x13\x82\xb2\x19\x0fmachine-deleted\x12<\n#MACHINE_BMC_COMMAND_MACHINE_CREATED\x10\x0b\x1a\x13\x82\xb2\x19\x0fmachine-created*\xf3\x06\n\x10MachineIssueType\x12\"\n\x1eMACHINE_ISSUE_TYPE_UNSPECIFIED\x10\x00\x12\x39\n!MACHINE_ISSUE_TYPE_ASN_UNIQUENESS\x10\x01\x1a\x12\x82\xb2\x19\x0e\x61sn-not-unique\x12?\n$MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED\x10\x02\x1a\x15\x82\xb2\x19\x11\x62mc-info-outdated\x12\x42\n&MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP\x10\x03\x1a\x16\x82\xb2\x19\x12\x62mc-no-distinct-ip\x12\x39\n!MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP\x10\x04\x1a\x12\x82\xb2\x19\x0e\x62mc-without-ip\x12;\n\"MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC\x10\x05\x1a\x13\x82\xb2\x19\x0f\x62mc-without-mac\x12\x30\n\x1dMACHINE_ISSUE_TYPE_CRASH_LOOP\x10\x06\x1a\r\x82\xb2\x19\tcrashloop\x12I\n)MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM\x10\x07\x1a\x1a\x82\xb2\x19\x16\x66\x61iled-machine-reclaim\x12=\n#MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR\x10\x08\x1a\x14\x82\xb2\x19\x10last-event-error\x12;\n\"MACHINE_ISSUE_TYPE_LIVELINESS_DEAD\x10\t\x1a\x13\x82\xb2\x19\x0fliveliness-dead\x12M\n+MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE\x10\n\x1a\x1c\x82\xb2\x19\x18liveliness-not-available\x12\x41\n%MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN\x10\x0b\x1a\x16\x82\xb2\x19\x12liveliness-unknown\x12\x41\n%MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER\x10\x0c\x1a\x16\x82\xb2\x19\x12no-event-container\x12\x35\n\x1fMACHINE_ISSUE_TYPE_NO_PARTITION\x10\r\x1a\x10\x82\xb2\x19\x0cno-partition*\xcb\x01\n\x14MachineIssueSeverity\x12&\n\"MACHINE_ISSUE_SEVERITY_UNSPECIFIED\x10\x00\x12+\n\x1cMACHINE_ISSUE_SEVERITY_MINOR\x10\x01\x1a\t\x82\xb2\x19\x05minor\x12+\n\x1cMACHINE_ISSUE_SEVERITY_MAJOR\x10\x02\x1a\t\x82\xb2\x19\x05major\x12\x31\n\x1fMACHINE_ISSUE_SEVERITY_CRITICAL\x10\x03\x1a\x0c\x82\xb2\x19\x08\x63ritical2\xd1\x06\n\x0eMachineService\x12m\n\x03Get\x12+.metalstack.api.v2.MachineServiceGetRequest\x1a,.metalstack.api.v2.MachineServiceGetResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06\x43reate\x12..metalstack.api.v2.MachineServiceCreateRequest\x1a/.metalstack.api.v2.MachineServiceCreateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.MachineServiceUpdateRequest\x1a/.metalstack.api.v2.MachineServiceUpdateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12p\n\x04List\x12,.metalstack.api.v2.MachineServiceListRequest\x1a-.metalstack.api.v2.MachineServiceListResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06\x44\x65lete\x12..metalstack.api.v2.MachineServiceDeleteRequest\x1a/.metalstack.api.v2.MachineServiceDeleteResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x81\x01\n\nBMCCommand\x12\x32.metalstack.api.v2.MachineServiceBMCCommandRequest\x1a\x33.metalstack.api.v2.MachineServiceBMCCommandResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06GetBMC\x12..metalstack.api.v2.MachineServiceGetBMCRequest\x1a/.metalstack.api.v2.MachineServiceGetBMCResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xc2\x01\n\x15\x63om.metalstack.api.v2B\x0cMachineProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.machine_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\014MachineProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_IPPROTOCOL'].values_by_name["IP_PROTOCOL_TCP"]._loaded_options = None - _globals['_IPPROTOCOL'].values_by_name["IP_PROTOCOL_TCP"]._serialized_options = b'\202\262\031\003tcp' - _globals['_IPPROTOCOL'].values_by_name["IP_PROTOCOL_UDP"]._loaded_options = None - _globals['_IPPROTOCOL'].values_by_name["IP_PROTOCOL_UDP"]._serialized_options = b'\202\262\031\003udp' - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_UNSPECIFIED"]._loaded_options = None - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_UNSPECIFIED"]._serialized_options = b'\202\262\031\000' - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_TAINTED"]._loaded_options = None - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_TAINTED"]._serialized_options = b'\202\262\031\007tainted' - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_LOCKED"]._loaded_options = None - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_LOCKED"]._serialized_options = b'\202\262\031\006locked' - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_AVAILABLE"]._loaded_options = None - _globals['_MACHINESTATE'].values_by_name["MACHINE_STATE_AVAILABLE"]._serialized_options = b'\202\262\031\tavailable' - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED"]._serialized_options = b'\202\262\031\000' - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP"]._serialized_options = b'\202\262\031\tcrashloop' - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTSTATE'].values_by_name["MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM"]._serialized_options = b'\202\262\031\016failed-reclaim' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_ALIVE"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_ALIVE"]._serialized_options = b'\202\262\031\005Alive' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_CRASHED"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_CRASHED"]._serialized_options = b'\202\262\031\007Crashed' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING"]._serialized_options = b'\202\262\031\013PXE Booting' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT"]._serialized_options = b'\202\262\031\016Planned Reboot' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PREPARING"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PREPARING"]._serialized_options = b'\202\262\031\tPreparing' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING"]._serialized_options = b'\202\262\031\013Registering' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_WAITING"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_WAITING"]._serialized_options = b'\202\262\031\007Waiting' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING"]._serialized_options = b'\202\262\031\nInstalling' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL"]._serialized_options = b'\202\262\031\022Booting New Kernel' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME"]._serialized_options = b'\202\262\031\013Phoned Home' - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM"]._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENTTYPE'].values_by_name["MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM"]._serialized_options = b'\202\262\031\017Machine Reclaim' - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_UNSPECIFIED"]._loaded_options = None - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_UNSPECIFIED"]._serialized_options = b'\202\262\031\000' - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_ALIVE"]._loaded_options = None - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_ALIVE"]._serialized_options = b'\202\262\031\005alive' - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_DEAD"]._loaded_options = None - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_DEAD"]._serialized_options = b'\202\262\031\004dead' - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_UNKNOWN"]._loaded_options = None - _globals['_MACHINELIVELINESS'].values_by_name["MACHINE_LIVELINESS_UNKNOWN"]._serialized_options = b'\202\262\031\007unknown' - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_UNSPECIFIED"]._loaded_options = None - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_UNSPECIFIED"]._serialized_options = b'\202\262\031\000' - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_MACHINE"]._loaded_options = None - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_MACHINE"]._serialized_options = b'\202\262\031\007machine' - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_FIREWALL"]._loaded_options = None - _globals['_MACHINEALLOCATIONTYPE'].values_by_name["MACHINE_ALLOCATION_TYPE_FIREWALL"]._serialized_options = b'\202\262\031\010firewall' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_ON"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_ON"]._serialized_options = b'\202\262\031\002on' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_OFF"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_OFF"]._serialized_options = b'\202\262\031\003off' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_RESET"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_RESET"]._serialized_options = b'\202\262\031\005reset' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_CYCLE"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_CYCLE"]._serialized_options = b'\202\262\031\005cycle' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_TO_BIOS"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_TO_BIOS"]._serialized_options = b'\202\262\031\014boot-to-bios' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_FROM_DISK"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_FROM_DISK"]._serialized_options = b'\202\262\031\016boot-from-disk' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_FROM_PXE"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_BOOT_FROM_PXE"]._serialized_options = b'\202\262\031\rboot-from-pxe' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_IDENTIFY_LED_ON"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_IDENTIFY_LED_ON"]._serialized_options = b'\202\262\031\017identify-led-on' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF"]._serialized_options = b'\202\262\031\020identify-led-off' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_MACHINE_DELETED"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_MACHINE_DELETED"]._serialized_options = b'\202\262\031\017machine-deleted' - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_MACHINE_CREATED"]._loaded_options = None - _globals['_MACHINEBMCCOMMAND'].values_by_name["MACHINE_BMC_COMMAND_MACHINE_CREATED"]._serialized_options = b'\202\262\031\017machine-created' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_ASN_UNIQUENESS"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_ASN_UNIQUENESS"]._serialized_options = b'\202\262\031\016asn-not-unique' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED"]._serialized_options = b'\202\262\031\021bmc-info-outdated' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP"]._serialized_options = b'\202\262\031\022bmc-no-distinct-ip' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP"]._serialized_options = b'\202\262\031\016bmc-without-ip' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC"]._serialized_options = b'\202\262\031\017bmc-without-mac' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_CRASH_LOOP"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_CRASH_LOOP"]._serialized_options = b'\202\262\031\tcrashloop' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM"]._serialized_options = b'\202\262\031\026failed-machine-reclaim' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR"]._serialized_options = b'\202\262\031\020last-event-error' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_DEAD"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_DEAD"]._serialized_options = b'\202\262\031\017liveliness-dead' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE"]._serialized_options = b'\202\262\031\030liveliness-not-available' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN"]._serialized_options = b'\202\262\031\022liveliness-unknown' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER"]._serialized_options = b'\202\262\031\022no-event-container' - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_NO_PARTITION"]._loaded_options = None - _globals['_MACHINEISSUETYPE'].values_by_name["MACHINE_ISSUE_TYPE_NO_PARTITION"]._serialized_options = b'\202\262\031\014no-partition' - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_MINOR"]._loaded_options = None - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_MINOR"]._serialized_options = b'\202\262\031\005minor' - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_MAJOR"]._loaded_options = None - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_MAJOR"]._serialized_options = b'\202\262\031\005major' - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_CRITICAL"]._loaded_options = None - _globals['_MACHINEISSUESEVERITY'].values_by_name["MACHINE_ISSUE_SEVERITY_CRITICAL"]._serialized_options = b'\202\262\031\010critical' - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICEGETREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['hostname']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['hostname']._serialized_options = b'\272H\004r\002h\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['image']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['image']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['filesystem_layout']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['filesystem_layout']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['ssh_public_keys']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['ssh_public_keys']._serialized_options = b'\272H\025\222\001\022\0202\"\010r\006\210\264\256\261\002\001\320\244\263\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['userdata']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['userdata']._serialized_options = b'\272H\014r\n\030\200\200\002\360\263\256\261\002\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['networks']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['networks']._serialized_options = b'\272H\005\222\001\002\010\001' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['placement_tags']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['placement_tags']._serialized_options = b'\272H\005\222\001\002\020@' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['dns_servers']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['dns_servers']._serialized_options = b'\272H\005\222\001\002\020\003' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['ntp_servers']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['ntp_servers']._serialized_options = b'\272H\005\222\001\002\020\n' - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['allocation_type']._loaded_options = None - _globals['_MACHINESERVICECREATEREQUEST'].fields_by_name['allocation_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['ssh_public_keys']._loaded_options = None - _globals['_MACHINESERVICEUPDATEREQUEST'].fields_by_name['ssh_public_keys']._serialized_options = b'\272H\025\222\001\022\0202\"\010r\006\210\264\256\261\002\001\320\244\263\261\002\001' - _globals['_MACHINESERVICELISTREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICELISTREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICEDELETEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['command']._loaded_options = None - _globals['_MACHINESERVICEBMCCOMMANDREQUEST'].fields_by_name['command']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_MACHINESERVICEGETBMCREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINESERVICEGETBMCRESPONSE'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINESERVICEGETBMCRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINE'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINE'].fields_by_name['rack']._loaded_options = None - _globals['_MACHINE'].fields_by_name['rack']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINE'].fields_by_name['room']._loaded_options = None - _globals['_MACHINE'].fields_by_name['room']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINESTATUS'].fields_by_name['liveliness']._loaded_options = None - _globals['_MACHINESTATUS'].fields_by_name['liveliness']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINECONDITION'].fields_by_name['state']._loaded_options = None - _globals['_MACHINECONDITION'].fields_by_name['state']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINECONDITION'].fields_by_name['description']._loaded_options = None - _globals['_MACHINECONDITION'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINECONDITION'].fields_by_name['issuer']._loaded_options = None - _globals['_MACHINECONDITION'].fields_by_name['issuer']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_MACHINEALLOCATION'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEALLOCATION'].fields_by_name['name']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATION'].fields_by_name['description']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEALLOCATION'].fields_by_name['created_by']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['created_by']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEALLOCATION'].fields_by_name['project']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEALLOCATION'].fields_by_name['hostname']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['hostname']._serialized_options = b'\272H\004r\002h\001' - _globals['_MACHINEALLOCATION'].fields_by_name['ssh_public_keys']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['ssh_public_keys']._serialized_options = b'\272H\025\222\001\022\0202\"\010r\006\210\264\256\261\002\001\320\244\263\261\002\001' - _globals['_MACHINEALLOCATION'].fields_by_name['userdata']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['userdata']._serialized_options = b'\272H\014r\n\030\200\200\002\360\263\256\261\002\001' - _globals['_MACHINEALLOCATION'].fields_by_name['allocation_type']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['allocation_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEALLOCATION'].fields_by_name['dns_servers']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['dns_servers']._serialized_options = b'\272H\005\222\001\002\020\003' - _globals['_MACHINEALLOCATION'].fields_by_name['ntp_servers']._loaded_options = None - _globals['_MACHINEALLOCATION'].fields_by_name['ntp_servers']._serialized_options = b'\272H\005\222\001\002\020\n' - _globals['_MACHINEALLOCATIONNETWORK'].fields_by_name['network']._loaded_options = None - _globals['_MACHINEALLOCATIONNETWORK'].fields_by_name['network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATIONNETWORK'].fields_by_name['ips']._loaded_options = None - _globals['_MACHINEALLOCATIONNETWORK'].fields_by_name['ips']._serialized_options = b'\272H\t\222\001\006\300\244\263\261\002\001' - _globals['_FIREWALLEGRESSRULE'].fields_by_name['protocol']._loaded_options = None - _globals['_FIREWALLEGRESSRULE'].fields_by_name['protocol']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_FIREWALLEGRESSRULE'].fields_by_name['ports']._loaded_options = None - _globals['_FIREWALLEGRESSRULE'].fields_by_name['ports']._serialized_options = b'\272H\013\222\001\010\"\006*\004\030\374\377\003' - _globals['_FIREWALLEGRESSRULE'].fields_by_name['to']._loaded_options = None - _globals['_FIREWALLEGRESSRULE'].fields_by_name['to']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_FIREWALLEGRESSRULE'].fields_by_name['comment']._loaded_options = None - _globals['_FIREWALLEGRESSRULE'].fields_by_name['comment']._serialized_options = b'\272H\024r\017\030d2\013^[a-z_ -]*$\330\001\001' - _globals['_FIREWALLINGRESSRULE'].fields_by_name['protocol']._loaded_options = None - _globals['_FIREWALLINGRESSRULE'].fields_by_name['protocol']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_FIREWALLINGRESSRULE'].fields_by_name['ports']._loaded_options = None - _globals['_FIREWALLINGRESSRULE'].fields_by_name['ports']._serialized_options = b'\272H\013\222\001\010\"\006*\004\030\374\377\003' - _globals['_FIREWALLINGRESSRULE'].fields_by_name['to']._loaded_options = None - _globals['_FIREWALLINGRESSRULE'].fields_by_name['to']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_FIREWALLINGRESSRULE'].fields_by_name['from']._loaded_options = None - _globals['_FIREWALLINGRESSRULE'].fields_by_name['from']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_FIREWALLINGRESSRULE'].fields_by_name['comment']._loaded_options = None - _globals['_FIREWALLINGRESSRULE'].fields_by_name['comment']._serialized_options = b'\272H\024r\017\030d2\013^[a-z_ -]*$\330\001\001' - _globals['_MACHINENETWORK'].fields_by_name['prefixes']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_MACHINENETWORK'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_MACHINENETWORK'].fields_by_name['ips']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['ips']._serialized_options = b'\272H\t\222\001\006\300\244\263\261\002\001' - _globals['_MACHINENETWORK'].fields_by_name['network_type']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['network_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINENETWORK'].fields_by_name['nat_type']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['nat_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINENETWORK'].fields_by_name['project']._loaded_options = None - _globals['_MACHINENETWORK'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_METALCPU'].fields_by_name['vendor']._loaded_options = None - _globals['_METALCPU'].fields_by_name['vendor']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_METALCPU'].fields_by_name['model']._loaded_options = None - _globals['_METALCPU'].fields_by_name['model']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_METALGPU'].fields_by_name['vendor']._loaded_options = None - _globals['_METALGPU'].fields_by_name['vendor']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_METALGPU'].fields_by_name['model']._loaded_options = None - _globals['_METALGPU'].fields_by_name['model']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_MACHINENIC'].fields_by_name['mac']._loaded_options = None - _globals['_MACHINENIC'].fields_by_name['mac']._serialized_options = b'\272H\010r\006\270\263\256\261\002\001' - _globals['_MACHINENIC'].fields_by_name['name']._loaded_options = None - _globals['_MACHINENIC'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINENIC'].fields_by_name['identifier']._loaded_options = None - _globals['_MACHINENIC'].fields_by_name['identifier']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINENIC'].fields_by_name['vendor']._loaded_options = None - _globals['_MACHINENIC'].fields_by_name['vendor']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINENIC'].fields_by_name['model']._loaded_options = None - _globals['_MACHINENIC'].fields_by_name['model']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEBLOCKDEVICE'].fields_by_name['name']._loaded_options = None - _globals['_MACHINEBLOCKDEVICE'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINECHASSISIDENTIFYLEDSTATE'].fields_by_name['value']._loaded_options = None - _globals['_MACHINECHASSISIDENTIFYLEDSTATE'].fields_by_name['value']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINECHASSISIDENTIFYLEDSTATE'].fields_by_name['description']._loaded_options = None - _globals['_MACHINECHASSISIDENTIFYLEDSTATE'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBIOS'].fields_by_name['version']._loaded_options = None - _globals['_MACHINEBIOS'].fields_by_name['version']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBIOS'].fields_by_name['vendor']._loaded_options = None - _globals['_MACHINEBIOS'].fields_by_name['vendor']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBIOS'].fields_by_name['date']._loaded_options = None - _globals['_MACHINEBIOS'].fields_by_name['date']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['address']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['address']._serialized_options = b'\272H\005r\003\200\002\001' - _globals['_MACHINEBMC'].fields_by_name['mac']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['mac']._serialized_options = b'\272H\010r\006\270\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['user']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['user']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['password']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['password']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['interface']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['interface']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['version']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['version']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEBMC'].fields_by_name['power_state']._loaded_options = None - _globals['_MACHINEBMC'].fields_by_name['power_state']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['chassis_part_number']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['chassis_part_number']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['chassis_part_serial']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['chassis_part_serial']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['board_mfg']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['board_mfg']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['board_mfg_serial']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['board_mfg_serial']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['board_part_number']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['board_part_number']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['product_manufacturer']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['product_manufacturer']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['product_part_number']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['product_part_number']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEFRU'].fields_by_name['product_serial']._loaded_options = None - _globals['_MACHINEFRU'].fields_by_name['product_serial']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINERECENTPROVISIONINGEVENTS'].fields_by_name['state']._loaded_options = None - _globals['_MACHINERECENTPROVISIONINGEVENTS'].fields_by_name['state']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['event']._loaded_options = None - _globals['_MACHINEPROVISIONINGEVENT'].fields_by_name['event']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEVPN'].fields_by_name['ips']._loaded_options = None - _globals['_MACHINEVPN'].fields_by_name['ips']._serialized_options = b'\272H\t\222\001\006\300\244\263\261\002\001' - _globals['_MACHINEQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEQUERY'].fields_by_name['name']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEQUERY'].fields_by_name['partition']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_MACHINEQUERY'].fields_by_name['size']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEQUERY'].fields_by_name['rack']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['rack']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEQUERY'].fields_by_name['room']._loaded_options = None - _globals['_MACHINEQUERY'].fields_by_name['room']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['name']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['project']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['image']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['image']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['filesystem_layout']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['filesystem_layout']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['hostname']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['hostname']._serialized_options = b'\272H\004r\002h\001' - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['allocation_type']._loaded_options = None - _globals['_MACHINEALLOCATIONQUERY'].fields_by_name['allocation_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINENETWORKQUERY'].fields_by_name['prefixes']._loaded_options = None - _globals['_MACHINENETWORKQUERY'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_MACHINENETWORKQUERY'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_MACHINENETWORKQUERY'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_MACHINENETWORKQUERY'].fields_by_name['ips']._loaded_options = None - _globals['_MACHINENETWORKQUERY'].fields_by_name['ips']._serialized_options = b'\272H\t\222\001\006\300\244\263\261\002\001' - _globals['_MACHINENICQUERY'].fields_by_name['macs']._loaded_options = None - _globals['_MACHINENICQUERY'].fields_by_name['macs']._serialized_options = b'\272H\021\222\001\016\020d\030\001\"\010r\006\270\263\256\261\002\001' - _globals['_MACHINENICQUERY'].fields_by_name['names']._loaded_options = None - _globals['_MACHINENICQUERY'].fields_by_name['names']._serialized_options = b'\272H\016\222\001\013\020d\030\001\"\005r\003\030\200\001' - _globals['_MACHINENICQUERY'].fields_by_name['neighbor_macs']._loaded_options = None - _globals['_MACHINENICQUERY'].fields_by_name['neighbor_macs']._serialized_options = b'\272H\021\222\001\016\020d\030\001\"\010r\006\270\263\256\261\002\001' - _globals['_MACHINENICQUERY'].fields_by_name['neighbor_names']._loaded_options = None - _globals['_MACHINENICQUERY'].fields_by_name['neighbor_names']._serialized_options = b'\272H\016\222\001\013\020d\030\001\"\005r\003\030\200\001' - _globals['_MACHINEDISKQUERY'].fields_by_name['names']._loaded_options = None - _globals['_MACHINEDISKQUERY'].fields_by_name['names']._serialized_options = b'\272H\014\222\001\t\020d\"\005r\003\030\200\001' - _globals['_MACHINEDISKQUERY'].fields_by_name['sizes']._loaded_options = None - _globals['_MACHINEDISKQUERY'].fields_by_name['sizes']._serialized_options = b'\272H\005\222\001\002\020d' - _globals['_MACHINEBMCQUERY'].fields_by_name['address']._loaded_options = None - _globals['_MACHINEBMCQUERY'].fields_by_name['address']._serialized_options = b'\272H\004r\002p\001' - _globals['_MACHINEBMCQUERY'].fields_by_name['mac']._loaded_options = None - _globals['_MACHINEBMCQUERY'].fields_by_name['mac']._serialized_options = b'\272H\010r\006\270\263\256\261\002\001' - _globals['_MACHINEBMCQUERY'].fields_by_name['user']._loaded_options = None - _globals['_MACHINEBMCQUERY'].fields_by_name['user']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEBMCQUERY'].fields_by_name['interface']._loaded_options = None - _globals['_MACHINEBMCQUERY'].fields_by_name['interface']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['chassis_part_number']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['chassis_part_number']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['chassis_part_serial']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['chassis_part_serial']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['board_mfg']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['board_mfg']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['board_serial']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['board_serial']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['board_part_number']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['board_part_number']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['product_manufacturer']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['product_manufacturer']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['product_part_number']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['product_part_number']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEFRUQUERY'].fields_by_name['product_serial']._loaded_options = None - _globals['_MACHINEFRUQUERY'].fields_by_name['product_serial']._serialized_options = b'\272H\005r\003\030\200\001' - _globals['_MACHINEISSUESQUERY'].fields_by_name['only']._loaded_options = None - _globals['_MACHINEISSUESQUERY'].fields_by_name['only']._serialized_options = b'\272H\n\222\001\007\"\005\202\001\002\020\001' - _globals['_MACHINEISSUESQUERY'].fields_by_name['omit']._loaded_options = None - _globals['_MACHINEISSUESQUERY'].fields_by_name['omit']._serialized_options = b'\272H\n\222\001\007\"\005\202\001\002\020\001' - _globals['_MACHINEISSUESQUERY'].fields_by_name['severity']._loaded_options = None - _globals['_MACHINEISSUESQUERY'].fields_by_name['severity']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEISSUES'].fields_by_name['uuid']._loaded_options = None - _globals['_MACHINEISSUES'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_MACHINEISSUE'].fields_by_name['type']._loaded_options = None - _globals['_MACHINEISSUE'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEISSUE'].fields_by_name['severity']._loaded_options = None - _globals['_MACHINEISSUE'].fields_by_name['severity']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_MACHINEISSUE'].fields_by_name['description']._loaded_options = None - _globals['_MACHINEISSUE'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_MACHINEISSUE'].fields_by_name['reference_url']._loaded_options = None - _globals['_MACHINEISSUE'].fields_by_name['reference_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_MACHINESERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Get']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_MACHINESERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Create']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Update']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['List']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['List']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_MACHINESERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['Delete']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['BMCCommand']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['BMCCommand']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_MACHINESERVICE'].methods_by_name['GetBMC']._loaded_options = None - _globals['_MACHINESERVICE'].methods_by_name['GetBMC']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_IPPROTOCOL']._serialized_start=13762 - _globals['_IPPROTOCOL']._serialized_end=13863 - _globals['_MACHINESTATE']._serialized_start=13866 - _globals['_MACHINESTATE']._serialized_end=14039 - _globals['_MACHINEPROVISIONINGEVENTSTATE']._serialized_start=14042 - _globals['_MACHINEPROVISIONINGEVENTSTATE']._serialized_end=14265 - _globals['_MACHINEPROVISIONINGEVENTTYPE']._serialized_start=14268 - _globals['_MACHINEPROVISIONINGEVENTTYPE']._serialized_end=15067 - _globals['_MACHINELIVELINESS']._serialized_start=15070 - _globals['_MACHINELIVELINESS']._serialized_end=15256 - _globals['_MACHINEALLOCATIONTYPE']._serialized_start=15259 - _globals['_MACHINEALLOCATIONTYPE']._serialized_end=15431 - _globals['_MACHINEBMCCOMMAND']._serialized_start=15434 - _globals['_MACHINEBMCCOMMAND']._serialized_end=16072 - _globals['_MACHINEISSUETYPE']._serialized_start=16075 - _globals['_MACHINEISSUETYPE']._serialized_end=16958 - _globals['_MACHINEISSUESEVERITY']._serialized_start=16961 - _globals['_MACHINEISSUESEVERITY']._serialized_end=17164 - _globals['_MACHINESERVICEGETREQUEST']._serialized_start=387 - _globals['_MACHINESERVICEGETREQUEST']._serialized_end=479 - _globals['_MACHINESERVICEGETRESPONSE']._serialized_start=481 - _globals['_MACHINESERVICEGETRESPONSE']._serialized_end=562 - _globals['_MACHINESERVICECREATEREQUEST']._serialized_start=565 - _globals['_MACHINESERVICECREATEREQUEST']._serialized_end=1680 - _globals['_FIREWALLSPEC']._serialized_start=1682 - _globals['_FIREWALLSPEC']._serialized_end=1769 - _globals['_MACHINESERVICECREATERESPONSE']._serialized_start=1771 - _globals['_MACHINESERVICECREATERESPONSE']._serialized_end=1855 - _globals['_MACHINESERVICEUPDATEREQUEST']._serialized_start=1858 - _globals['_MACHINESERVICEUPDATEREQUEST']._serialized_end=2232 - _globals['_MACHINESERVICEUPDATERESPONSE']._serialized_start=2234 - _globals['_MACHINESERVICEUPDATERESPONSE']._serialized_end=2318 - _globals['_MACHINESERVICELISTREQUEST']._serialized_start=2320 - _globals['_MACHINESERVICELISTREQUEST']._serialized_end=2438 - _globals['_MACHINESERVICELISTRESPONSE']._serialized_start=2440 - _globals['_MACHINESERVICELISTRESPONSE']._serialized_end=2524 - _globals['_MACHINESERVICEDELETEREQUEST']._serialized_start=2526 - _globals['_MACHINESERVICEDELETEREQUEST']._serialized_end=2621 - _globals['_MACHINESERVICEDELETERESPONSE']._serialized_start=2623 - _globals['_MACHINESERVICEDELETERESPONSE']._serialized_end=2707 - _globals['_MACHINESERVICEBMCCOMMANDREQUEST']._serialized_start=2710 - _globals['_MACHINESERVICEBMCCOMMANDREQUEST']._serialized_end=2883 - _globals['_MACHINESERVICEBMCCOMMANDRESPONSE']._serialized_start=2885 - _globals['_MACHINESERVICEBMCCOMMANDRESPONSE']._serialized_end=2919 - _globals['_MACHINESERVICEGETBMCREQUEST']._serialized_start=2921 - _globals['_MACHINESERVICEGETBMCREQUEST']._serialized_end=3016 - _globals['_MACHINESERVICEGETBMCRESPONSE']._serialized_start=3018 - _globals['_MACHINESERVICEGETBMCRESPONSE']._serialized_end=3133 - _globals['_MACHINE']._serialized_start=3136 - _globals['_MACHINE']._serialized_end=3691 - _globals['_MACHINESTATUS']._serialized_start=3694 - _globals['_MACHINESTATUS']._serialized_end=3986 - _globals['_MACHINECONDITION']._serialized_start=3989 - _globals['_MACHINECONDITION']._serialized_end=4153 - _globals['_MACHINEALLOCATION']._serialized_start=4156 - _globals['_MACHINEALLOCATION']._serialized_end=5109 - _globals['_MACHINEALLOCATIONNETWORK']._serialized_start=5111 - _globals['_MACHINEALLOCATIONNETWORK']._serialized_end=5208 - _globals['_FIREWALLRULES']._serialized_start=5211 - _globals['_FIREWALLRULES']._serialized_end=5355 - _globals['_FIREWALLEGRESSRULE']._serialized_start=5358 - _globals['_FIREWALLEGRESSRULE']._serialized_end=5566 - _globals['_FIREWALLINGRESSRULE']._serialized_start=5569 - _globals['_FIREWALLINGRESSRULE']._serialized_end=5812 - _globals['_MACHINENETWORK']._serialized_start=5815 - _globals['_MACHINENETWORK']._serialized_end=6227 - _globals['_MACHINEHARDWARE']._serialized_start=6230 - _globals['_MACHINEHARDWARE']._serialized_end=6481 - _globals['_METALCPU']._serialized_start=6483 - _globals['_METALCPU']._serialized_end=6607 - _globals['_METALGPU']._serialized_start=6609 - _globals['_METALGPU']._serialized_end=6685 - _globals['_MACHINENIC']._serialized_start=6688 - _globals['_MACHINENIC']._serialized_end=6983 - _globals['_MACHINEBLOCKDEVICE']._serialized_start=6985 - _globals['_MACHINEBLOCKDEVICE']._serialized_end=7058 - _globals['_MACHINECHASSISIDENTIFYLEDSTATE']._serialized_start=7060 - _globals['_MACHINECHASSISIDENTIFYLEDSTATE']._serialized_end=7171 - _globals['_MACHINEBMCREPORT']._serialized_start=7174 - _globals['_MACHINEBMCREPORT']._serialized_end=7633 - _globals['_MACHINEBIOS']._serialized_start=7635 - _globals['_MACHINEBIOS']._serialized_end=7757 - _globals['_MACHINEBMC']._serialized_start=7760 - _globals['_MACHINEBMC']._serialized_end=8041 - _globals['_MACHINEFRU']._serialized_start=8044 - _globals['_MACHINEFRU']._serialized_end=8722 - _globals['_MACHINEPOWERMETRIC']._serialized_start=8725 - _globals['_MACHINEPOWERMETRIC']._serialized_end=8931 - _globals['_MACHINEPOWERSUPPLY']._serialized_start=8933 - _globals['_MACHINEPOWERSUPPLY']._serialized_end=8999 - _globals['_MACHINERECENTPROVISIONINGEVENTS']._serialized_start=9002 - _globals['_MACHINERECENTPROVISIONINGEVENTS']._serialized_end=9341 - _globals['_MACHINEPROVISIONINGEVENT']._serialized_start=9344 - _globals['_MACHINEPROVISIONINGEVENT']._serialized_end=9525 - _globals['_MACHINEVPN']._serialized_start=9528 - _globals['_MACHINEVPN']._serialized_end=9681 - _globals['_MACHINEQUERY']._serialized_start=9684 - _globals['_MACHINEQUERY']._serialized_end=10827 - _globals['_MACHINEALLOCATIONQUERY']._serialized_start=10830 - _globals['_MACHINEALLOCATIONQUERY']._serialized_end=11435 - _globals['_MACHINENETWORKQUERY']._serialized_start=11438 - _globals['_MACHINENETWORKQUERY']._serialized_end=11666 - _globals['_MACHINENICQUERY']._serialized_start=11669 - _globals['_MACHINENICQUERY']._serialized_end=11886 - _globals['_MACHINEDISKQUERY']._serialized_start=11888 - _globals['_MACHINEDISKQUERY']._serialized_end=11977 - _globals['_MACHINEBMCQUERY']._serialized_start=11980 - _globals['_MACHINEBMCQUERY']._serialized_end=12196 - _globals['_MACHINEFRUQUERY']._serialized_start=12199 - _globals['_MACHINEFRUQUERY']._serialized_end=12847 - _globals['_MACHINEHARDWAREQUERY']._serialized_start=12849 - _globals['_MACHINEHARDWAREQUERY']._serialized_end=12959 - _globals['_MACHINEISSUESQUERY']._serialized_start=12962 - _globals['_MACHINEISSUESQUERY']._serialized_end=13370 - _globals['_MACHINEISSUES']._serialized_start=13372 - _globals['_MACHINEISSUES']._serialized_end=13474 - _globals['_MACHINEISSUE']._serialized_start=13477 - _globals['_MACHINEISSUE']._serialized_end=13760 - _globals['_MACHINESERVICE']._serialized_start=17167 - _globals['_MACHINESERVICE']._serialized_end=18016 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/machine_pb2.pyi b/python/metalstack/api/v2/machine_pb2.pyi deleted file mode 100644 index 1b088a4e..00000000 --- a/python/metalstack/api/v2/machine_pb2.pyi +++ /dev/null @@ -1,822 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import filesystem_pb2 as _filesystem_pb2 -from metalstack.api.v2 import image_pb2 as _image_pb2 -from metalstack.api.v2 import network_pb2 as _network_pb2 -from metalstack.api.v2 import partition_pb2 as _partition_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import size_pb2 as _size_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class IPProtocol(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - IP_PROTOCOL_UNSPECIFIED: _ClassVar[IPProtocol] - IP_PROTOCOL_TCP: _ClassVar[IPProtocol] - IP_PROTOCOL_UDP: _ClassVar[IPProtocol] - -class MachineState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_STATE_UNSPECIFIED: _ClassVar[MachineState] - MACHINE_STATE_TAINTED: _ClassVar[MachineState] - MACHINE_STATE_LOCKED: _ClassVar[MachineState] - MACHINE_STATE_AVAILABLE: _ClassVar[MachineState] - -class MachineProvisioningEventState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED: _ClassVar[MachineProvisioningEventState] - MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP: _ClassVar[MachineProvisioningEventState] - MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM: _ClassVar[MachineProvisioningEventState] - -class MachineProvisioningEventType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_ALIVE: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_CRASHED: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_PREPARING: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_WAITING: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME: _ClassVar[MachineProvisioningEventType] - MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM: _ClassVar[MachineProvisioningEventType] - -class MachineLiveliness(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_LIVELINESS_UNSPECIFIED: _ClassVar[MachineLiveliness] - MACHINE_LIVELINESS_ALIVE: _ClassVar[MachineLiveliness] - MACHINE_LIVELINESS_DEAD: _ClassVar[MachineLiveliness] - MACHINE_LIVELINESS_UNKNOWN: _ClassVar[MachineLiveliness] - -class MachineAllocationType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_ALLOCATION_TYPE_UNSPECIFIED: _ClassVar[MachineAllocationType] - MACHINE_ALLOCATION_TYPE_MACHINE: _ClassVar[MachineAllocationType] - MACHINE_ALLOCATION_TYPE_FIREWALL: _ClassVar[MachineAllocationType] - -class MachineBMCCommand(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_BMC_COMMAND_UNSPECIFIED: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_ON: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_OFF: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_RESET: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_CYCLE: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_BOOT_TO_BIOS: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_BOOT_FROM_DISK: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_BOOT_FROM_PXE: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_IDENTIFY_LED_ON: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_MACHINE_DELETED: _ClassVar[MachineBMCCommand] - MACHINE_BMC_COMMAND_MACHINE_CREATED: _ClassVar[MachineBMCCommand] - -class MachineIssueType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_ISSUE_TYPE_UNSPECIFIED: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_ASN_UNIQUENESS: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_CRASH_LOOP: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_LIVELINESS_DEAD: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER: _ClassVar[MachineIssueType] - MACHINE_ISSUE_TYPE_NO_PARTITION: _ClassVar[MachineIssueType] - -class MachineIssueSeverity(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - MACHINE_ISSUE_SEVERITY_UNSPECIFIED: _ClassVar[MachineIssueSeverity] - MACHINE_ISSUE_SEVERITY_MINOR: _ClassVar[MachineIssueSeverity] - MACHINE_ISSUE_SEVERITY_MAJOR: _ClassVar[MachineIssueSeverity] - MACHINE_ISSUE_SEVERITY_CRITICAL: _ClassVar[MachineIssueSeverity] -IP_PROTOCOL_UNSPECIFIED: IPProtocol -IP_PROTOCOL_TCP: IPProtocol -IP_PROTOCOL_UDP: IPProtocol -MACHINE_STATE_UNSPECIFIED: MachineState -MACHINE_STATE_TAINTED: MachineState -MACHINE_STATE_LOCKED: MachineState -MACHINE_STATE_AVAILABLE: MachineState -MACHINE_PROVISIONING_EVENT_STATE_UNSPECIFIED: MachineProvisioningEventState -MACHINE_PROVISIONING_EVENT_STATE_CRASHLOOP: MachineProvisioningEventState -MACHINE_PROVISIONING_EVENT_STATE_FAILED_RECLAIM: MachineProvisioningEventState -MACHINE_PROVISIONING_EVENT_TYPE_UNSPECIFIED: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_ALIVE: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_CRASHED: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_PXE_BOOTING: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_PLANNED_REBOOT: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_PREPARING: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_REGISTERING: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_WAITING: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_INSTALLING: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_BOOTING_NEW_KERNEL: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_PHONED_HOME: MachineProvisioningEventType -MACHINE_PROVISIONING_EVENT_TYPE_MACHINE_RECLAIM: MachineProvisioningEventType -MACHINE_LIVELINESS_UNSPECIFIED: MachineLiveliness -MACHINE_LIVELINESS_ALIVE: MachineLiveliness -MACHINE_LIVELINESS_DEAD: MachineLiveliness -MACHINE_LIVELINESS_UNKNOWN: MachineLiveliness -MACHINE_ALLOCATION_TYPE_UNSPECIFIED: MachineAllocationType -MACHINE_ALLOCATION_TYPE_MACHINE: MachineAllocationType -MACHINE_ALLOCATION_TYPE_FIREWALL: MachineAllocationType -MACHINE_BMC_COMMAND_UNSPECIFIED: MachineBMCCommand -MACHINE_BMC_COMMAND_ON: MachineBMCCommand -MACHINE_BMC_COMMAND_OFF: MachineBMCCommand -MACHINE_BMC_COMMAND_RESET: MachineBMCCommand -MACHINE_BMC_COMMAND_CYCLE: MachineBMCCommand -MACHINE_BMC_COMMAND_BOOT_TO_BIOS: MachineBMCCommand -MACHINE_BMC_COMMAND_BOOT_FROM_DISK: MachineBMCCommand -MACHINE_BMC_COMMAND_BOOT_FROM_PXE: MachineBMCCommand -MACHINE_BMC_COMMAND_IDENTIFY_LED_ON: MachineBMCCommand -MACHINE_BMC_COMMAND_IDENTIFY_LED_OFF: MachineBMCCommand -MACHINE_BMC_COMMAND_MACHINE_DELETED: MachineBMCCommand -MACHINE_BMC_COMMAND_MACHINE_CREATED: MachineBMCCommand -MACHINE_ISSUE_TYPE_UNSPECIFIED: MachineIssueType -MACHINE_ISSUE_TYPE_ASN_UNIQUENESS: MachineIssueType -MACHINE_ISSUE_TYPE_BMC_INFO_OUTDATED: MachineIssueType -MACHINE_ISSUE_TYPE_BMC_NON_DISTINCT_IP: MachineIssueType -MACHINE_ISSUE_TYPE_BMC_WITHOUT_IP: MachineIssueType -MACHINE_ISSUE_TYPE_BMC_WITHOUT_MAC: MachineIssueType -MACHINE_ISSUE_TYPE_CRASH_LOOP: MachineIssueType -MACHINE_ISSUE_TYPE_FAILED_MACHINE_RECLAIM: MachineIssueType -MACHINE_ISSUE_TYPE_LAST_EVENT_ERROR: MachineIssueType -MACHINE_ISSUE_TYPE_LIVELINESS_DEAD: MachineIssueType -MACHINE_ISSUE_TYPE_LIVELINESS_NOT_AVAILABLE: MachineIssueType -MACHINE_ISSUE_TYPE_LIVELINESS_UNKNOWN: MachineIssueType -MACHINE_ISSUE_TYPE_NO_EVENT_CONTAINER: MachineIssueType -MACHINE_ISSUE_TYPE_NO_PARTITION: MachineIssueType -MACHINE_ISSUE_SEVERITY_UNSPECIFIED: MachineIssueSeverity -MACHINE_ISSUE_SEVERITY_MINOR: MachineIssueSeverity -MACHINE_ISSUE_SEVERITY_MAJOR: MachineIssueSeverity -MACHINE_ISSUE_SEVERITY_CRITICAL: MachineIssueSeverity - -class MachineServiceGetRequest(_message.Message): - __slots__ = ("uuid", "project") - UUID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - uuid: str - project: str - def __init__(self, uuid: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class MachineServiceGetResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: Machine - def __init__(self, machine: _Optional[_Union[Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceCreateRequest(_message.Message): - __slots__ = ("project", "uuid", "name", "description", "hostname", "partition", "size", "image", "filesystem_layout", "ssh_public_keys", "userdata", "labels", "networks", "placement_tags", "dns_servers", "ntp_servers", "allocation_type", "firewall_spec") - PROJECT_FIELD_NUMBER: _ClassVar[int] - UUID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - HOSTNAME_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - IMAGE_FIELD_NUMBER: _ClassVar[int] - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - SSH_PUBLIC_KEYS_FIELD_NUMBER: _ClassVar[int] - USERDATA_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - NETWORKS_FIELD_NUMBER: _ClassVar[int] - PLACEMENT_TAGS_FIELD_NUMBER: _ClassVar[int] - DNS_SERVERS_FIELD_NUMBER: _ClassVar[int] - NTP_SERVERS_FIELD_NUMBER: _ClassVar[int] - ALLOCATION_TYPE_FIELD_NUMBER: _ClassVar[int] - FIREWALL_SPEC_FIELD_NUMBER: _ClassVar[int] - project: str - uuid: str - name: str - description: str - hostname: str - partition: str - size: str - image: str - filesystem_layout: str - ssh_public_keys: _containers.RepeatedScalarFieldContainer[str] - userdata: str - labels: _common_pb2.Labels - networks: _containers.RepeatedCompositeFieldContainer[MachineAllocationNetwork] - placement_tags: _containers.RepeatedScalarFieldContainer[str] - dns_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.DNSServer] - ntp_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.NTPServer] - allocation_type: MachineAllocationType - firewall_spec: FirewallSpec - def __init__(self, project: _Optional[str] = ..., uuid: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., hostname: _Optional[str] = ..., partition: _Optional[str] = ..., size: _Optional[str] = ..., image: _Optional[str] = ..., filesystem_layout: _Optional[str] = ..., ssh_public_keys: _Optional[_Iterable[str]] = ..., userdata: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., networks: _Optional[_Iterable[_Union[MachineAllocationNetwork, _Mapping]]] = ..., placement_tags: _Optional[_Iterable[str]] = ..., dns_servers: _Optional[_Iterable[_Union[_partition_pb2.DNSServer, _Mapping]]] = ..., ntp_servers: _Optional[_Iterable[_Union[_partition_pb2.NTPServer, _Mapping]]] = ..., allocation_type: _Optional[_Union[MachineAllocationType, str]] = ..., firewall_spec: _Optional[_Union[FirewallSpec, _Mapping]] = ...) -> None: ... - -class FirewallSpec(_message.Message): - __slots__ = ("firewall_rules",) - FIREWALL_RULES_FIELD_NUMBER: _ClassVar[int] - firewall_rules: FirewallRules - def __init__(self, firewall_rules: _Optional[_Union[FirewallRules, _Mapping]] = ...) -> None: ... - -class MachineServiceCreateResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: Machine - def __init__(self, machine: _Optional[_Union[Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceUpdateRequest(_message.Message): - __slots__ = ("uuid", "update_meta", "project", "description", "labels", "ssh_public_keys") - UUID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - SSH_PUBLIC_KEYS_FIELD_NUMBER: _ClassVar[int] - uuid: str - update_meta: _common_pb2.UpdateMeta - project: str - description: str - labels: _common_pb2.UpdateLabels - ssh_public_keys: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, uuid: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., project: _Optional[str] = ..., description: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ..., ssh_public_keys: _Optional[_Iterable[str]] = ...) -> None: ... - -class MachineServiceUpdateResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: Machine - def __init__(self, machine: _Optional[_Union[Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceListRequest(_message.Message): - __slots__ = ("project", "query") - PROJECT_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - project: str - query: MachineQuery - def __init__(self, project: _Optional[str] = ..., query: _Optional[_Union[MachineQuery, _Mapping]] = ...) -> None: ... - -class MachineServiceListResponse(_message.Message): - __slots__ = ("machines",) - MACHINES_FIELD_NUMBER: _ClassVar[int] - machines: _containers.RepeatedCompositeFieldContainer[Machine] - def __init__(self, machines: _Optional[_Iterable[_Union[Machine, _Mapping]]] = ...) -> None: ... - -class MachineServiceDeleteRequest(_message.Message): - __slots__ = ("uuid", "project") - UUID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - uuid: str - project: str - def __init__(self, uuid: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class MachineServiceDeleteResponse(_message.Message): - __slots__ = ("machine",) - MACHINE_FIELD_NUMBER: _ClassVar[int] - machine: Machine - def __init__(self, machine: _Optional[_Union[Machine, _Mapping]] = ...) -> None: ... - -class MachineServiceBMCCommandRequest(_message.Message): - __slots__ = ("uuid", "project", "command") - UUID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - COMMAND_FIELD_NUMBER: _ClassVar[int] - uuid: str - project: str - command: MachineBMCCommand - def __init__(self, uuid: _Optional[str] = ..., project: _Optional[str] = ..., command: _Optional[_Union[MachineBMCCommand, str]] = ...) -> None: ... - -class MachineServiceBMCCommandResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class MachineServiceGetBMCRequest(_message.Message): - __slots__ = ("uuid", "project") - UUID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - uuid: str - project: str - def __init__(self, uuid: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class MachineServiceGetBMCResponse(_message.Message): - __slots__ = ("uuid", "bmc") - UUID_FIELD_NUMBER: _ClassVar[int] - BMC_FIELD_NUMBER: _ClassVar[int] - uuid: str - bmc: MachineBMCReport - def __init__(self, uuid: _Optional[str] = ..., bmc: _Optional[_Union[MachineBMCReport, _Mapping]] = ...) -> None: ... - -class Machine(_message.Message): - __slots__ = ("uuid", "meta", "partition", "rack", "room", "size", "hardware", "allocation", "status", "recent_provisioning_events") - UUID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - RACK_FIELD_NUMBER: _ClassVar[int] - ROOM_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - HARDWARE_FIELD_NUMBER: _ClassVar[int] - ALLOCATION_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - RECENT_PROVISIONING_EVENTS_FIELD_NUMBER: _ClassVar[int] - uuid: str - meta: _common_pb2.Meta - partition: _partition_pb2.Partition - rack: str - room: str - size: _size_pb2.Size - hardware: MachineHardware - allocation: MachineAllocation - status: MachineStatus - recent_provisioning_events: MachineRecentProvisioningEvents - def __init__(self, uuid: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., partition: _Optional[_Union[_partition_pb2.Partition, _Mapping]] = ..., rack: _Optional[str] = ..., room: _Optional[str] = ..., size: _Optional[_Union[_size_pb2.Size, _Mapping]] = ..., hardware: _Optional[_Union[MachineHardware, _Mapping]] = ..., allocation: _Optional[_Union[MachineAllocation, _Mapping]] = ..., status: _Optional[_Union[MachineStatus, _Mapping]] = ..., recent_provisioning_events: _Optional[_Union[MachineRecentProvisioningEvents, _Mapping]] = ...) -> None: ... - -class MachineStatus(_message.Message): - __slots__ = ("condition", "led_state", "liveliness", "metal_hammer_version") - CONDITION_FIELD_NUMBER: _ClassVar[int] - LED_STATE_FIELD_NUMBER: _ClassVar[int] - LIVELINESS_FIELD_NUMBER: _ClassVar[int] - METAL_HAMMER_VERSION_FIELD_NUMBER: _ClassVar[int] - condition: MachineCondition - led_state: MachineChassisIdentifyLEDState - liveliness: MachineLiveliness - metal_hammer_version: str - def __init__(self, condition: _Optional[_Union[MachineCondition, _Mapping]] = ..., led_state: _Optional[_Union[MachineChassisIdentifyLEDState, _Mapping]] = ..., liveliness: _Optional[_Union[MachineLiveliness, str]] = ..., metal_hammer_version: _Optional[str] = ...) -> None: ... - -class MachineCondition(_message.Message): - __slots__ = ("state", "description", "issuer") - STATE_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - ISSUER_FIELD_NUMBER: _ClassVar[int] - state: MachineState - description: str - issuer: str - def __init__(self, state: _Optional[_Union[MachineState, str]] = ..., description: _Optional[str] = ..., issuer: _Optional[str] = ...) -> None: ... - -class MachineAllocation(_message.Message): - __slots__ = ("uuid", "meta", "name", "description", "created_by", "project", "image", "filesystem_layout", "networks", "hostname", "ssh_public_keys", "userdata", "allocation_type", "firewall_rules", "dns_servers", "ntp_servers", "vpn") - UUID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - CREATED_BY_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - IMAGE_FIELD_NUMBER: _ClassVar[int] - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - NETWORKS_FIELD_NUMBER: _ClassVar[int] - HOSTNAME_FIELD_NUMBER: _ClassVar[int] - SSH_PUBLIC_KEYS_FIELD_NUMBER: _ClassVar[int] - USERDATA_FIELD_NUMBER: _ClassVar[int] - ALLOCATION_TYPE_FIELD_NUMBER: _ClassVar[int] - FIREWALL_RULES_FIELD_NUMBER: _ClassVar[int] - DNS_SERVERS_FIELD_NUMBER: _ClassVar[int] - NTP_SERVERS_FIELD_NUMBER: _ClassVar[int] - VPN_FIELD_NUMBER: _ClassVar[int] - uuid: str - meta: _common_pb2.Meta - name: str - description: str - created_by: str - project: str - image: _image_pb2.Image - filesystem_layout: _filesystem_pb2.FilesystemLayout - networks: _containers.RepeatedCompositeFieldContainer[MachineNetwork] - hostname: str - ssh_public_keys: _containers.RepeatedScalarFieldContainer[str] - userdata: str - allocation_type: MachineAllocationType - firewall_rules: FirewallRules - dns_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.DNSServer] - ntp_servers: _containers.RepeatedCompositeFieldContainer[_partition_pb2.NTPServer] - vpn: MachineVPN - def __init__(self, uuid: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., created_by: _Optional[str] = ..., project: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.Image, _Mapping]] = ..., filesystem_layout: _Optional[_Union[_filesystem_pb2.FilesystemLayout, _Mapping]] = ..., networks: _Optional[_Iterable[_Union[MachineNetwork, _Mapping]]] = ..., hostname: _Optional[str] = ..., ssh_public_keys: _Optional[_Iterable[str]] = ..., userdata: _Optional[str] = ..., allocation_type: _Optional[_Union[MachineAllocationType, str]] = ..., firewall_rules: _Optional[_Union[FirewallRules, _Mapping]] = ..., dns_servers: _Optional[_Iterable[_Union[_partition_pb2.DNSServer, _Mapping]]] = ..., ntp_servers: _Optional[_Iterable[_Union[_partition_pb2.NTPServer, _Mapping]]] = ..., vpn: _Optional[_Union[MachineVPN, _Mapping]] = ...) -> None: ... - -class MachineAllocationNetwork(_message.Message): - __slots__ = ("network", "ips") - NETWORK_FIELD_NUMBER: _ClassVar[int] - IPS_FIELD_NUMBER: _ClassVar[int] - network: str - ips: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, network: _Optional[str] = ..., ips: _Optional[_Iterable[str]] = ...) -> None: ... - -class FirewallRules(_message.Message): - __slots__ = ("egress", "ingress") - EGRESS_FIELD_NUMBER: _ClassVar[int] - INGRESS_FIELD_NUMBER: _ClassVar[int] - egress: _containers.RepeatedCompositeFieldContainer[FirewallEgressRule] - ingress: _containers.RepeatedCompositeFieldContainer[FirewallIngressRule] - def __init__(self, egress: _Optional[_Iterable[_Union[FirewallEgressRule, _Mapping]]] = ..., ingress: _Optional[_Iterable[_Union[FirewallIngressRule, _Mapping]]] = ...) -> None: ... - -class FirewallEgressRule(_message.Message): - __slots__ = ("protocol", "ports", "to", "comment") - PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PORTS_FIELD_NUMBER: _ClassVar[int] - TO_FIELD_NUMBER: _ClassVar[int] - COMMENT_FIELD_NUMBER: _ClassVar[int] - protocol: IPProtocol - ports: _containers.RepeatedScalarFieldContainer[int] - to: _containers.RepeatedScalarFieldContainer[str] - comment: str - def __init__(self, protocol: _Optional[_Union[IPProtocol, str]] = ..., ports: _Optional[_Iterable[int]] = ..., to: _Optional[_Iterable[str]] = ..., comment: _Optional[str] = ...) -> None: ... - -class FirewallIngressRule(_message.Message): - __slots__ = ("protocol", "ports", "to", "comment") - PROTOCOL_FIELD_NUMBER: _ClassVar[int] - PORTS_FIELD_NUMBER: _ClassVar[int] - TO_FIELD_NUMBER: _ClassVar[int] - FROM_FIELD_NUMBER: _ClassVar[int] - COMMENT_FIELD_NUMBER: _ClassVar[int] - protocol: IPProtocol - ports: _containers.RepeatedScalarFieldContainer[int] - to: _containers.RepeatedScalarFieldContainer[str] - comment: str - def __init__(self, protocol: _Optional[_Union[IPProtocol, str]] = ..., ports: _Optional[_Iterable[int]] = ..., to: _Optional[_Iterable[str]] = ..., comment: _Optional[str] = ..., **kwargs) -> None: ... - -class MachineNetwork(_message.Message): - __slots__ = ("network", "prefixes", "destination_prefixes", "ips", "network_type", "nat_type", "vrf", "asn", "project") - NETWORK_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - IPS_FIELD_NUMBER: _ClassVar[int] - NETWORK_TYPE_FIELD_NUMBER: _ClassVar[int] - NAT_TYPE_FIELD_NUMBER: _ClassVar[int] - VRF_FIELD_NUMBER: _ClassVar[int] - ASN_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - network: str - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - ips: _containers.RepeatedScalarFieldContainer[str] - network_type: _network_pb2.NetworkType - nat_type: _network_pb2.NATType - vrf: int - asn: int - project: str - def __init__(self, network: _Optional[str] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., ips: _Optional[_Iterable[str]] = ..., network_type: _Optional[_Union[_network_pb2.NetworkType, str]] = ..., nat_type: _Optional[_Union[_network_pb2.NATType, str]] = ..., vrf: _Optional[int] = ..., asn: _Optional[int] = ..., project: _Optional[str] = ...) -> None: ... - -class MachineHardware(_message.Message): - __slots__ = ("memory", "disks", "cpus", "gpus", "nics") - MEMORY_FIELD_NUMBER: _ClassVar[int] - DISKS_FIELD_NUMBER: _ClassVar[int] - CPUS_FIELD_NUMBER: _ClassVar[int] - GPUS_FIELD_NUMBER: _ClassVar[int] - NICS_FIELD_NUMBER: _ClassVar[int] - memory: int - disks: _containers.RepeatedCompositeFieldContainer[MachineBlockDevice] - cpus: _containers.RepeatedCompositeFieldContainer[MetalCPU] - gpus: _containers.RepeatedCompositeFieldContainer[MetalGPU] - nics: _containers.RepeatedCompositeFieldContainer[MachineNic] - def __init__(self, memory: _Optional[int] = ..., disks: _Optional[_Iterable[_Union[MachineBlockDevice, _Mapping]]] = ..., cpus: _Optional[_Iterable[_Union[MetalCPU, _Mapping]]] = ..., gpus: _Optional[_Iterable[_Union[MetalGPU, _Mapping]]] = ..., nics: _Optional[_Iterable[_Union[MachineNic, _Mapping]]] = ...) -> None: ... - -class MetalCPU(_message.Message): - __slots__ = ("vendor", "model", "cores", "threads") - VENDOR_FIELD_NUMBER: _ClassVar[int] - MODEL_FIELD_NUMBER: _ClassVar[int] - CORES_FIELD_NUMBER: _ClassVar[int] - THREADS_FIELD_NUMBER: _ClassVar[int] - vendor: str - model: str - cores: int - threads: int - def __init__(self, vendor: _Optional[str] = ..., model: _Optional[str] = ..., cores: _Optional[int] = ..., threads: _Optional[int] = ...) -> None: ... - -class MetalGPU(_message.Message): - __slots__ = ("vendor", "model") - VENDOR_FIELD_NUMBER: _ClassVar[int] - MODEL_FIELD_NUMBER: _ClassVar[int] - vendor: str - model: str - def __init__(self, vendor: _Optional[str] = ..., model: _Optional[str] = ...) -> None: ... - -class MachineNic(_message.Message): - __slots__ = ("mac", "name", "identifier", "vendor", "model", "speed", "neighbors", "hostname") - MAC_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - VENDOR_FIELD_NUMBER: _ClassVar[int] - MODEL_FIELD_NUMBER: _ClassVar[int] - SPEED_FIELD_NUMBER: _ClassVar[int] - NEIGHBORS_FIELD_NUMBER: _ClassVar[int] - HOSTNAME_FIELD_NUMBER: _ClassVar[int] - mac: str - name: str - identifier: str - vendor: str - model: str - speed: int - neighbors: _containers.RepeatedCompositeFieldContainer[MachineNic] - hostname: str - def __init__(self, mac: _Optional[str] = ..., name: _Optional[str] = ..., identifier: _Optional[str] = ..., vendor: _Optional[str] = ..., model: _Optional[str] = ..., speed: _Optional[int] = ..., neighbors: _Optional[_Iterable[_Union[MachineNic, _Mapping]]] = ..., hostname: _Optional[str] = ...) -> None: ... - -class MachineBlockDevice(_message.Message): - __slots__ = ("name", "size") - NAME_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - name: str - size: int - def __init__(self, name: _Optional[str] = ..., size: _Optional[int] = ...) -> None: ... - -class MachineChassisIdentifyLEDState(_message.Message): - __slots__ = ("value", "description") - VALUE_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - value: str - description: str - def __init__(self, value: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... - -class MachineBMCReport(_message.Message): - __slots__ = ("bmc", "bios", "fru", "power_metric", "power_supplies", "led_state", "updated_at") - BMC_FIELD_NUMBER: _ClassVar[int] - BIOS_FIELD_NUMBER: _ClassVar[int] - FRU_FIELD_NUMBER: _ClassVar[int] - POWER_METRIC_FIELD_NUMBER: _ClassVar[int] - POWER_SUPPLIES_FIELD_NUMBER: _ClassVar[int] - LED_STATE_FIELD_NUMBER: _ClassVar[int] - UPDATED_AT_FIELD_NUMBER: _ClassVar[int] - bmc: MachineBMC - bios: MachineBios - fru: MachineFRU - power_metric: MachinePowerMetric - power_supplies: _containers.RepeatedCompositeFieldContainer[MachinePowerSupply] - led_state: MachineChassisIdentifyLEDState - updated_at: _timestamp_pb2.Timestamp - def __init__(self, bmc: _Optional[_Union[MachineBMC, _Mapping]] = ..., bios: _Optional[_Union[MachineBios, _Mapping]] = ..., fru: _Optional[_Union[MachineFRU, _Mapping]] = ..., power_metric: _Optional[_Union[MachinePowerMetric, _Mapping]] = ..., power_supplies: _Optional[_Iterable[_Union[MachinePowerSupply, _Mapping]]] = ..., led_state: _Optional[_Union[MachineChassisIdentifyLEDState, _Mapping]] = ..., updated_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class MachineBios(_message.Message): - __slots__ = ("version", "vendor", "date") - VERSION_FIELD_NUMBER: _ClassVar[int] - VENDOR_FIELD_NUMBER: _ClassVar[int] - DATE_FIELD_NUMBER: _ClassVar[int] - version: str - vendor: str - date: str - def __init__(self, version: _Optional[str] = ..., vendor: _Optional[str] = ..., date: _Optional[str] = ...) -> None: ... - -class MachineBMC(_message.Message): - __slots__ = ("address", "mac", "user", "password", "interface", "version", "power_state") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - MAC_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - PASSWORD_FIELD_NUMBER: _ClassVar[int] - INTERFACE_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - POWER_STATE_FIELD_NUMBER: _ClassVar[int] - address: str - mac: str - user: str - password: str - interface: str - version: str - power_state: str - def __init__(self, address: _Optional[str] = ..., mac: _Optional[str] = ..., user: _Optional[str] = ..., password: _Optional[str] = ..., interface: _Optional[str] = ..., version: _Optional[str] = ..., power_state: _Optional[str] = ...) -> None: ... - -class MachineFRU(_message.Message): - __slots__ = ("chassis_part_number", "chassis_part_serial", "board_mfg", "board_mfg_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial") - CHASSIS_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - CHASSIS_PART_SERIAL_FIELD_NUMBER: _ClassVar[int] - BOARD_MFG_FIELD_NUMBER: _ClassVar[int] - BOARD_MFG_SERIAL_FIELD_NUMBER: _ClassVar[int] - BOARD_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_MANUFACTURER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_SERIAL_FIELD_NUMBER: _ClassVar[int] - chassis_part_number: str - chassis_part_serial: str - board_mfg: str - board_mfg_serial: str - board_part_number: str - product_manufacturer: str - product_part_number: str - product_serial: str - def __init__(self, chassis_part_number: _Optional[str] = ..., chassis_part_serial: _Optional[str] = ..., board_mfg: _Optional[str] = ..., board_mfg_serial: _Optional[str] = ..., board_part_number: _Optional[str] = ..., product_manufacturer: _Optional[str] = ..., product_part_number: _Optional[str] = ..., product_serial: _Optional[str] = ...) -> None: ... - -class MachinePowerMetric(_message.Message): - __slots__ = ("average_consumed_watts", "interval_in_min", "max_consumed_watts", "min_consumed_watts") - AVERAGE_CONSUMED_WATTS_FIELD_NUMBER: _ClassVar[int] - INTERVAL_IN_MIN_FIELD_NUMBER: _ClassVar[int] - MAX_CONSUMED_WATTS_FIELD_NUMBER: _ClassVar[int] - MIN_CONSUMED_WATTS_FIELD_NUMBER: _ClassVar[int] - average_consumed_watts: float - interval_in_min: float - max_consumed_watts: float - min_consumed_watts: float - def __init__(self, average_consumed_watts: _Optional[float] = ..., interval_in_min: _Optional[float] = ..., max_consumed_watts: _Optional[float] = ..., min_consumed_watts: _Optional[float] = ...) -> None: ... - -class MachinePowerSupply(_message.Message): - __slots__ = ("health", "state") - HEALTH_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - health: str - state: str - def __init__(self, health: _Optional[str] = ..., state: _Optional[str] = ...) -> None: ... - -class MachineRecentProvisioningEvents(_message.Message): - __slots__ = ("events", "last_event_time", "last_error_event", "state") - EVENTS_FIELD_NUMBER: _ClassVar[int] - LAST_EVENT_TIME_FIELD_NUMBER: _ClassVar[int] - LAST_ERROR_EVENT_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - events: _containers.RepeatedCompositeFieldContainer[MachineProvisioningEvent] - last_event_time: _timestamp_pb2.Timestamp - last_error_event: MachineProvisioningEvent - state: MachineProvisioningEventState - def __init__(self, events: _Optional[_Iterable[_Union[MachineProvisioningEvent, _Mapping]]] = ..., last_event_time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., last_error_event: _Optional[_Union[MachineProvisioningEvent, _Mapping]] = ..., state: _Optional[_Union[MachineProvisioningEventState, str]] = ...) -> None: ... - -class MachineProvisioningEvent(_message.Message): - __slots__ = ("time", "event", "message") - TIME_FIELD_NUMBER: _ClassVar[int] - EVENT_FIELD_NUMBER: _ClassVar[int] - MESSAGE_FIELD_NUMBER: _ClassVar[int] - time: _timestamp_pb2.Timestamp - event: MachineProvisioningEventType - message: str - def __init__(self, time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., event: _Optional[_Union[MachineProvisioningEventType, str]] = ..., message: _Optional[str] = ...) -> None: ... - -class MachineVPN(_message.Message): - __slots__ = ("control_plane_address", "auth_key", "connected", "ips") - CONTROL_PLANE_ADDRESS_FIELD_NUMBER: _ClassVar[int] - AUTH_KEY_FIELD_NUMBER: _ClassVar[int] - CONNECTED_FIELD_NUMBER: _ClassVar[int] - IPS_FIELD_NUMBER: _ClassVar[int] - control_plane_address: str - auth_key: str - connected: bool - ips: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, control_plane_address: _Optional[str] = ..., auth_key: _Optional[str] = ..., connected: _Optional[bool] = ..., ips: _Optional[_Iterable[str]] = ...) -> None: ... - -class MachineQuery(_message.Message): - __slots__ = ("uuid", "name", "partition", "size", "rack", "room", "labels", "allocation", "network", "nic", "disk", "bmc", "fru", "hardware", "state", "waiting", "preallocated", "not_allocated") - UUID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - RACK_FIELD_NUMBER: _ClassVar[int] - ROOM_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - ALLOCATION_FIELD_NUMBER: _ClassVar[int] - NETWORK_FIELD_NUMBER: _ClassVar[int] - NIC_FIELD_NUMBER: _ClassVar[int] - DISK_FIELD_NUMBER: _ClassVar[int] - BMC_FIELD_NUMBER: _ClassVar[int] - FRU_FIELD_NUMBER: _ClassVar[int] - HARDWARE_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - WAITING_FIELD_NUMBER: _ClassVar[int] - PREALLOCATED_FIELD_NUMBER: _ClassVar[int] - NOT_ALLOCATED_FIELD_NUMBER: _ClassVar[int] - uuid: str - name: str - partition: str - size: str - rack: str - room: str - labels: _common_pb2.Labels - allocation: MachineAllocationQuery - network: MachineNetworkQuery - nic: MachineNicQuery - disk: MachineDiskQuery - bmc: MachineBMCQuery - fru: MachineFRUQuery - hardware: MachineHardwareQuery - state: MachineState - waiting: bool - preallocated: bool - not_allocated: bool - def __init__(self, uuid: _Optional[str] = ..., name: _Optional[str] = ..., partition: _Optional[str] = ..., size: _Optional[str] = ..., rack: _Optional[str] = ..., room: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., allocation: _Optional[_Union[MachineAllocationQuery, _Mapping]] = ..., network: _Optional[_Union[MachineNetworkQuery, _Mapping]] = ..., nic: _Optional[_Union[MachineNicQuery, _Mapping]] = ..., disk: _Optional[_Union[MachineDiskQuery, _Mapping]] = ..., bmc: _Optional[_Union[MachineBMCQuery, _Mapping]] = ..., fru: _Optional[_Union[MachineFRUQuery, _Mapping]] = ..., hardware: _Optional[_Union[MachineHardwareQuery, _Mapping]] = ..., state: _Optional[_Union[MachineState, str]] = ..., waiting: _Optional[bool] = ..., preallocated: _Optional[bool] = ..., not_allocated: _Optional[bool] = ...) -> None: ... - -class MachineAllocationQuery(_message.Message): - __slots__ = ("uuid", "name", "project", "image", "filesystem_layout", "hostname", "allocation_type", "labels", "vpn") - UUID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - IMAGE_FIELD_NUMBER: _ClassVar[int] - FILESYSTEM_LAYOUT_FIELD_NUMBER: _ClassVar[int] - HOSTNAME_FIELD_NUMBER: _ClassVar[int] - ALLOCATION_TYPE_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - VPN_FIELD_NUMBER: _ClassVar[int] - uuid: str - name: str - project: str - image: str - filesystem_layout: str - hostname: str - allocation_type: MachineAllocationType - labels: _common_pb2.Labels - vpn: MachineVPN - def __init__(self, uuid: _Optional[str] = ..., name: _Optional[str] = ..., project: _Optional[str] = ..., image: _Optional[str] = ..., filesystem_layout: _Optional[str] = ..., hostname: _Optional[str] = ..., allocation_type: _Optional[_Union[MachineAllocationType, str]] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., vpn: _Optional[_Union[MachineVPN, _Mapping]] = ...) -> None: ... - -class MachineNetworkQuery(_message.Message): - __slots__ = ("networks", "prefixes", "destination_prefixes", "ips", "vrfs", "asns") - NETWORKS_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - IPS_FIELD_NUMBER: _ClassVar[int] - VRFS_FIELD_NUMBER: _ClassVar[int] - ASNS_FIELD_NUMBER: _ClassVar[int] - networks: _containers.RepeatedScalarFieldContainer[str] - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - ips: _containers.RepeatedScalarFieldContainer[str] - vrfs: _containers.RepeatedScalarFieldContainer[int] - asns: _containers.RepeatedScalarFieldContainer[int] - def __init__(self, networks: _Optional[_Iterable[str]] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., ips: _Optional[_Iterable[str]] = ..., vrfs: _Optional[_Iterable[int]] = ..., asns: _Optional[_Iterable[int]] = ...) -> None: ... - -class MachineNicQuery(_message.Message): - __slots__ = ("macs", "names", "neighbor_macs", "neighbor_names") - MACS_FIELD_NUMBER: _ClassVar[int] - NAMES_FIELD_NUMBER: _ClassVar[int] - NEIGHBOR_MACS_FIELD_NUMBER: _ClassVar[int] - NEIGHBOR_NAMES_FIELD_NUMBER: _ClassVar[int] - macs: _containers.RepeatedScalarFieldContainer[str] - names: _containers.RepeatedScalarFieldContainer[str] - neighbor_macs: _containers.RepeatedScalarFieldContainer[str] - neighbor_names: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, macs: _Optional[_Iterable[str]] = ..., names: _Optional[_Iterable[str]] = ..., neighbor_macs: _Optional[_Iterable[str]] = ..., neighbor_names: _Optional[_Iterable[str]] = ...) -> None: ... - -class MachineDiskQuery(_message.Message): - __slots__ = ("names", "sizes") - NAMES_FIELD_NUMBER: _ClassVar[int] - SIZES_FIELD_NUMBER: _ClassVar[int] - names: _containers.RepeatedScalarFieldContainer[str] - sizes: _containers.RepeatedScalarFieldContainer[int] - def __init__(self, names: _Optional[_Iterable[str]] = ..., sizes: _Optional[_Iterable[int]] = ...) -> None: ... - -class MachineBMCQuery(_message.Message): - __slots__ = ("address", "mac", "user", "interface") - ADDRESS_FIELD_NUMBER: _ClassVar[int] - MAC_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - INTERFACE_FIELD_NUMBER: _ClassVar[int] - address: str - mac: str - user: str - interface: str - def __init__(self, address: _Optional[str] = ..., mac: _Optional[str] = ..., user: _Optional[str] = ..., interface: _Optional[str] = ...) -> None: ... - -class MachineFRUQuery(_message.Message): - __slots__ = ("chassis_part_number", "chassis_part_serial", "board_mfg", "board_serial", "board_part_number", "product_manufacturer", "product_part_number", "product_serial") - CHASSIS_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - CHASSIS_PART_SERIAL_FIELD_NUMBER: _ClassVar[int] - BOARD_MFG_FIELD_NUMBER: _ClassVar[int] - BOARD_SERIAL_FIELD_NUMBER: _ClassVar[int] - BOARD_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_MANUFACTURER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_PART_NUMBER_FIELD_NUMBER: _ClassVar[int] - PRODUCT_SERIAL_FIELD_NUMBER: _ClassVar[int] - chassis_part_number: str - chassis_part_serial: str - board_mfg: str - board_serial: str - board_part_number: str - product_manufacturer: str - product_part_number: str - product_serial: str - def __init__(self, chassis_part_number: _Optional[str] = ..., chassis_part_serial: _Optional[str] = ..., board_mfg: _Optional[str] = ..., board_serial: _Optional[str] = ..., board_part_number: _Optional[str] = ..., product_manufacturer: _Optional[str] = ..., product_part_number: _Optional[str] = ..., product_serial: _Optional[str] = ...) -> None: ... - -class MachineHardwareQuery(_message.Message): - __slots__ = ("memory", "cpu_cores") - MEMORY_FIELD_NUMBER: _ClassVar[int] - CPU_CORES_FIELD_NUMBER: _ClassVar[int] - memory: int - cpu_cores: int - def __init__(self, memory: _Optional[int] = ..., cpu_cores: _Optional[int] = ...) -> None: ... - -class MachineIssuesQuery(_message.Message): - __slots__ = ("machine_query", "only", "omit", "severity", "last_error_threshold") - MACHINE_QUERY_FIELD_NUMBER: _ClassVar[int] - ONLY_FIELD_NUMBER: _ClassVar[int] - OMIT_FIELD_NUMBER: _ClassVar[int] - SEVERITY_FIELD_NUMBER: _ClassVar[int] - LAST_ERROR_THRESHOLD_FIELD_NUMBER: _ClassVar[int] - machine_query: MachineQuery - only: _containers.RepeatedScalarFieldContainer[MachineIssueType] - omit: _containers.RepeatedScalarFieldContainer[MachineIssueType] - severity: MachineIssueSeverity - last_error_threshold: _duration_pb2.Duration - def __init__(self, machine_query: _Optional[_Union[MachineQuery, _Mapping]] = ..., only: _Optional[_Iterable[_Union[MachineIssueType, str]]] = ..., omit: _Optional[_Iterable[_Union[MachineIssueType, str]]] = ..., severity: _Optional[_Union[MachineIssueSeverity, str]] = ..., last_error_threshold: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ...) -> None: ... - -class MachineIssues(_message.Message): - __slots__ = ("uuid", "issues") - UUID_FIELD_NUMBER: _ClassVar[int] - ISSUES_FIELD_NUMBER: _ClassVar[int] - uuid: str - issues: _containers.RepeatedCompositeFieldContainer[MachineIssue] - def __init__(self, uuid: _Optional[str] = ..., issues: _Optional[_Iterable[_Union[MachineIssue, _Mapping]]] = ...) -> None: ... - -class MachineIssue(_message.Message): - __slots__ = ("type", "severity", "description", "reference_url", "details") - TYPE_FIELD_NUMBER: _ClassVar[int] - SEVERITY_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - REFERENCE_URL_FIELD_NUMBER: _ClassVar[int] - DETAILS_FIELD_NUMBER: _ClassVar[int] - type: MachineIssueType - severity: MachineIssueSeverity - description: str - reference_url: str - details: str - def __init__(self, type: _Optional[_Union[MachineIssueType, str]] = ..., severity: _Optional[_Union[MachineIssueSeverity, str]] = ..., description: _Optional[str] = ..., reference_url: _Optional[str] = ..., details: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/api/v2/method_connect.py b/python/metalstack/api/v2/method_connect.py index d0ac8fb9..ef93d257 100644 --- a/python/metalstack/api/v2/method_connect.py +++ b/python/metalstack/api/v2/method_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/method.proto +# Generated from metalstack/api/v2/method.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.method_pb2 as metalstack_dot_api_dot_v2_dot_method__pb2 + +from .method_pb import MethodServiceListRequest, MethodServiceListResponse, MethodServiceTokenScopedListRequest, MethodServiceTokenScopedListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class MethodService(Protocol): - async def list(self, request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: MethodServiceListRequest, ctx: RequestContext[MethodServiceListRequest, MethodServiceListResponse]) -> MethodServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def token_scoped_list(self, request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def token_scoped_list(self, request: MethodServiceTokenScopedListRequest, ctx: RequestContext[MethodServiceTokenScopedListRequest, MethodServiceTokenScopedListResponse]) -> MethodServiceTokenScopedListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MethodServiceASGIApplication(ConnectASGIApplication[MethodService]): - def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MethodService | AsyncGenerator[MethodService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, in method=MethodInfo( name="List", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse, + input=MethodServiceListRequest, + output=MethodServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -44,8 +60,8 @@ def __init__(self, service: MethodService | AsyncGenerator[MethodService], *, in method=MethodInfo( name="TokenScopedList", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse, + input=MethodServiceTokenScopedListRequest, + output=MethodServiceTokenScopedListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.token_scoped_list, @@ -66,18 +82,18 @@ def path(self) -> str: class MethodServiceClient(ConnectClient): async def list( self, - request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, + request: MethodServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse: + ) -> MethodServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse, + input=MethodServiceListRequest, + output=MethodServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def list( async def token_scoped_list( self, - request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, + request: MethodServiceTokenScopedListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse: + ) -> MethodServiceTokenScopedListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="TokenScopedList", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse, + input=MethodServiceTokenScopedListRequest, + output=MethodServiceTokenScopedListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class MethodServiceSync(Protocol): - def list(self, request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def token_scoped_list(self, request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def list(self, request: MethodServiceListRequest, ctx: RequestContext[MethodServiceListRequest, MethodServiceListResponse]) -> MethodServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def token_scoped_list(self, request: MethodServiceTokenScopedListRequest, ctx: RequestContext[MethodServiceTokenScopedListRequest, MethodServiceTokenScopedListResponse]) -> MethodServiceTokenScopedListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class MethodServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: MethodServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: MethodServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.MethodService/List": EndpointSync.unary( method=MethodInfo( name="List", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse, + input=MethodServiceListRequest, + output=MethodServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -133,8 +153,8 @@ def __init__(self, service: MethodServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="TokenScopedList", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse, + input=MethodServiceTokenScopedListRequest, + output=MethodServiceTokenScopedListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.token_scoped_list, @@ -155,42 +175,39 @@ def path(self) -> str: class MethodServiceClientSync(ConnectClientSync): def list( self, - request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, + request: MethodServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse: + ) -> MethodServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceListResponse, + input=MethodServiceListRequest, + output=MethodServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def token_scoped_list( self, - request: metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, + request: MethodServiceTokenScopedListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse: + ) -> MethodServiceTokenScopedListResponse: return self.execute_unary( request=request, method=MethodInfo( name="TokenScopedList", service_name="metalstack.api.v2.MethodService", - input=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListRequest, - output=metalstack_dot_api_dot_v2_dot_method__pb2.MethodServiceTokenScopedListResponse, + input=MethodServiceTokenScopedListRequest, + output=MethodServiceTokenScopedListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/method_pb.py b/python/metalstack/api/v2/method_pb.py new file mode 100644 index 00000000..bf7c343e --- /dev/null +++ b/python/metalstack/api/v2/method_pb.py @@ -0,0 +1,187 @@ +# Generated from metalstack/api/v2/method.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, token_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import AdminRole, InfraRole, MachineRole, ProjectRole, TenantRole + from .token_pb import MethodPermission + + +_MethodServiceListRequestFields: TypeAlias = NoReturn + +class MethodServiceListRequest(Message[_MethodServiceListRequestFields]): + """ + MethodServiceListRequest is the request payload for listing all public methods. + + ```proto + message metalstack.api.v2.MethodServiceListRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_MethodServiceListResponseFields: TypeAlias = Literal["methods"] + +class MethodServiceListResponse(Message[_MethodServiceListResponseFields]): + """ + MethodServiceListResponse is the response payload for listing all public methods. + + ```proto + message metalstack.api.v2.MethodServiceListResponse + ``` + + Attributes: + methods: + Methods is a list of methods public callable + + ```proto + repeated string methods = 1; + ``` + """ + + __slots__ = ("methods",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + methods: list[str] | None = None, + ) -> None: + pass + + methods: list[str] + +_MethodServiceTokenScopedListRequestFields: TypeAlias = NoReturn + +class MethodServiceTokenScopedListRequest(Message[_MethodServiceTokenScopedListRequestFields]): + """ + MethodServiceTokenScopedListRequest is the request payload for listing all methods callable with the token present in the request. + + ```proto + message metalstack.api.v2.MethodServiceTokenScopedListRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_MethodServiceTokenScopedListResponseFields: TypeAlias = Literal["permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles"] + +class MethodServiceTokenScopedListResponse(Message[_MethodServiceTokenScopedListResponseFields]): + """ + MethodServiceTokenScopedListResponse is the response payload which contains all methods which are callable with the given token. + + ```proto + message metalstack.api.v2.MethodServiceTokenScopedListResponse + ``` + + Attributes: + permissions: + Permissions contains a list of methods which can be called + + ```proto + repeated metalstack.api.v2.MethodPermission permissions = 1; + ``` + project_roles: + ProjectRoles associates a project ID with the corresponding role of the token owner + + ```proto + map project_roles = 2; + ``` + tenant_roles: + TenantRoles associates a tenant ID with the corresponding role of the token owner + + ```proto + map tenant_roles = 3; + ``` + admin_role: + AdminRole defines the admin role of the token owner + + ```proto + optional metalstack.api.v2.AdminRole admin_role = 4; + ``` + infra_role: + InfraRole defines the infrastructure role of the token owner + + ```proto + optional metalstack.api.v2.InfraRole infra_role = 5; + ``` + machine_roles: + MachineRoles defines the machine roles of the token owner + + ```proto + map machine_roles = 6; + ``` + """ + + __slots__ = ("permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles") + + if TYPE_CHECKING: + + def __init__( + self, + *, + permissions: list[MethodPermission] | None = None, + project_roles: dict[str, ProjectRole] | None = None, + tenant_roles: dict[str, TenantRole] | None = None, + admin_role: AdminRole | None = None, + infra_role: InfraRole | None = None, + machine_roles: dict[str, MachineRole] | None = None, + ) -> None: + pass + + permissions: list[MethodPermission] + project_roles: dict[str, ProjectRole] + tenant_roles: dict[str, TenantRole] + admin_role: AdminRole + infra_role: InfraRole + machine_roles: dict[str, MachineRole] + + +_DESC = file_desc( + b'\n\x1emetalstack/api/v2/method.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1dmetalstack/api/v2/token.proto"\x1a\n\x18MethodServiceListRequest"5\n\x19MethodServiceListResponse\x12\x18\n\x07methods\x18\x01 \x03(\tR\x07methods"%\n#MethodServiceTokenScopedListRequest"\x91\x07\n$MethodServiceTokenScopedListResponse\x12E\n\x0bpermissions\x18\x01 \x03(\x0b2#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12n\n\rproject_roles\x18\x02 \x03(\x0b2I.metalstack.api.v2.MethodServiceTokenScopedListResponse.ProjectRolesEntryR\x0cprojectRoles\x12k\n\x0ctenant_roles\x18\x03 \x03(\x0b2H.metalstack.api.v2.MethodServiceTokenScopedListResponse.TenantRolesEntryR\x0btenantRoles\x12J\n\nadmin_role\x18\x04 \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleH\x00R\tadminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12J\n\ninfra_role\x18\x05 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleH\x01R\tinfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12n\n\rmachine_roles\x18\x06 \x03(\x0b2I.metalstack.api.v2.MethodServiceTokenScopedListResponse.MachineRolesEntryR\x0cmachineRoles\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x123\n\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01B\r\n\x0b_admin_roleB\r\n\x0b_infra_role2\x8b\x02\n\rMethodService\x12k\n\x04List\x12+.metalstack.api.v2.MethodServiceListRequest\x1a,.metalstack.api.v2.MethodServiceListResponse"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x01\x12\x8c\x01\n\x0fTokenScopedList\x126.metalstack.api.v2.MethodServiceTokenScopedListRequest\x1a7.metalstack.api.v2.MethodServiceTokenScopedListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01B\xc1\x01\n\x15com.metalstack.api.v2B\x0bMethodProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + token_pb.desc(), + ], + { + "MethodServiceListRequest": MethodServiceListRequest, + "MethodServiceListResponse": MethodServiceListResponse, + "MethodServiceTokenScopedListRequest": MethodServiceTokenScopedListRequest, + "MethodServiceTokenScopedListResponse": MethodServiceTokenScopedListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/method.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/method_pb2.py b/python/metalstack/api/v2/method_pb2.py deleted file mode 100644 index 525a76e7..00000000 --- a/python/metalstack/api/v2/method_pb2.py +++ /dev/null @@ -1,68 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/method.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/method.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import token_pb2 as metalstack_dot_api_dot_v2_dot_token__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/method.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1dmetalstack/api/v2/token.proto\"\x1a\n\x18MethodServiceListRequest\"5\n\x19MethodServiceListResponse\x12\x18\n\x07methods\x18\x01 \x03(\tR\x07methods\"%\n#MethodServiceTokenScopedListRequest\"\x91\x07\n$MethodServiceTokenScopedListResponse\x12\x45\n\x0bpermissions\x18\x01 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12n\n\rproject_roles\x18\x02 \x03(\x0b\x32I.metalstack.api.v2.MethodServiceTokenScopedListResponse.ProjectRolesEntryR\x0cprojectRoles\x12k\n\x0ctenant_roles\x18\x03 \x03(\x0b\x32H.metalstack.api.v2.MethodServiceTokenScopedListResponse.TenantRolesEntryR\x0btenantRoles\x12J\n\nadmin_role\x18\x04 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x12J\n\ninfra_role\x18\x05 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tinfraRole\x88\x01\x01\x12n\n\rmachine_roles\x18\x06 \x03(\x0b\x32I.metalstack.api.v2.MethodServiceTokenScopedListResponse.MachineRolesEntryR\x0cmachineRoles\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_roleB\r\n\x0b_infra_role2\x8b\x02\n\rMethodService\x12k\n\x04List\x12+.metalstack.api.v2.MethodServiceListRequest\x1a,.metalstack.api.v2.MethodServiceListResponse\"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x01\x12\x8c\x01\n\x0fTokenScopedList\x12\x36.metalstack.api.v2.MethodServiceTokenScopedListRequest\x1a\x37.metalstack.api.v2.MethodServiceTokenScopedListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x42\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0bMethodProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.method_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013MethodProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_PROJECTROLESENTRY']._loaded_options = None - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_PROJECTROLESENTRY']._serialized_options = b'8\001' - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_TENANTROLESENTRY']._loaded_options = None - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_TENANTROLESENTRY']._serialized_options = b'8\001' - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_MACHINEROLESENTRY']._loaded_options = None - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_MACHINEROLESENTRY']._serialized_options = b'8\001' - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE'].fields_by_name['admin_role']._loaded_options = None - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE'].fields_by_name['infra_role']._loaded_options = None - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE'].fields_by_name['infra_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_METHODSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_METHODSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\001\340\363\030\001' - _globals['_METHODSERVICE'].methods_by_name['TokenScopedList']._loaded_options = None - _globals['_METHODSERVICE'].methods_by_name['TokenScopedList']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_METHODSERVICELISTREQUEST']._serialized_start=145 - _globals['_METHODSERVICELISTREQUEST']._serialized_end=171 - _globals['_METHODSERVICELISTRESPONSE']._serialized_start=173 - _globals['_METHODSERVICELISTRESPONSE']._serialized_end=226 - _globals['_METHODSERVICETOKENSCOPEDLISTREQUEST']._serialized_start=228 - _globals['_METHODSERVICETOKENSCOPEDLISTREQUEST']._serialized_end=265 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE']._serialized_start=268 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE']._serialized_end=1181 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_PROJECTROLESENTRY']._serialized_start=864 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_PROJECTROLESENTRY']._serialized_end=959 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_TENANTROLESENTRY']._serialized_start=961 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_TENANTROLESENTRY']._serialized_end=1054 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_MACHINEROLESENTRY']._serialized_start=1056 - _globals['_METHODSERVICETOKENSCOPEDLISTRESPONSE_MACHINEROLESENTRY']._serialized_end=1151 - _globals['_METHODSERVICE']._serialized_start=1184 - _globals['_METHODSERVICE']._serialized_end=1451 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/method_pb2.pyi b/python/metalstack/api/v2/method_pb2.pyi deleted file mode 100644 index 2263889a..00000000 --- a/python/metalstack/api/v2/method_pb2.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import token_pb2 as _token_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class MethodServiceListRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class MethodServiceListResponse(_message.Message): - __slots__ = ("methods",) - METHODS_FIELD_NUMBER: _ClassVar[int] - methods: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, methods: _Optional[_Iterable[str]] = ...) -> None: ... - -class MethodServiceTokenScopedListRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class MethodServiceTokenScopedListResponse(_message.Message): - __slots__ = ("permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles") - class ProjectRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.ProjectRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - class TenantRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.TenantRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - class MachineRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.MachineRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... - PERMISSIONS_FIELD_NUMBER: _ClassVar[int] - PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] - TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] - ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] - INFRA_ROLE_FIELD_NUMBER: _ClassVar[int] - MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] - permissions: _containers.RepeatedCompositeFieldContainer[_token_pb2.MethodPermission] - project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] - tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] - admin_role: _common_pb2.AdminRole - infra_role: _common_pb2.InfraRole - machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] - def __init__(self, permissions: _Optional[_Iterable[_Union[_token_pb2.MethodPermission, _Mapping]]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ..., infra_role: _Optional[_Union[_common_pb2.InfraRole, str]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/network_connect.py b/python/metalstack/api/v2/network_connect.py index e733d947..bdc58150 100644 --- a/python/metalstack/api/v2/network_connect.py +++ b/python/metalstack/api/v2/network_connect.py @@ -1,44 +1,60 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/network.proto +# Generated from metalstack/api/v2/network.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.network_pb2 as metalstack_dot_api_dot_v2_dot_network__pb2 + +from .network_pb import NetworkServiceCreateRequest, NetworkServiceCreateResponse, NetworkServiceDeleteRequest, NetworkServiceDeleteResponse, NetworkServiceGetRequest, NetworkServiceGetResponse, NetworkServiceListBaseNetworksRequest, NetworkServiceListBaseNetworksResponse, NetworkServiceListRequest, NetworkServiceListResponse, NetworkServiceUpdateRequest, NetworkServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class NetworkService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: NetworkServiceGetRequest, ctx: RequestContext[NetworkServiceGetRequest, NetworkServiceGetResponse]) -> NetworkServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: NetworkServiceCreateRequest, ctx: RequestContext[NetworkServiceCreateRequest, NetworkServiceCreateResponse]) -> NetworkServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: NetworkServiceUpdateRequest, ctx: RequestContext[NetworkServiceUpdateRequest, NetworkServiceUpdateResponse]) -> NetworkServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: NetworkServiceListRequest, ctx: RequestContext[NetworkServiceListRequest, NetworkServiceListResponse]) -> NetworkServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list_base_networks(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list_base_networks(self, request: NetworkServiceListBaseNetworksRequest, ctx: RequestContext[NetworkServiceListBaseNetworksRequest, NetworkServiceListBaseNetworksResponse]) -> NetworkServiceListBaseNetworksResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: NetworkServiceDeleteRequest, ctx: RequestContext[NetworkServiceDeleteRequest, NetworkServiceDeleteResponse]) -> NetworkServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class NetworkServiceASGIApplication(ConnectASGIApplication[NetworkService]): - def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: NetworkService | AsyncGenerator[NetworkService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -46,8 +62,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Get", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -56,8 +72,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Create", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -66,8 +82,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Update", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -76,8 +92,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="List", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -86,8 +102,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="ListBaseNetworks", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse, + input=NetworkServiceListBaseNetworksRequest, + output=NetworkServiceListBaseNetworksResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list_base_networks, @@ -96,8 +112,8 @@ def __init__(self, service: NetworkService | AsyncGenerator[NetworkService], *, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -118,18 +134,18 @@ def path(self) -> str: class NetworkServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, + request: NetworkServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse: + ) -> NetworkServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -138,18 +154,18 @@ async def get( async def create( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, + request: NetworkServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: + ) -> NetworkServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -158,18 +174,18 @@ async def create( async def update( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, + request: NetworkServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: + ) -> NetworkServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -178,18 +194,18 @@ async def update( async def list( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, + request: NetworkServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse: + ) -> NetworkServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -198,18 +214,18 @@ async def list( async def list_base_networks( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, + request: NetworkServiceListBaseNetworksRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse: + ) -> NetworkServiceListBaseNetworksResponse: return await self.execute_unary( request=request, method=MethodInfo( name="ListBaseNetworks", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse, + input=NetworkServiceListBaseNetworksRequest, + output=NetworkServiceListBaseNetworksResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -218,53 +234,61 @@ async def list_base_networks( async def delete( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, + request: NetworkServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: + ) -> NetworkServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class NetworkServiceSync(Protocol): + def get(self, request: NetworkServiceGetRequest, ctx: RequestContext[NetworkServiceGetRequest, NetworkServiceGetResponse]) -> NetworkServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def create(self, request: NetworkServiceCreateRequest, ctx: RequestContext[NetworkServiceCreateRequest, NetworkServiceCreateResponse]) -> NetworkServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: NetworkServiceUpdateRequest, ctx: RequestContext[NetworkServiceUpdateRequest, NetworkServiceUpdateResponse]) -> NetworkServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: NetworkServiceListRequest, ctx: RequestContext[NetworkServiceListRequest, NetworkServiceListResponse]) -> NetworkServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list_base_networks(self, request: NetworkServiceListBaseNetworksRequest, ctx: RequestContext[NetworkServiceListBaseNetworksRequest, NetworkServiceListBaseNetworksResponse]) -> NetworkServiceListBaseNetworksResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class NetworkServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list_base_networks(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def delete(self, request: NetworkServiceDeleteRequest, ctx: RequestContext[NetworkServiceDeleteRequest, NetworkServiceDeleteResponse]) -> NetworkServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class NetworkServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: NetworkServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: NetworkServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.NetworkService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -273,8 +297,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Create", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -283,8 +307,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Update", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -293,8 +317,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="List", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -303,8 +327,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="ListBaseNetworks", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse, + input=NetworkServiceListBaseNetworksRequest, + output=NetworkServiceListBaseNetworksResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list_base_networks, @@ -313,8 +337,8 @@ def __init__(self, service: NetworkServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Delete", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -335,122 +359,115 @@ def path(self) -> str: class NetworkServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, + request: NetworkServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse: + ) -> NetworkServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceGetResponse, + input=NetworkServiceGetRequest, + output=NetworkServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, + request: NetworkServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse: + ) -> NetworkServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceCreateResponse, + input=NetworkServiceCreateRequest, + output=NetworkServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, + request: NetworkServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse: + ) -> NetworkServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceUpdateResponse, + input=NetworkServiceUpdateRequest, + output=NetworkServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, + request: NetworkServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse: + ) -> NetworkServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListResponse, + input=NetworkServiceListRequest, + output=NetworkServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list_base_networks( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, + request: NetworkServiceListBaseNetworksRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse: + ) -> NetworkServiceListBaseNetworksResponse: return self.execute_unary( request=request, method=MethodInfo( name="ListBaseNetworks", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceListBaseNetworksResponse, + input=NetworkServiceListBaseNetworksRequest, + output=NetworkServiceListBaseNetworksResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, + request: NetworkServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse: + ) -> NetworkServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.NetworkService", - input=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_network__pb2.NetworkServiceDeleteResponse, + input=NetworkServiceDeleteRequest, + output=NetworkServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/network_pb.py b/python/metalstack/api/v2/network_pb.py new file mode 100644 index 00000000..2f2674b6 --- /dev/null +++ b/python/metalstack/api/v2/network_pb.py @@ -0,0 +1,1160 @@ +# Generated from metalstack/api/v2/network.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Labels, Meta, UpdateLabels, UpdateMeta + + +_NetworkServiceGetRequestFields: TypeAlias = Literal["id", "project"] + +class NetworkServiceGetRequest(Message[_NetworkServiceGetRequestFields]): + """ + NetworkServiceGetRequest + + ```proto + message metalstack.api.v2.NetworkServiceGetRequest + ``` + + Attributes: + id: + ID of the network to get + + ```proto + string id = 1; + ``` + project: + Project of the network + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("id", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + project: str = "", + ) -> None: + pass + + id: str + project: str + +_NetworkServiceGetResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceGetResponse(Message[_NetworkServiceGetResponseFields]): + """ + NetworkServiceGetResponse + + ```proto + message metalstack.api.v2.NetworkServiceGetResponse + ``` + + Attributes: + network: + Network which was requested to get + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceCreateRequestFields: TypeAlias = Literal["project", "name", "description", "partition", "labels", "parent_network", "length", "address_family"] + +class NetworkServiceCreateRequest(Message[_NetworkServiceCreateRequestFields]): + """ + NetworkServiceCreateRequest + + ```proto + message metalstack.api.v2.NetworkServiceCreateRequest + ``` + + Attributes: + project: + Project where this network belongs to + + ```proto + string project = 1; + ``` + name: + Name of this network + + ```proto + optional string name = 2; + ``` + description: + Description of this network + + ```proto + optional string description = 3; + ``` + partition: + Partition where this network will be created + + ```proto + optional string partition = 4; + ``` + labels: + Labels on this network + + ```proto + optional metalstack.api.v2.Labels labels = 5; + ``` + parent_network: + Parent Network points to the id of the parent network if any + + ```proto + optional string parent_network = 6; + ``` + length: + Length per addressfamily + + ```proto + optional metalstack.api.v2.ChildPrefixLength length = 7; + ``` + address_family: + AddressFamily to create, defaults to the same as the parent + + ```proto + optional metalstack.api.v2.NetworkAddressFamily address_family = 8; + ``` + """ + + __slots__ = ("project", "name", "description", "partition", "labels", "parent_network", "length", "address_family") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + name: str | None = None, + description: str | None = None, + partition: str | None = None, + labels: Labels | None = None, + parent_network: str | None = None, + length: ChildPrefixLength | None = None, + address_family: NetworkAddressFamily | None = None, + ) -> None: + pass + + project: str + name: str + description: str + partition: str + labels: Labels | None + parent_network: str + length: ChildPrefixLength | None + address_family: NetworkAddressFamily + +_NetworkServiceCreateResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceCreateResponse(Message[_NetworkServiceCreateResponseFields]): + """ + NetworkServiceCreateResponse + + ```proto + message metalstack.api.v2.NetworkServiceCreateResponse + ``` + + Attributes: + network: + Network is the created network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceUpdateRequestFields: TypeAlias = Literal["id", "update_meta", "project", "name", "description", "labels"] + +class NetworkServiceUpdateRequest(Message[_NetworkServiceUpdateRequestFields]): + """ + NetworkServiceUpdateRequest + + ```proto + message metalstack.api.v2.NetworkServiceUpdateRequest + ``` + + Attributes: + id: + ID of the network to get + + ```proto + string id = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + project: + Project of the network + + ```proto + string project = 3; + ``` + name: + Name of this network + + ```proto + optional string name = 4; + ``` + description: + Description of this network + + ```proto + optional string description = 5; + ``` + labels: + Labels on this network + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 6; + ``` + """ + + __slots__ = ("id", "update_meta", "project", "name", "description", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + update_meta: UpdateMeta | None = None, + project: str = "", + name: str | None = None, + description: str | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + id: str + update_meta: UpdateMeta | None + project: str + name: str + description: str + labels: UpdateLabels | None + +_NetworkServiceUpdateResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceUpdateResponse(Message[_NetworkServiceUpdateResponseFields]): + """ + NetworkServiceUpdateResponse + + ```proto + message metalstack.api.v2.NetworkServiceUpdateResponse + ``` + + Attributes: + network: + Network is the updated network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkServiceListRequestFields: TypeAlias = Literal["project", "query"] + +class NetworkServiceListRequest(Message[_NetworkServiceListRequestFields]): + """ + NetworkServiceListRequest + + ```proto + message metalstack.api.v2.NetworkServiceListRequest + ``` + + Attributes: + project: + Project of the networks to list + + ```proto + string project = 1; + ``` + query: + Query which specifies which networks to return + + ```proto + optional metalstack.api.v2.NetworkQuery query = 2; + ``` + """ + + __slots__ = ("project", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + query: NetworkQuery | None = None, + ) -> None: + pass + + project: str + query: NetworkQuery | None + +_NetworkServiceListResponseFields: TypeAlias = Literal["networks"] + +class NetworkServiceListResponse(Message[_NetworkServiceListResponseFields]): + """ + NetworkServiceListResponse + + ```proto + message metalstack.api.v2.NetworkServiceListResponse + ``` + + Attributes: + networks: + Networks are the requested networks + + ```proto + repeated metalstack.api.v2.Network networks = 1; + ``` + """ + + __slots__ = ("networks",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + networks: list[Network] | None = None, + ) -> None: + pass + + networks: list[Network] + +_NetworkServiceListBaseNetworksRequestFields: TypeAlias = Literal["project", "query"] + +class NetworkServiceListBaseNetworksRequest(Message[_NetworkServiceListBaseNetworksRequestFields]): + """ + NetworkServiceListRequest + + ```proto + message metalstack.api.v2.NetworkServiceListBaseNetworksRequest + ``` + + Attributes: + project: + Project of the base networks to list + + ```proto + string project = 1; + ``` + query: + Query which specifies which networks to return + + ```proto + optional metalstack.api.v2.NetworkQuery query = 2; + ``` + """ + + __slots__ = ("project", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + query: NetworkQuery | None = None, + ) -> None: + pass + + project: str + query: NetworkQuery | None + +_NetworkServiceListBaseNetworksResponseFields: TypeAlias = Literal["networks"] + +class NetworkServiceListBaseNetworksResponse(Message[_NetworkServiceListBaseNetworksResponseFields]): + """ + NetworkServiceListResponse + + ```proto + message metalstack.api.v2.NetworkServiceListBaseNetworksResponse + ``` + + Attributes: + networks: + Networks are the requested networks + + ```proto + repeated metalstack.api.v2.Network networks = 1; + ``` + """ + + __slots__ = ("networks",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + networks: list[Network] | None = None, + ) -> None: + pass + + networks: list[Network] + +_NetworkServiceDeleteRequestFields: TypeAlias = Literal["id", "project"] + +class NetworkServiceDeleteRequest(Message[_NetworkServiceDeleteRequestFields]): + """ + NetworkServiceDeleteRequest + + ```proto + message metalstack.api.v2.NetworkServiceDeleteRequest + ``` + + Attributes: + id: + ID of the network to get + + ```proto + string id = 1; + ``` + project: + Project of the network + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("id", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + project: str = "", + ) -> None: + pass + + id: str + project: str + +_NetworkServiceDeleteResponseFields: TypeAlias = Literal["network"] + +class NetworkServiceDeleteResponse(Message[_NetworkServiceDeleteResponseFields]): + """ + NetworkServiceDeleteResponse + + ```proto + message metalstack.api.v2.NetworkServiceDeleteResponse + ``` + + Attributes: + network: + Network is the deleted network + + ```proto + optional metalstack.api.v2.Network network = 1; + ``` + """ + + __slots__ = ("network",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + network: Network | None = None, + ) -> None: + pass + + network: Network | None + +_NetworkFields: TypeAlias = Literal["id", "meta", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "type", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "consumption"] + +class Network(Message[_NetworkFields]): + """ + Network + + ```proto + message metalstack.api.v2.Network + ``` + + Attributes: + id: + Id of this network + + ```proto + string id = 1; + ``` + meta: + Meta for this network + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this network + + ```proto + optional string name = 3; + ``` + description: + Description of this network + + ```proto + optional string description = 4; + ``` + partition: + Partition where this network will be created + + ```proto + optional string partition = 5; + ``` + project: + Project where this network belongs to + + ```proto + optional string project = 6; + ``` + namespace: + Namespace if specified, this network is namespaced and can therefore overlap with others + Will be equal with project most of the time + + ```proto + optional string namespace = 7; + ``` + prefixes: + Prefixes in this network + + ```proto + repeated string prefixes = 8; + ``` + destination_prefixes: + Destination Prefixes in this network + + ```proto + repeated string destination_prefixes = 9; + ``` + default_child_prefix_length: + Default Child Prefix length defines the bit length of a child network created per address family, if not specified during the allocate request + + ```proto + optional metalstack.api.v2.ChildPrefixLength default_child_prefix_length = 10; + ``` + min_child_prefix_length: + Min Child Prefix length asserts that during child network creation the requested bit length is greater or equal the min child prefix length + + ```proto + optional metalstack.api.v2.ChildPrefixLength min_child_prefix_length = 11; + ``` + type: + Type of the network + + ```proto + metalstack.api.v2.NetworkType type = 12; + ``` + nat_type: + NATType of this network + + ```proto + metalstack.api.v2.NATType nat_type = 13; + ``` + vrf: + VRF of this network has this VNI. + + ```proto + optional uint32 vrf = 14; + ``` + parent_network: + Parent Network points to the id of the parent network if any + + ```proto + optional string parent_network = 15; + ``` + additional_announcable_cidrs: + AdditionalAnnouncableCidrs will be added to the allow list on the switch which prefixes might be announced + + ```proto + repeated string additional_announcable_cidrs = 16; + ``` + consumption: + Consumption of IPs and prefixes in this network + + ```proto + optional metalstack.api.v2.NetworkConsumption consumption = 17; + ``` + """ + + __slots__ = ("id", "meta", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "type", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "consumption") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + name: str | None = None, + description: str | None = None, + partition: str | None = None, + project: str | None = None, + namespace: str | None = None, + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + default_child_prefix_length: ChildPrefixLength | None = None, + min_child_prefix_length: ChildPrefixLength | None = None, + type: NetworkType | None = None, + nat_type: NATType | None = None, + vrf: int | None = None, + parent_network: str | None = None, + additional_announcable_cidrs: list[str] | None = None, + consumption: NetworkConsumption | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + name: str + description: str + partition: str + project: str + namespace: str + prefixes: list[str] + destination_prefixes: list[str] + default_child_prefix_length: ChildPrefixLength | None + min_child_prefix_length: ChildPrefixLength | None + type: NetworkType + nat_type: NATType + vrf: int + parent_network: str + additional_announcable_cidrs: list[str] + consumption: NetworkConsumption | None + +_NetworkQueryFields: TypeAlias = Literal["id", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "vrf", "parent_network", "address_family", "type", "nat_type", "labels"] + +class NetworkQuery(Message[_NetworkQueryFields]): + """ + NetworkQuery defines which networks to query + + ```proto + message metalstack.api.v2.NetworkQuery + ``` + + Attributes: + id: + Id of the network to query + + ```proto + optional string id = 1; + ``` + name: + Name of this network + + ```proto + optional string name = 2; + ``` + description: + Description of this network + + ```proto + optional string description = 3; + ``` + partition: + Partition where this network will be created + + ```proto + optional string partition = 4; + ``` + project: + Project where this network belongs to + + ```proto + optional string project = 5; + ``` + namespace: + Namespace where this network belongs to + + ```proto + optional string namespace = 6; + ``` + prefixes: + Prefixes in this network + + ```proto + repeated string prefixes = 7; + ``` + destination_prefixes: + Destination Prefixes in this network + + ```proto + repeated string destination_prefixes = 8; + ``` + vrf: + VRF of this network has this VNI. + + ```proto + optional uint32 vrf = 9; + ``` + parent_network: + Parent Network points to the id of the parent network if any + + ```proto + optional string parent_network = 10; + ``` + address_family: + Addressfamily to query + + ```proto + optional metalstack.api.v2.NetworkAddressFamily address_family = 11; + ``` + type: + Type of the network to query for + + ```proto + optional metalstack.api.v2.NetworkType type = 12; + ``` + nat_type: + NATType configured + + ```proto + optional metalstack.api.v2.NATType nat_type = 13; + ``` + labels: + Labels on this network + + ```proto + optional metalstack.api.v2.Labels labels = 14; + ``` + """ + + __slots__ = ("id", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "vrf", "parent_network", "address_family", "type", "nat_type", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + name: str | None = None, + description: str | None = None, + partition: str | None = None, + project: str | None = None, + namespace: str | None = None, + prefixes: list[str] | None = None, + destination_prefixes: list[str] | None = None, + vrf: int | None = None, + parent_network: str | None = None, + address_family: NetworkAddressFamily | None = None, + type: NetworkType | None = None, + nat_type: NATType | None = None, + labels: Labels | None = None, + ) -> None: + pass + + id: str + name: str + description: str + partition: str + project: str + namespace: str + prefixes: list[str] + destination_prefixes: list[str] + vrf: int + parent_network: str + address_family: NetworkAddressFamily + type: NetworkType + nat_type: NATType + labels: Labels | None + +_ChildPrefixLengthFields: TypeAlias = Literal["ipv4", "ipv6"] + +class ChildPrefixLength(Message[_ChildPrefixLengthFields]): + """ + ChildPrefixLength + + ```proto + message metalstack.api.v2.ChildPrefixLength + ``` + + Attributes: + ipv4: + IPv4 bit length of this network in this addressfamily + + ```proto + optional uint32 ipv4 = 1; + ``` + ipv6: + IPv6 bit length of this network in this addressfamily + + ```proto + optional uint32 ipv6 = 2; + ``` + """ + + __slots__ = ("ipv4", "ipv6") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ipv4: int | None = None, + ipv6: int | None = None, + ) -> None: + pass + + ipv4: int + ipv6: int + +_NetworkConsumptionFields: TypeAlias = Literal["ipv4", "ipv6"] + +class NetworkConsumption(Message[_NetworkConsumptionFields]): + """ + NetworkConsumption contains ip and prefix usage by addressfamily + + ```proto + message metalstack.api.v2.NetworkConsumption + ``` + + Attributes: + ipv4: + IPv4 network usage + + ```proto + optional metalstack.api.v2.NetworkUsage ipv4 = 1; + ``` + ipv6: + IPv6 network usage, this can be approximated for high numbers + + ```proto + optional metalstack.api.v2.NetworkUsage ipv6 = 2; + ``` + """ + + __slots__ = ("ipv4", "ipv6") + + if TYPE_CHECKING: + + def __init__( + self, + *, + ipv4: NetworkUsage | None = None, + ipv6: NetworkUsage | None = None, + ) -> None: + pass + + ipv4: NetworkUsage | None + ipv6: NetworkUsage | None + +_NetworkUsageFields: TypeAlias = Literal["available_ips", "used_ips", "available_prefixes", "used_prefixes"] + +class NetworkUsage(Message[_NetworkUsageFields]): + """ + NetworkUsage reports core metrics about available and used IPs or Prefixes in a Network. + + ```proto + message metalstack.api.v2.NetworkUsage + ``` + + Attributes: + available_ips: + the total available IPs + + ```proto + uint64 available_ips = 1; + ``` + used_ips: + the total used IPs + + ```proto + uint64 used_ips = 2; + ``` + available_prefixes: + the total available 2-bit prefixes + + ```proto + uint64 available_prefixes = 3; + ``` + used_prefixes: + the total used Prefixes + + ```proto + uint64 used_prefixes = 4; + ``` + """ + + __slots__ = ("available_ips", "used_ips", "available_prefixes", "used_prefixes") + + if TYPE_CHECKING: + + def __init__( + self, + *, + available_ips: int = 0, + used_ips: int = 0, + available_prefixes: int = 0, + used_prefixes: int = 0, + ) -> None: + pass + + available_ips: int + used_ips: int + available_prefixes: int + used_prefixes: int + +class NATType(Enum): + """ + NATType defines how and if outgoing traffic is translated + + ```proto + enum metalstack.api.v2.NATType + ``` + + Attributes: + UNSPECIFIED: + NAT_TYPE_UNSPECIFIED indicates a unspecified nat type + + ```proto + NAT_TYPE_UNSPECIFIED = 0 + ``` + NONE: + NAT_TYPE_NONE indicates that no nat is configured + + ```proto + NAT_TYPE_NONE = 1 + ``` + IPV4_MASQUERADE: + NAT_TYPE_IPV4_MASQUERADE masquerade ipv4 behind gateway ip when traffic enters this network + + ```proto + NAT_TYPE_IPV4_MASQUERADE = 2 + ``` + """ + + UNSPECIFIED = 0 + NONE = 1 + IPV4_MASQUERADE = 2 + +class NetworkType(Enum): + """ + NetworkType indicates the purpose of the network, it cannot be changed after creation + + ```proto + enum metalstack.api.v2.NetworkType + ``` + + Attributes: + UNSPECIFIED: + NETWORK_TYPE_UNSPECIFIED indicates a unknown network type + + ```proto + NETWORK_TYPE_UNSPECIFIED = 0 + ``` + EXTERNAL: + NETWORK_TYPE_EXTERNAL indicates network where multiple projects can allocate ips, it offers connectivity to other external networks + In most cases this is the internet network or a network which offers connectivity to legacy datacenter networks. + If it is not project scoped everyone can allocate Ips in this network, otherwise only from the same project ip allocation is possible. + + ```proto + NETWORK_TYPE_EXTERNAL = 1 + ``` + UNDERLAY: + NETWORK_TYPE_UNDERLAY indicates a underlay network + The underlay network connects all switches and the firewalls to build a EVPN dataplane + It is not project scoped. Is part of the dataplane and reserved for administrative purposes. + + ```proto + NETWORK_TYPE_UNDERLAY = 2 + ``` + SUPER: + NETWORK_TYPE_SUPER indicates a super network which is only used to create child networks + If the vrf id is given, child networks will inherit this vrf. + If the vrf id is nil in this network, child vrf is taken from the pool. + If the partition is given, child networks inherit the partition. + If the partition is nil, child networks also do not have a partition (i.e. requires vrf is distributed across all partitions). + If the partition is given, only one super network in that partition can be created. + If the partition is nil, multiple super networks can exist. Then, for child network creation the network id must be specified (base networks can be queried by label selector). + For child creation destination prefixes will be inherited + If this is project scoped, the child project must match, otherwise can be freely specified. + + ```proto + NETWORK_TYPE_SUPER = 3 + ``` + SUPER_NAMESPACED: + NETWORK_TYPE_SUPER_NAMESPACED indicates a super network which is only used to create child networks. + All rules from NETWORK_TYPE_SUPER apply for them as well. + In addition, a network namespace will be created for every project. Child networks per project will have disjunct prefixes. + Prefix allocation will start again with the same base cidr for every project / namespace. + This will allow the creation of much more child networks from a given super network size. + + ```proto + NETWORK_TYPE_SUPER_NAMESPACED = 4 + ``` + CHILD: + NETWORK_TYPE_CHILD indicates a child network of a project. + This is the only network type that can be created by a user. + Connectivity to external networks is not possible without going through an additional firewall in this network which creates connectivity to other networks. + Such a network will be created either from a super, or super namespaced. + + ```proto + NETWORK_TYPE_CHILD = 5 + ``` + CHILD_SHARED: + NETWORK_TYPE_CHILD_SHARED indicates a child network of a project which allows the allocation of ips from different projects. + Connectivity to external networks is not possible, as for normal child networks. + These networks are usually used to provide connectivity to shared services which are created in child networks, e.g. storage. + With this approach the number of hops can be reduced to the bare minimum in order to increase availability and performance. + Only one child shared network per project is allowed. + + ```proto + NETWORK_TYPE_CHILD_SHARED = 6 + ``` + """ + + UNSPECIFIED = 0 + EXTERNAL = 1 + UNDERLAY = 2 + SUPER = 3 + SUPER_NAMESPACED = 4 + CHILD = 5 + CHILD_SHARED = 6 + +class NetworkAddressFamily(Enum): + """ + NetworkAddressFamily defines the address family of a network + + ```proto + enum metalstack.api.v2.NetworkAddressFamily + ``` + + Attributes: + UNSPECIFIED: + NETWORK_ADDRESS_FAMILY_UNSPECIFIED is not specified + + ```proto + NETWORK_ADDRESS_FAMILY_UNSPECIFIED = 0 + ``` + V4: + NETWORK_ADDRESS_FAMILY_V4 defines a network with IPv4 address prefixes + + ```proto + NETWORK_ADDRESS_FAMILY_V4 = 1 + ``` + V6: + NETWORK_ADDRESS_FAMILY_V6 defines a network with IPv6 address prefixes + + ```proto + NETWORK_ADDRESS_FAMILY_V6 = 2 + ``` + DUAL_STACK: + NETWORK_ADDRESS_FAMILY_DUAL_STACK defines a network with both IPv4 and IPv6 address prefixes + + ```proto + NETWORK_ADDRESS_FAMILY_DUAL_STACK = 3 + ``` + """ + + UNSPECIFIED = 0 + V4 = 1 + V6 = 2 + DUAL_STACK = 3 + + +_DESC = file_desc( + b'\n\x1fmetalstack/api/v2/network.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"^\n\x18NetworkServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12%\n\x07project\x18\x02 \x01(\tR\x07projectB\x0b\xbaH\x08\xd8\x01\x01r\x03\xb0\x01\x01"Q\n\x19NetworkServiceGetResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"\xb1\x04\n\x1bNetworkServiceCreateRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tH\x02R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x121\n\x06labels\x18\x05 \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labels\x127\n\x0eparent_network\x18\x06 \x01(\tH\x03R\rparentNetworkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12A\n\x06length\x18\x07 \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthH\x04R\x06length\x88\x01\x01\x12]\n\x0eaddress_family\x18\x08 \x01(\x0e2\'.metalstack.api.v2.NetworkAddressFamilyH\x05R\raddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\x11\n\x0f_parent_networkB\t\n\x07_lengthB\x11\n\x0f_address_family"T\n\x1cNetworkServiceCreateResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"\xe2\x02\n\x1bNetworkServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12"\n\x07project\x18\x03 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x06labels\x18\x06 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels"T\n\x1cNetworkServiceUpdateResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"y\n\x19NetworkServiceListRequest\x12%\n\x07project\x18\x01 \x01(\tR\x07projectB\x0b\xbaH\x08\xd8\x01\x01r\x03\xb0\x01\x01\x125\n\x05query\x18\x02 \x01(\x0b2\x1f.metalstack.api.v2.NetworkQueryR\x05query"T\n\x1aNetworkServiceListResponse\x126\n\x08networks\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.NetworkR\x08networks"\x85\x01\n%NetworkServiceListBaseNetworksRequest\x12%\n\x07project\x18\x01 \x01(\tR\x07projectB\x0b\xbaH\x08\xd8\x01\x01r\x03\xb0\x01\x01\x125\n\x05query\x18\x02 \x01(\x0b2\x1f.metalstack.api.v2.NetworkQueryR\x05query"`\n&NetworkServiceListBaseNetworksResponse\x126\n\x08networks\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.NetworkR\x08networks"^\n\x1bNetworkServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"T\n\x1cNetworkServiceDeleteResponse\x124\n\x07network\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.NetworkR\x07network"\xa4\x08\n\x07Network\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12.\n\tpartition\x18\x05 \x01(\tH\x02R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x06 \x01(\tH\x03R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12+\n\tnamespace\x18\x07 \x01(\tH\x04R\tnamespaceB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12(\n\x08prefixes\x18\x08 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\t \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12c\n\x1bdefault_child_prefix_length\x18\n \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthR\x18defaultChildPrefixLength\x12[\n\x17min_child_prefix_length\x18\x0b \x01(\x0b2$.metalstack.api.v2.ChildPrefixLengthR\x14minChildPrefixLength\x12<\n\x04type\x18\x0c \x01(\x0e2\x1e.metalstack.api.v2.NetworkTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12?\n\x08nat_type\x18\r \x01(\x0e2\x1a.metalstack.api.v2.NATTypeR\x07natTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x15\n\x03vrf\x18\x0e \x01(\rH\x05R\x03vrf\x88\x01\x01\x127\n\x0eparent_network\x18\x0f \x01(\tH\x06R\rparentNetworkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12N\n\x1cadditional_announcable_cidrs\x18\x10 \x03(\tR\x1aadditionalAnnouncableCidrsB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12G\n\x0bconsumption\x18\x11 \x01(\x0b2%.metalstack.api.v2.NetworkConsumptionR\x0bconsumptionB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\x0c\n\n_namespaceB\x06\n\x04_vrfB\x11\n\x0f_parent_network"\x82\x07\n\x0cNetworkQuery\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tH\x03R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tH\x04R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12+\n\tnamespace\x18\x06 \x01(\tH\x05R\tnamespaceB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12(\n\x08prefixes\x18\x07 \x03(\tR\x08prefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12?\n\x14destination_prefixes\x18\x08 \x03(\tR\x13destinationPrefixesB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12\x15\n\x03vrf\x18\t \x01(\rH\x06R\x03vrf\x88\x01\x01\x127\n\x0eparent_network\x18\n \x01(\tH\x07R\rparentNetworkB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12]\n\x0eaddress_family\x18\x0b \x01(\x0e2\'.metalstack.api.v2.NetworkAddressFamilyH\x08R\raddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12A\n\x04type\x18\x0c \x01(\x0e2\x1e.metalstack.api.v2.NetworkTypeH\tR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12D\n\x08nat_type\x18\r \x01(\x0e2\x1a.metalstack.api.v2.NATTypeH\nR\x07natTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x126\n\x06labels\x18\x0e \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x0bR\x06labels\x88\x01\x01B\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\x0c\n\n_namespaceB\x06\n\x04_vrfB\x11\n\x0f_parent_networkB\x11\n\x0f_address_familyB\x07\n\x05_typeB\x0b\n\t_nat_typeB\t\n\x07_labels"n\n\x11ChildPrefixLength\x12"\n\x04ipv4\x18\x01 \x01(\rH\x00R\x04ipv4B\t\xbaH\x06*\x04\x18 \x00\x88\x01\x01\x12#\n\x04ipv6\x18\x02 \x01(\rH\x01R\x04ipv6B\n\xbaH\x07*\x05\x18\x80\x01 \x00\x88\x01\x01B\x07\n\x05_ipv4B\x07\n\x05_ipv6"~\n\x12NetworkConsumption\x123\n\x04ipv4\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.NetworkUsageR\x04ipv4\x123\n\x04ipv6\x18\x02 \x01(\x0b2\x1f.metalstack.api.v2.NetworkUsageR\x04ipv6"\xa2\x01\n\x0cNetworkUsage\x12#\n\ravailable_ips\x18\x01 \x01(\x04R\x0cavailableIps\x12\x19\n\x08used_ips\x18\x02 \x01(\x04R\x07usedIps\x12-\n\x12available_prefixes\x18\x03 \x01(\x04R\x11availablePrefixes\x12#\n\rused_prefixes\x18\x04 \x01(\x04R\x0cusedPrefixes*m\n\x07NATType\x12\x18\n\x14NAT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\rNAT_TYPE_NONE\x10\x01\x1a\x08\x82\xb2\x19\x04none\x12+\n\x18NAT_TYPE_IPV4_MASQUERADE\x10\x02\x1a\r\x82\xb2\x19\tipv4-masq*\xad\x02\n\x0bNetworkType\x12\x1c\n\x18NETWORK_TYPE_UNSPECIFIED\x10\x00\x12\'\n\x15NETWORK_TYPE_EXTERNAL\x10\x01\x1a\x0c\x82\xb2\x19\x08external\x12\'\n\x15NETWORK_TYPE_UNDERLAY\x10\x02\x1a\x0c\x82\xb2\x19\x08underlay\x12!\n\x12NETWORK_TYPE_SUPER\x10\x03\x1a\t\x82\xb2\x19\x05super\x127\n\x1dNETWORK_TYPE_SUPER_NAMESPACED\x10\x04\x1a\x14\x82\xb2\x19\x10super-namespaced\x12!\n\x12NETWORK_TYPE_CHILD\x10\x05\x1a\t\x82\xb2\x19\x05child\x12/\n\x19NETWORK_TYPE_CHILD_SHARED\x10\x06\x1a\x10\x82\xb2\x19\x0cchild-shared*\xc7\x01\n\x14NetworkAddressFamily\x12&\n"NETWORK_ADDRESS_FAMILY_UNSPECIFIED\x10\x00\x12\'\n\x19NETWORK_ADDRESS_FAMILY_V4\x10\x01\x1a\x08\x82\xb2\x19\x04ipv4\x12\'\n\x19NETWORK_ADDRESS_FAMILY_V6\x10\x02\x1a\x08\x82\xb2\x19\x04ipv6\x125\n!NETWORK_ADDRESS_FAMILY_DUAL_STACK\x10\x03\x1a\x0e\x82\xb2\x19\ndual-stack2\xed\x05\n\x0eNetworkService\x12m\n\x03Get\x12+.metalstack.api.v2.NetworkServiceGetRequest\x1a,.metalstack.api.v2.NetworkServiceGetResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06Create\x12..metalstack.api.v2.NetworkServiceCreateRequest\x1a/.metalstack.api.v2.NetworkServiceCreateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.NetworkServiceUpdateRequest\x1a/.metalstack.api.v2.NetworkServiceUpdateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12p\n\x04List\x12,.metalstack.api.v2.NetworkServiceListRequest\x1a-.metalstack.api.v2.NetworkServiceListResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12\x94\x01\n\x10ListBaseNetworks\x128.metalstack.api.v2.NetworkServiceListBaseNetworksRequest\x1a9.metalstack.api.v2.NetworkServiceListBaseNetworksResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06Delete\x12..metalstack.api.v2.NetworkServiceDeleteRequest\x1a/.metalstack.api.v2.NetworkServiceDeleteResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01B\xc2\x01\n\x15com.metalstack.api.v2B\x0cNetworkProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "NetworkServiceGetRequest": NetworkServiceGetRequest, + "NetworkServiceGetResponse": NetworkServiceGetResponse, + "NetworkServiceCreateRequest": NetworkServiceCreateRequest, + "NetworkServiceCreateResponse": NetworkServiceCreateResponse, + "NetworkServiceUpdateRequest": NetworkServiceUpdateRequest, + "NetworkServiceUpdateResponse": NetworkServiceUpdateResponse, + "NetworkServiceListRequest": NetworkServiceListRequest, + "NetworkServiceListResponse": NetworkServiceListResponse, + "NetworkServiceListBaseNetworksRequest": NetworkServiceListBaseNetworksRequest, + "NetworkServiceListBaseNetworksResponse": NetworkServiceListBaseNetworksResponse, + "NetworkServiceDeleteRequest": NetworkServiceDeleteRequest, + "NetworkServiceDeleteResponse": NetworkServiceDeleteResponse, + "Network": Network, + "NetworkQuery": NetworkQuery, + "ChildPrefixLength": ChildPrefixLength, + "NetworkConsumption": NetworkConsumption, + "NetworkUsage": NetworkUsage, + "NATType": NATType, + "NetworkType": NetworkType, + "NetworkAddressFamily": NetworkAddressFamily, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/network.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/network_pb2.py b/python/metalstack/api/v2/network_pb2.py deleted file mode 100644 index f2956540..00000000 --- a/python/metalstack/api/v2/network_pb2.py +++ /dev/null @@ -1,200 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/network.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/network.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/api/v2/network.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"^\n\x18NetworkServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12%\n\x07project\x18\x02 \x01(\tB\x0b\xbaH\x08r\x03\xb0\x01\x01\xd8\x01\x01R\x07project\"Q\n\x19NetworkServiceGetResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"\xb1\x04\n\x1bNetworkServiceCreateRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x02R\tpartition\x88\x01\x01\x12\x31\n\x06labels\x18\x05 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labels\x12\x37\n\x0eparent_network\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\rparentNetwork\x88\x01\x01\x12\x41\n\x06length\x18\x07 \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthH\x04R\x06length\x88\x01\x01\x12]\n\x0e\x61\x64\x64ress_family\x18\x08 \x01(\x0e\x32\'.metalstack.api.v2.NetworkAddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x05R\raddressFamily\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\x11\n\x0f_parent_networkB\t\n\x07_lengthB\x11\n\x0f_address_family\"T\n\x1cNetworkServiceCreateResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"\xe2\x02\n\x1bNetworkServiceUpdateRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\"\n\x07project\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12<\n\x06labels\x18\x06 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x02R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels\"T\n\x1cNetworkServiceUpdateResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"y\n\x19NetworkServiceListRequest\x12%\n\x07project\x18\x01 \x01(\tB\x0b\xbaH\x08r\x03\xb0\x01\x01\xd8\x01\x01R\x07project\x12\x35\n\x05query\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.NetworkQueryR\x05query\"T\n\x1aNetworkServiceListResponse\x12\x36\n\x08networks\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x08networks\"\x85\x01\n%NetworkServiceListBaseNetworksRequest\x12%\n\x07project\x18\x01 \x01(\tB\x0b\xbaH\x08r\x03\xb0\x01\x01\xd8\x01\x01R\x07project\x12\x35\n\x05query\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.NetworkQueryR\x05query\"`\n&NetworkServiceListBaseNetworksResponse\x12\x36\n\x08networks\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x08networks\"^\n\x1bNetworkServiceDeleteRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"T\n\x1cNetworkServiceDeleteResponse\x12\x34\n\x07network\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.NetworkR\x07network\"\xa4\x08\n\x07Network\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12.\n\tpartition\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x02R\tpartition\x88\x01\x01\x12\'\n\x07project\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x03R\x07project\x88\x01\x01\x12+\n\tnamespace\x18\x07 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\tnamespace\x88\x01\x01\x12(\n\x08prefixes\x18\x08 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\t \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12\x63\n\x1b\x64\x65\x66\x61ult_child_prefix_length\x18\n \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthR\x18\x64\x65\x66\x61ultChildPrefixLength\x12[\n\x17min_child_prefix_length\x18\x0b \x01(\x0b\x32$.metalstack.api.v2.ChildPrefixLengthR\x14minChildPrefixLength\x12<\n\x04type\x18\x0c \x01(\x0e\x32\x1e.metalstack.api.v2.NetworkTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12?\n\x08nat_type\x18\r \x01(\x0e\x32\x1a.metalstack.api.v2.NATTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x07natType\x12\x15\n\x03vrf\x18\x0e \x01(\rH\x05R\x03vrf\x88\x01\x01\x12\x37\n\x0eparent_network\x18\x0f \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x06R\rparentNetwork\x88\x01\x01\x12N\n\x1c\x61\x64\x64itional_announcable_cidrs\x18\x10 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x1a\x61\x64\x64itionalAnnouncableCidrs\x12G\n\x0b\x63onsumption\x18\x11 \x01(\x0b\x32%.metalstack.api.v2.NetworkConsumptionR\x0b\x63onsumptionB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\x0c\n\n_namespaceB\x06\n\x04_vrfB\x11\n\x0f_parent_network\"\x82\x07\n\x0cNetworkQuery\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12.\n\tpartition\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x03R\tpartition\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\x07project\x88\x01\x01\x12+\n\tnamespace\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x05R\tnamespace\x88\x01\x01\x12(\n\x08prefixes\x18\x07 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x08prefixes\x12?\n\x14\x64\x65stination_prefixes\x18\x08 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x13\x64\x65stinationPrefixes\x12\x15\n\x03vrf\x18\t \x01(\rH\x06R\x03vrf\x88\x01\x01\x12\x37\n\x0eparent_network\x18\n \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x07R\rparentNetwork\x88\x01\x01\x12]\n\x0e\x61\x64\x64ress_family\x18\x0b \x01(\x0e\x32\'.metalstack.api.v2.NetworkAddressFamilyB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x08R\raddressFamily\x88\x01\x01\x12\x41\n\x04type\x18\x0c \x01(\x0e\x32\x1e.metalstack.api.v2.NetworkTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\tR\x04type\x88\x01\x01\x12\x44\n\x08nat_type\x18\r \x01(\x0e\x32\x1a.metalstack.api.v2.NATTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\nR\x07natType\x88\x01\x01\x12\x36\n\x06labels\x18\x0e \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x0bR\x06labels\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x0c\n\n_partitionB\n\n\x08_projectB\x0c\n\n_namespaceB\x06\n\x04_vrfB\x11\n\x0f_parent_networkB\x11\n\x0f_address_familyB\x07\n\x05_typeB\x0b\n\t_nat_typeB\t\n\x07_labels\"n\n\x11\x43hildPrefixLength\x12\"\n\x04ipv4\x18\x01 \x01(\rB\t\xbaH\x06*\x04\x18 \x00H\x00R\x04ipv4\x88\x01\x01\x12#\n\x04ipv6\x18\x02 \x01(\rB\n\xbaH\x07*\x05\x18\x80\x01 \x00H\x01R\x04ipv6\x88\x01\x01\x42\x07\n\x05_ipv4B\x07\n\x05_ipv6\"~\n\x12NetworkConsumption\x12\x33\n\x04ipv4\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.NetworkUsageR\x04ipv4\x12\x33\n\x04ipv6\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.NetworkUsageR\x04ipv6\"\xa2\x01\n\x0cNetworkUsage\x12#\n\ravailable_ips\x18\x01 \x01(\x04R\x0c\x61vailableIps\x12\x19\n\x08used_ips\x18\x02 \x01(\x04R\x07usedIps\x12-\n\x12\x61vailable_prefixes\x18\x03 \x01(\x04R\x11\x61vailablePrefixes\x12#\n\rused_prefixes\x18\x04 \x01(\x04R\x0cusedPrefixes*m\n\x07NATType\x12\x18\n\x14NAT_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\rNAT_TYPE_NONE\x10\x01\x1a\x08\x82\xb2\x19\x04none\x12+\n\x18NAT_TYPE_IPV4_MASQUERADE\x10\x02\x1a\r\x82\xb2\x19\tipv4-masq*\xad\x02\n\x0bNetworkType\x12\x1c\n\x18NETWORK_TYPE_UNSPECIFIED\x10\x00\x12\'\n\x15NETWORK_TYPE_EXTERNAL\x10\x01\x1a\x0c\x82\xb2\x19\x08\x65xternal\x12\'\n\x15NETWORK_TYPE_UNDERLAY\x10\x02\x1a\x0c\x82\xb2\x19\x08underlay\x12!\n\x12NETWORK_TYPE_SUPER\x10\x03\x1a\t\x82\xb2\x19\x05super\x12\x37\n\x1dNETWORK_TYPE_SUPER_NAMESPACED\x10\x04\x1a\x14\x82\xb2\x19\x10super-namespaced\x12!\n\x12NETWORK_TYPE_CHILD\x10\x05\x1a\t\x82\xb2\x19\x05\x63hild\x12/\n\x19NETWORK_TYPE_CHILD_SHARED\x10\x06\x1a\x10\x82\xb2\x19\x0c\x63hild-shared*\xc7\x01\n\x14NetworkAddressFamily\x12&\n\"NETWORK_ADDRESS_FAMILY_UNSPECIFIED\x10\x00\x12\'\n\x19NETWORK_ADDRESS_FAMILY_V4\x10\x01\x1a\x08\x82\xb2\x19\x04ipv4\x12\'\n\x19NETWORK_ADDRESS_FAMILY_V6\x10\x02\x1a\x08\x82\xb2\x19\x04ipv6\x12\x35\n!NETWORK_ADDRESS_FAMILY_DUAL_STACK\x10\x03\x1a\x0e\x82\xb2\x19\ndual-stack2\xed\x05\n\x0eNetworkService\x12m\n\x03Get\x12+.metalstack.api.v2.NetworkServiceGetRequest\x1a,.metalstack.api.v2.NetworkServiceGetResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06\x43reate\x12..metalstack.api.v2.NetworkServiceCreateRequest\x1a/.metalstack.api.v2.NetworkServiceCreateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.NetworkServiceUpdateRequest\x1a/.metalstack.api.v2.NetworkServiceUpdateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12p\n\x04List\x12,.metalstack.api.v2.NetworkServiceListRequest\x1a-.metalstack.api.v2.NetworkServiceListResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12\x94\x01\n\x10ListBaseNetworks\x12\x38.metalstack.api.v2.NetworkServiceListBaseNetworksRequest\x1a\x39.metalstack.api.v2.NetworkServiceListBaseNetworksResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06\x44\x65lete\x12..metalstack.api.v2.NetworkServiceDeleteRequest\x1a/.metalstack.api.v2.NetworkServiceDeleteResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x42\xc2\x01\n\x15\x63om.metalstack.api.v2B\x0cNetworkProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.network_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\014NetworkProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_NATTYPE'].values_by_name["NAT_TYPE_NONE"]._loaded_options = None - _globals['_NATTYPE'].values_by_name["NAT_TYPE_NONE"]._serialized_options = b'\202\262\031\004none' - _globals['_NATTYPE'].values_by_name["NAT_TYPE_IPV4_MASQUERADE"]._loaded_options = None - _globals['_NATTYPE'].values_by_name["NAT_TYPE_IPV4_MASQUERADE"]._serialized_options = b'\202\262\031\tipv4-masq' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_EXTERNAL"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_EXTERNAL"]._serialized_options = b'\202\262\031\010external' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_UNDERLAY"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_UNDERLAY"]._serialized_options = b'\202\262\031\010underlay' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_SUPER"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_SUPER"]._serialized_options = b'\202\262\031\005super' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_SUPER_NAMESPACED"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_SUPER_NAMESPACED"]._serialized_options = b'\202\262\031\020super-namespaced' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_CHILD"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_CHILD"]._serialized_options = b'\202\262\031\005child' - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_CHILD_SHARED"]._loaded_options = None - _globals['_NETWORKTYPE'].values_by_name["NETWORK_TYPE_CHILD_SHARED"]._serialized_options = b'\202\262\031\014child-shared' - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_V4"]._loaded_options = None - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_V4"]._serialized_options = b'\202\262\031\004ipv4' - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_V6"]._loaded_options = None - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_V6"]._serialized_options = b'\202\262\031\004ipv6' - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_DUAL_STACK"]._loaded_options = None - _globals['_NETWORKADDRESSFAMILY'].values_by_name["NETWORK_ADDRESS_FAMILY_DUAL_STACK"]._serialized_options = b'\202\262\031\ndual-stack' - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICEGETREQUEST'].fields_by_name['project']._serialized_options = b'\272H\010r\003\260\001\001\330\001\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['parent_network']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['parent_network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['address_family']._loaded_options = None - _globals['_NETWORKSERVICECREATEREQUEST'].fields_by_name['address_family']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_NETWORKSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORKSERVICELISTREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICELISTREQUEST'].fields_by_name['project']._serialized_options = b'\272H\010r\003\260\001\001\330\001\001' - _globals['_NETWORKSERVICELISTBASENETWORKSREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICELISTBASENETWORKSREQUEST'].fields_by_name['project']._serialized_options = b'\272H\010r\003\260\001\001\330\001\001' - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKSERVICEDELETEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORK'].fields_by_name['id']._loaded_options = None - _globals['_NETWORK'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORK'].fields_by_name['name']._loaded_options = None - _globals['_NETWORK'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORK'].fields_by_name['description']._loaded_options = None - _globals['_NETWORK'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORK'].fields_by_name['partition']._loaded_options = None - _globals['_NETWORK'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_NETWORK'].fields_by_name['project']._loaded_options = None - _globals['_NETWORK'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORK'].fields_by_name['namespace']._loaded_options = None - _globals['_NETWORK'].fields_by_name['namespace']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORK'].fields_by_name['prefixes']._loaded_options = None - _globals['_NETWORK'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORK'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_NETWORK'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORK'].fields_by_name['type']._loaded_options = None - _globals['_NETWORK'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORK'].fields_by_name['nat_type']._loaded_options = None - _globals['_NETWORK'].fields_by_name['nat_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORK'].fields_by_name['parent_network']._loaded_options = None - _globals['_NETWORK'].fields_by_name['parent_network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORK'].fields_by_name['additional_announcable_cidrs']._loaded_options = None - _globals['_NETWORK'].fields_by_name['additional_announcable_cidrs']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['id']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['name']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['description']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['partition']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['project']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORKQUERY'].fields_by_name['namespace']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['namespace']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_NETWORKQUERY'].fields_by_name['prefixes']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['destination_prefixes']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['destination_prefixes']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['parent_network']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['parent_network']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_NETWORKQUERY'].fields_by_name['address_family']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['address_family']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKQUERY'].fields_by_name['type']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NETWORKQUERY'].fields_by_name['nat_type']._loaded_options = None - _globals['_NETWORKQUERY'].fields_by_name['nat_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_CHILDPREFIXLENGTH'].fields_by_name['ipv4']._loaded_options = None - _globals['_CHILDPREFIXLENGTH'].fields_by_name['ipv4']._serialized_options = b'\272H\006*\004\030 \000' - _globals['_CHILDPREFIXLENGTH'].fields_by_name['ipv6']._loaded_options = None - _globals['_CHILDPREFIXLENGTH'].fields_by_name['ipv6']._serialized_options = b'\272H\007*\005\030\200\001 \000' - _globals['_NETWORKSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Get']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_NETWORKSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Create']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_NETWORKSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Update']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_NETWORKSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['List']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_NETWORKSERVICE'].methods_by_name['ListBaseNetworks']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['ListBaseNetworks']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_NETWORKSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_NETWORKSERVICE'].methods_by_name['Delete']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_NATTYPE']._serialized_start=4423 - _globals['_NATTYPE']._serialized_end=4532 - _globals['_NETWORKTYPE']._serialized_start=4535 - _globals['_NETWORKTYPE']._serialized_end=4836 - _globals['_NETWORKADDRESSFAMILY']._serialized_start=4839 - _globals['_NETWORKADDRESSFAMILY']._serialized_end=5038 - _globals['_NETWORKSERVICEGETREQUEST']._serialized_start=157 - _globals['_NETWORKSERVICEGETREQUEST']._serialized_end=251 - _globals['_NETWORKSERVICEGETRESPONSE']._serialized_start=253 - _globals['_NETWORKSERVICEGETRESPONSE']._serialized_end=334 - _globals['_NETWORKSERVICECREATEREQUEST']._serialized_start=337 - _globals['_NETWORKSERVICECREATEREQUEST']._serialized_end=898 - _globals['_NETWORKSERVICECREATERESPONSE']._serialized_start=900 - _globals['_NETWORKSERVICECREATERESPONSE']._serialized_end=984 - _globals['_NETWORKSERVICEUPDATEREQUEST']._serialized_start=987 - _globals['_NETWORKSERVICEUPDATEREQUEST']._serialized_end=1341 - _globals['_NETWORKSERVICEUPDATERESPONSE']._serialized_start=1343 - _globals['_NETWORKSERVICEUPDATERESPONSE']._serialized_end=1427 - _globals['_NETWORKSERVICELISTREQUEST']._serialized_start=1429 - _globals['_NETWORKSERVICELISTREQUEST']._serialized_end=1550 - _globals['_NETWORKSERVICELISTRESPONSE']._serialized_start=1552 - _globals['_NETWORKSERVICELISTRESPONSE']._serialized_end=1636 - _globals['_NETWORKSERVICELISTBASENETWORKSREQUEST']._serialized_start=1639 - _globals['_NETWORKSERVICELISTBASENETWORKSREQUEST']._serialized_end=1772 - _globals['_NETWORKSERVICELISTBASENETWORKSRESPONSE']._serialized_start=1774 - _globals['_NETWORKSERVICELISTBASENETWORKSRESPONSE']._serialized_end=1870 - _globals['_NETWORKSERVICEDELETEREQUEST']._serialized_start=1872 - _globals['_NETWORKSERVICEDELETEREQUEST']._serialized_end=1966 - _globals['_NETWORKSERVICEDELETERESPONSE']._serialized_start=1968 - _globals['_NETWORKSERVICEDELETERESPONSE']._serialized_end=2052 - _globals['_NETWORK']._serialized_start=2055 - _globals['_NETWORK']._serialized_end=3115 - _globals['_NETWORKQUERY']._serialized_start=3118 - _globals['_NETWORKQUERY']._serialized_end=4016 - _globals['_CHILDPREFIXLENGTH']._serialized_start=4018 - _globals['_CHILDPREFIXLENGTH']._serialized_end=4128 - _globals['_NETWORKCONSUMPTION']._serialized_start=4130 - _globals['_NETWORKCONSUMPTION']._serialized_end=4256 - _globals['_NETWORKUSAGE']._serialized_start=4259 - _globals['_NETWORKUSAGE']._serialized_end=4421 - _globals['_NETWORKSERVICE']._serialized_start=5041 - _globals['_NETWORKSERVICE']._serialized_end=5790 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/network_pb2.pyi b/python/metalstack/api/v2/network_pb2.pyi deleted file mode 100644 index 10502757..00000000 --- a/python/metalstack/api/v2/network_pb2.pyi +++ /dev/null @@ -1,250 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class NATType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - NAT_TYPE_UNSPECIFIED: _ClassVar[NATType] - NAT_TYPE_NONE: _ClassVar[NATType] - NAT_TYPE_IPV4_MASQUERADE: _ClassVar[NATType] - -class NetworkType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - NETWORK_TYPE_UNSPECIFIED: _ClassVar[NetworkType] - NETWORK_TYPE_EXTERNAL: _ClassVar[NetworkType] - NETWORK_TYPE_UNDERLAY: _ClassVar[NetworkType] - NETWORK_TYPE_SUPER: _ClassVar[NetworkType] - NETWORK_TYPE_SUPER_NAMESPACED: _ClassVar[NetworkType] - NETWORK_TYPE_CHILD: _ClassVar[NetworkType] - NETWORK_TYPE_CHILD_SHARED: _ClassVar[NetworkType] - -class NetworkAddressFamily(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - NETWORK_ADDRESS_FAMILY_UNSPECIFIED: _ClassVar[NetworkAddressFamily] - NETWORK_ADDRESS_FAMILY_V4: _ClassVar[NetworkAddressFamily] - NETWORK_ADDRESS_FAMILY_V6: _ClassVar[NetworkAddressFamily] - NETWORK_ADDRESS_FAMILY_DUAL_STACK: _ClassVar[NetworkAddressFamily] -NAT_TYPE_UNSPECIFIED: NATType -NAT_TYPE_NONE: NATType -NAT_TYPE_IPV4_MASQUERADE: NATType -NETWORK_TYPE_UNSPECIFIED: NetworkType -NETWORK_TYPE_EXTERNAL: NetworkType -NETWORK_TYPE_UNDERLAY: NetworkType -NETWORK_TYPE_SUPER: NetworkType -NETWORK_TYPE_SUPER_NAMESPACED: NetworkType -NETWORK_TYPE_CHILD: NetworkType -NETWORK_TYPE_CHILD_SHARED: NetworkType -NETWORK_ADDRESS_FAMILY_UNSPECIFIED: NetworkAddressFamily -NETWORK_ADDRESS_FAMILY_V4: NetworkAddressFamily -NETWORK_ADDRESS_FAMILY_V6: NetworkAddressFamily -NETWORK_ADDRESS_FAMILY_DUAL_STACK: NetworkAddressFamily - -class NetworkServiceGetRequest(_message.Message): - __slots__ = ("id", "project") - ID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - id: str - project: str - def __init__(self, id: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class NetworkServiceGetResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: Network - def __init__(self, network: _Optional[_Union[Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceCreateRequest(_message.Message): - __slots__ = ("project", "name", "description", "partition", "labels", "parent_network", "length", "address_family") - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - PARENT_NETWORK_FIELD_NUMBER: _ClassVar[int] - LENGTH_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FAMILY_FIELD_NUMBER: _ClassVar[int] - project: str - name: str - description: str - partition: str - labels: _common_pb2.Labels - parent_network: str - length: ChildPrefixLength - address_family: NetworkAddressFamily - def __init__(self, project: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., partition: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., parent_network: _Optional[str] = ..., length: _Optional[_Union[ChildPrefixLength, _Mapping]] = ..., address_family: _Optional[_Union[NetworkAddressFamily, str]] = ...) -> None: ... - -class NetworkServiceCreateResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: Network - def __init__(self, network: _Optional[_Union[Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceUpdateRequest(_message.Message): - __slots__ = ("id", "update_meta", "project", "name", "description", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - update_meta: _common_pb2.UpdateMeta - project: str - name: str - description: str - labels: _common_pb2.UpdateLabels - def __init__(self, id: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., project: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class NetworkServiceUpdateResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: Network - def __init__(self, network: _Optional[_Union[Network, _Mapping]] = ...) -> None: ... - -class NetworkServiceListRequest(_message.Message): - __slots__ = ("project", "query") - PROJECT_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - project: str - query: NetworkQuery - def __init__(self, project: _Optional[str] = ..., query: _Optional[_Union[NetworkQuery, _Mapping]] = ...) -> None: ... - -class NetworkServiceListResponse(_message.Message): - __slots__ = ("networks",) - NETWORKS_FIELD_NUMBER: _ClassVar[int] - networks: _containers.RepeatedCompositeFieldContainer[Network] - def __init__(self, networks: _Optional[_Iterable[_Union[Network, _Mapping]]] = ...) -> None: ... - -class NetworkServiceListBaseNetworksRequest(_message.Message): - __slots__ = ("project", "query") - PROJECT_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - project: str - query: NetworkQuery - def __init__(self, project: _Optional[str] = ..., query: _Optional[_Union[NetworkQuery, _Mapping]] = ...) -> None: ... - -class NetworkServiceListBaseNetworksResponse(_message.Message): - __slots__ = ("networks",) - NETWORKS_FIELD_NUMBER: _ClassVar[int] - networks: _containers.RepeatedCompositeFieldContainer[Network] - def __init__(self, networks: _Optional[_Iterable[_Union[Network, _Mapping]]] = ...) -> None: ... - -class NetworkServiceDeleteRequest(_message.Message): - __slots__ = ("id", "project") - ID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - id: str - project: str - def __init__(self, id: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class NetworkServiceDeleteResponse(_message.Message): - __slots__ = ("network",) - NETWORK_FIELD_NUMBER: _ClassVar[int] - network: Network - def __init__(self, network: _Optional[_Union[Network, _Mapping]] = ...) -> None: ... - -class Network(_message.Message): - __slots__ = ("id", "meta", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "default_child_prefix_length", "min_child_prefix_length", "type", "nat_type", "vrf", "parent_network", "additional_announcable_cidrs", "consumption") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAMESPACE_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - DEFAULT_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - MIN_CHILD_PREFIX_LENGTH_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - NAT_TYPE_FIELD_NUMBER: _ClassVar[int] - VRF_FIELD_NUMBER: _ClassVar[int] - PARENT_NETWORK_FIELD_NUMBER: _ClassVar[int] - ADDITIONAL_ANNOUNCABLE_CIDRS_FIELD_NUMBER: _ClassVar[int] - CONSUMPTION_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - name: str - description: str - partition: str - project: str - namespace: str - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - default_child_prefix_length: ChildPrefixLength - min_child_prefix_length: ChildPrefixLength - type: NetworkType - nat_type: NATType - vrf: int - parent_network: str - additional_announcable_cidrs: _containers.RepeatedScalarFieldContainer[str] - consumption: NetworkConsumption - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., partition: _Optional[str] = ..., project: _Optional[str] = ..., namespace: _Optional[str] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., default_child_prefix_length: _Optional[_Union[ChildPrefixLength, _Mapping]] = ..., min_child_prefix_length: _Optional[_Union[ChildPrefixLength, _Mapping]] = ..., type: _Optional[_Union[NetworkType, str]] = ..., nat_type: _Optional[_Union[NATType, str]] = ..., vrf: _Optional[int] = ..., parent_network: _Optional[str] = ..., additional_announcable_cidrs: _Optional[_Iterable[str]] = ..., consumption: _Optional[_Union[NetworkConsumption, _Mapping]] = ...) -> None: ... - -class NetworkQuery(_message.Message): - __slots__ = ("id", "name", "description", "partition", "project", "namespace", "prefixes", "destination_prefixes", "vrf", "parent_network", "address_family", "type", "nat_type", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - NAMESPACE_FIELD_NUMBER: _ClassVar[int] - PREFIXES_FIELD_NUMBER: _ClassVar[int] - DESTINATION_PREFIXES_FIELD_NUMBER: _ClassVar[int] - VRF_FIELD_NUMBER: _ClassVar[int] - PARENT_NETWORK_FIELD_NUMBER: _ClassVar[int] - ADDRESS_FAMILY_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - NAT_TYPE_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - name: str - description: str - partition: str - project: str - namespace: str - prefixes: _containers.RepeatedScalarFieldContainer[str] - destination_prefixes: _containers.RepeatedScalarFieldContainer[str] - vrf: int - parent_network: str - address_family: NetworkAddressFamily - type: NetworkType - nat_type: NATType - labels: _common_pb2.Labels - def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., partition: _Optional[str] = ..., project: _Optional[str] = ..., namespace: _Optional[str] = ..., prefixes: _Optional[_Iterable[str]] = ..., destination_prefixes: _Optional[_Iterable[str]] = ..., vrf: _Optional[int] = ..., parent_network: _Optional[str] = ..., address_family: _Optional[_Union[NetworkAddressFamily, str]] = ..., type: _Optional[_Union[NetworkType, str]] = ..., nat_type: _Optional[_Union[NATType, str]] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class ChildPrefixLength(_message.Message): - __slots__ = ("ipv4", "ipv6") - IPV4_FIELD_NUMBER: _ClassVar[int] - IPV6_FIELD_NUMBER: _ClassVar[int] - ipv4: int - ipv6: int - def __init__(self, ipv4: _Optional[int] = ..., ipv6: _Optional[int] = ...) -> None: ... - -class NetworkConsumption(_message.Message): - __slots__ = ("ipv4", "ipv6") - IPV4_FIELD_NUMBER: _ClassVar[int] - IPV6_FIELD_NUMBER: _ClassVar[int] - ipv4: NetworkUsage - ipv6: NetworkUsage - def __init__(self, ipv4: _Optional[_Union[NetworkUsage, _Mapping]] = ..., ipv6: _Optional[_Union[NetworkUsage, _Mapping]] = ...) -> None: ... - -class NetworkUsage(_message.Message): - __slots__ = ("available_ips", "used_ips", "available_prefixes", "used_prefixes") - AVAILABLE_IPS_FIELD_NUMBER: _ClassVar[int] - USED_IPS_FIELD_NUMBER: _ClassVar[int] - AVAILABLE_PREFIXES_FIELD_NUMBER: _ClassVar[int] - USED_PREFIXES_FIELD_NUMBER: _ClassVar[int] - available_ips: int - used_ips: int - available_prefixes: int - used_prefixes: int - def __init__(self, available_ips: _Optional[int] = ..., used_ips: _Optional[int] = ..., available_prefixes: _Optional[int] = ..., used_prefixes: _Optional[int] = ...) -> None: ... diff --git a/python/metalstack/api/v2/partition_connect.py b/python/metalstack/api/v2/partition_connect.py index 5e130940..88f27b5c 100644 --- a/python/metalstack/api/v2/partition_connect.py +++ b/python/metalstack/api/v2/partition_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/partition.proto +# Generated from metalstack/api/v2/partition.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.partition_pb2 as metalstack_dot_api_dot_v2_dot_partition__pb2 + +from .partition_pb import PartitionServiceGetRequest, PartitionServiceGetResponse, PartitionServiceListRequest, PartitionServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class PartitionService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: PartitionServiceGetRequest, ctx: RequestContext[PartitionServiceGetRequest, PartitionServiceGetResponse]) -> PartitionServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: PartitionServiceListRequest, ctx: RequestContext[PartitionServiceListRequest, PartitionServiceListResponse]) -> PartitionServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class PartitionServiceASGIApplication(ConnectASGIApplication[PartitionService]): - def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: PartitionService | AsyncGenerator[PartitionService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="Get", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse, + input=PartitionServiceGetRequest, + output=PartitionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: PartitionService | AsyncGenerator[PartitionService], method=MethodInfo( name="List", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse, + input=PartitionServiceListRequest, + output=PartitionServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class PartitionServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, + request: PartitionServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse: + ) -> PartitionServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse, + input=PartitionServiceGetRequest, + output=PartitionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, + request: PartitionServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse: + ) -> PartitionServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse, + input=PartitionServiceListRequest, + output=PartitionServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class PartitionServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: PartitionServiceGetRequest, ctx: RequestContext[PartitionServiceGetRequest, PartitionServiceGetResponse]) -> PartitionServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: PartitionServiceListRequest, ctx: RequestContext[PartitionServiceListRequest, PartitionServiceListResponse]) -> PartitionServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class PartitionServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: PartitionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: PartitionServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.PartitionService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse, + input=PartitionServiceGetRequest, + output=PartitionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: PartitionServiceSync, interceptors: Iterable[Interce method=MethodInfo( name="List", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse, + input=PartitionServiceListRequest, + output=PartitionServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class PartitionServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, + request: PartitionServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse: + ) -> PartitionServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceGetResponse, + input=PartitionServiceGetRequest, + output=PartitionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, + request: PartitionServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse: + ) -> PartitionServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.PartitionService", - input=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_partition__pb2.PartitionServiceListResponse, + input=PartitionServiceListRequest, + output=PartitionServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/partition_pb.py b/python/metalstack/api/v2/partition_pb.py new file mode 100644 index 00000000..5d29f589 --- /dev/null +++ b/python/metalstack/api/v2/partition_pb.py @@ -0,0 +1,408 @@ +# Generated from metalstack/api/v2/partition.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Labels, Meta + + +_PartitionFields: TypeAlias = Literal["id", "meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses"] + +class Partition(Message[_PartitionFields]): + """ + Partition is a failure domain with machines and switches + + ```proto + message metalstack.api.v2.Partition + ``` + + Attributes: + id: + ID of this partition + + ```proto + string id = 1; + ``` + meta: + Meta for this partition + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + description: + Description of this partition + + ```proto + string description = 3; + ``` + boot_configuration: + PartitionBootConfiguration defines how metal-hammer boots + + ```proto + optional metalstack.api.v2.PartitionBootConfiguration boot_configuration = 4; + ``` + dns_servers: + DNSServers for this partition + + ```proto + repeated metalstack.api.v2.DNSServer dns_servers = 5; + ``` + ntp_servers: + NTPServers for this partition + + ```proto + repeated metalstack.api.v2.NTPServer ntp_servers = 6; + ``` + mgmt_service_addresses: + ManagementServiceAddresses defines where the management is reachable + should be in the form : + + ```proto + repeated string mgmt_service_addresses = 7; + ``` + """ + + __slots__ = ("id", "meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + description: str = "", + boot_configuration: PartitionBootConfiguration | None = None, + dns_servers: list[DNSServer] | None = None, + ntp_servers: list[NTPServer] | None = None, + mgmt_service_addresses: list[str] | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + description: str + boot_configuration: PartitionBootConfiguration | None + dns_servers: list[DNSServer] + ntp_servers: list[NTPServer] + mgmt_service_addresses: list[str] + +_PartitionQueryFields: TypeAlias = Literal["id", "labels"] + +class PartitionQuery(Message[_PartitionQueryFields]): + """ + PartitionQuery is used to search partitions + + ```proto + message metalstack.api.v2.PartitionQuery + ``` + + Attributes: + id: + ID of the partition to get + + ```proto + optional string id = 1; + ``` + labels: + Labels lists only partitions containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 2; + ``` + """ + + __slots__ = ("id", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + id: str + labels: Labels | None + +_PartitionBootConfigurationFields: TypeAlias = Literal["image_url", "kernel_url", "commandline"] + +class PartitionBootConfiguration(Message[_PartitionBootConfigurationFields]): + """ + PartitionBootConfiguration defines how metal-hammer boots + + ```proto + message metalstack.api.v2.PartitionBootConfiguration + ``` + + Attributes: + image_url: + ImageURL the url to download the initrd for the boot image + + ```proto + string image_url = 1; + ``` + kernel_url: + KernelURL the url to download the kernel for the boot image + + ```proto + string kernel_url = 2; + ``` + commandline: + Commandline the kernel command line for the boot image + + ```proto + string commandline = 3; + ``` + """ + + __slots__ = ("image_url", "kernel_url", "commandline") + + if TYPE_CHECKING: + + def __init__( + self, + *, + image_url: str = "", + kernel_url: str = "", + commandline: str = "", + ) -> None: + pass + + image_url: str + kernel_url: str + commandline: str + +_DNSServerFields: TypeAlias = Literal["ip"] + +class DNSServer(Message[_DNSServerFields]): + """ + DNSServer + + ```proto + message metalstack.api.v2.DNSServer + ``` + + Attributes: + ip: + IP address of this dns server + + ```proto + string ip = 1; + ``` + """ + + __slots__ = ("ip",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + ip: str = "", + ) -> None: + pass + + ip: str + +_NTPServerFields: TypeAlias = Literal["address"] + +class NTPServer(Message[_NTPServerFields]): + """ + NTPServer + + ```proto + message metalstack.api.v2.NTPServer + ``` + + Attributes: + address: + Address either as ip or hostname + + ```proto + string address = 1; + ``` + """ + + __slots__ = ("address",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + address: str = "", + ) -> None: + pass + + address: str + +_PartitionServiceGetRequestFields: TypeAlias = Literal["id"] + +class PartitionServiceGetRequest(Message[_PartitionServiceGetRequestFields]): + """ + PartitionServiceGetRequest is the request payload for a partition get request + + ```proto + message metalstack.api.v2.PartitionServiceGetRequest + ``` + + Attributes: + id: + ID of the partition to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_PartitionServiceListRequestFields: TypeAlias = Literal["query"] + +class PartitionServiceListRequest(Message[_PartitionServiceListRequestFields]): + """ + PartitionServiceListRequest is the request payload for a partition list request + + ```proto + message metalstack.api.v2.PartitionServiceListRequest + ``` + + Attributes: + query: + Query for partitions + + ```proto + optional metalstack.api.v2.PartitionQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: PartitionQuery | None = None, + ) -> None: + pass + + query: PartitionQuery | None + +_PartitionServiceGetResponseFields: TypeAlias = Literal["partition"] + +class PartitionServiceGetResponse(Message[_PartitionServiceGetResponseFields]): + """ + PartitionServiceGetResponse is the response payload for a partition get request + + ```proto + message metalstack.api.v2.PartitionServiceGetResponse + ``` + + Attributes: + partition: + Partition is the partition + + ```proto + optional metalstack.api.v2.Partition partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: Partition | None = None, + ) -> None: + pass + + partition: Partition | None + +_PartitionServiceListResponseFields: TypeAlias = Literal["partitions"] + +class PartitionServiceListResponse(Message[_PartitionServiceListResponseFields]): + """ + PartitionServiceListResponse is the response payload for a partition list request + + ```proto + message metalstack.api.v2.PartitionServiceListResponse + ``` + + Attributes: + partitions: + Partitions are the partitions + + ```proto + repeated metalstack.api.v2.Partition partitions = 1; + ``` + """ + + __slots__ = ("partitions",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partitions: list[Partition] | None = None, + ) -> None: + pass + + partitions: list[Partition] + + +_DESC = file_desc( + b'\n!metalstack/api/v2/partition.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xb8\x03\n\tPartition\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0bdescription\x18\x03 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\\\n\x12boot_configuration\x18\x04 \x01(\x0b2-.metalstack.api.v2.PartitionBootConfigurationR\x11bootConfiguration\x12G\n\x0bdns_servers\x18\x05 \x03(\x0b2\x1c.metalstack.api.v2.DNSServerR\ndnsServersB\x08\xbaH\x05\x92\x01\x02\x10\x03\x12G\n\x0bntp_servers\x18\x06 \x03(\x0b2\x1c.metalstack.api.v2.NTPServerR\nntpServersB\x08\xbaH\x05\x92\x01\x02\x10\n\x12B\n\x16mgmt_service_addresses\x18\x07 \x03(\tR\x14mgmtServiceAddressesB\x0c\xbaH\t\x92\x01\x06\xc8\xa4\xb3\xb1\x02\x01"|\n\x0ePartitionQuery\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x02 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x01R\x06labels\x88\x01\x01B\x05\n\x03_idB\t\n\x07_labels"\x9e\x01\n\x1aPartitionBootConfiguration\x12(\n\timage_url\x18\x01 \x01(\tR\x08imageUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12*\n\nkernel_url\x18\x02 \x01(\tR\tkernelUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12*\n\x0bcommandline\x18\x03 \x01(\tR\x0bcommandlineB\x08\xbaH\x05r\x03\x18\x80 "$\n\tDNSServer\x12\x17\n\x02ip\x18\x01 \x01(\tR\x02ipB\x07\xbaH\x04r\x02p\x01"2\n\tNTPServer\x12%\n\x07address\x18\x01 \x01(\tR\x07addressB\x0b\xbaH\x08r\x06\xe8\xb3\xae\xb1\x02\x01"9\n\x1aPartitionServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"V\n\x1bPartitionServiceListRequest\x127\n\x05query\x18\x01 \x01(\x0b2!.metalstack.api.v2.PartitionQueryR\x05query"Y\n\x1bPartitionServiceGetResponse\x12:\n\tpartition\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.PartitionR\tpartition"\\\n\x1cPartitionServiceListResponse\x12<\n\npartitions\x18\x01 \x03(\x0b2\x1c.metalstack.api.v2.PartitionR\npartitions2\xf5\x01\n\x10PartitionService\x12n\n\x03Get\x12-.metalstack.api.v2.PartitionServiceGetRequest\x1a..metalstack.api.v2.PartitionServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12..metalstack.api.v2.PartitionServiceListRequest\x1a/.metalstack.api.v2.PartitionServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xc4\x01\n\x15com.metalstack.api.v2B\x0ePartitionProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Partition": Partition, + "PartitionQuery": PartitionQuery, + "PartitionBootConfiguration": PartitionBootConfiguration, + "DNSServer": DNSServer, + "NTPServer": NTPServer, + "PartitionServiceGetRequest": PartitionServiceGetRequest, + "PartitionServiceListRequest": PartitionServiceListRequest, + "PartitionServiceGetResponse": PartitionServiceGetResponse, + "PartitionServiceListResponse": PartitionServiceListResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/partition.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/partition_pb2.py b/python/metalstack/api/v2/partition_pb2.py deleted file mode 100644 index d1da5167..00000000 --- a/python/metalstack/api/v2/partition_pb2.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/partition.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/partition.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!metalstack/api/v2/partition.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xb8\x03\n\tPartition\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12\\\n\x12\x62oot_configuration\x18\x04 \x01(\x0b\x32-.metalstack.api.v2.PartitionBootConfigurationR\x11\x62ootConfiguration\x12G\n\x0b\x64ns_servers\x18\x05 \x03(\x0b\x32\x1c.metalstack.api.v2.DNSServerB\x08\xbaH\x05\x92\x01\x02\x10\x03R\ndnsServers\x12G\n\x0bntp_servers\x18\x06 \x03(\x0b\x32\x1c.metalstack.api.v2.NTPServerB\x08\xbaH\x05\x92\x01\x02\x10\nR\nntpServers\x12\x42\n\x16mgmt_service_addresses\x18\x07 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc8\xa4\xb3\xb1\x02\x01R\x14mgmtServiceAddresses\"|\n\x0ePartitionQuery\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12\x36\n\x06labels\x18\x02 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x01R\x06labels\x88\x01\x01\x42\x05\n\x03_idB\t\n\x07_labels\"\x9e\x01\n\x1aPartitionBootConfiguration\x12(\n\timage_url\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\x08imageUrl\x12*\n\nkernel_url\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\tkernelUrl\x12*\n\x0b\x63ommandline\x18\x03 \x01(\tB\x08\xbaH\x05r\x03\x18\x80 R\x0b\x63ommandline\"$\n\tDNSServer\x12\x17\n\x02ip\x18\x01 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x02ip\"2\n\tNTPServer\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xe8\xb3\xae\xb1\x02\x01R\x07\x61\x64\x64ress\"9\n\x1aPartitionServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\x02id\"V\n\x1bPartitionServiceListRequest\x12\x37\n\x05query\x18\x01 \x01(\x0b\x32!.metalstack.api.v2.PartitionQueryR\x05query\"Y\n\x1bPartitionServiceGetResponse\x12:\n\tpartition\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.PartitionR\tpartition\"\\\n\x1cPartitionServiceListResponse\x12<\n\npartitions\x18\x01 \x03(\x0b\x32\x1c.metalstack.api.v2.PartitionR\npartitions2\xf5\x01\n\x10PartitionService\x12n\n\x03Get\x12-.metalstack.api.v2.PartitionServiceGetRequest\x1a..metalstack.api.v2.PartitionServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12..metalstack.api.v2.PartitionServiceListRequest\x1a/.metalstack.api.v2.PartitionServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xc4\x01\n\x15\x63om.metalstack.api.v2B\x0ePartitionProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.partition_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\016PartitionProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_PARTITION'].fields_by_name['id']._loaded_options = None - _globals['_PARTITION'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITION'].fields_by_name['description']._loaded_options = None - _globals['_PARTITION'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_PARTITION'].fields_by_name['dns_servers']._loaded_options = None - _globals['_PARTITION'].fields_by_name['dns_servers']._serialized_options = b'\272H\005\222\001\002\020\003' - _globals['_PARTITION'].fields_by_name['ntp_servers']._loaded_options = None - _globals['_PARTITION'].fields_by_name['ntp_servers']._serialized_options = b'\272H\005\222\001\002\020\n' - _globals['_PARTITION'].fields_by_name['mgmt_service_addresses']._loaded_options = None - _globals['_PARTITION'].fields_by_name['mgmt_service_addresses']._serialized_options = b'\272H\t\222\001\006\310\244\263\261\002\001' - _globals['_PARTITIONQUERY'].fields_by_name['id']._loaded_options = None - _globals['_PARTITIONQUERY'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['image_url']._loaded_options = None - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['image_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['kernel_url']._loaded_options = None - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['kernel_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['commandline']._loaded_options = None - _globals['_PARTITIONBOOTCONFIGURATION'].fields_by_name['commandline']._serialized_options = b'\272H\005r\003\030\200 ' - _globals['_DNSSERVER'].fields_by_name['ip']._loaded_options = None - _globals['_DNSSERVER'].fields_by_name['ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_NTPSERVER'].fields_by_name['address']._loaded_options = None - _globals['_NTPSERVER'].fields_by_name['address']._serialized_options = b'\272H\010r\006\350\263\256\261\002\001' - _globals['_PARTITIONSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_PARTITIONSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_PARTITIONSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_PARTITIONSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_PARTITIONSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_PARTITION']._serialized_start=160 - _globals['_PARTITION']._serialized_end=600 - _globals['_PARTITIONQUERY']._serialized_start=602 - _globals['_PARTITIONQUERY']._serialized_end=726 - _globals['_PARTITIONBOOTCONFIGURATION']._serialized_start=729 - _globals['_PARTITIONBOOTCONFIGURATION']._serialized_end=887 - _globals['_DNSSERVER']._serialized_start=889 - _globals['_DNSSERVER']._serialized_end=925 - _globals['_NTPSERVER']._serialized_start=927 - _globals['_NTPSERVER']._serialized_end=977 - _globals['_PARTITIONSERVICEGETREQUEST']._serialized_start=979 - _globals['_PARTITIONSERVICEGETREQUEST']._serialized_end=1036 - _globals['_PARTITIONSERVICELISTREQUEST']._serialized_start=1038 - _globals['_PARTITIONSERVICELISTREQUEST']._serialized_end=1124 - _globals['_PARTITIONSERVICEGETRESPONSE']._serialized_start=1126 - _globals['_PARTITIONSERVICEGETRESPONSE']._serialized_end=1215 - _globals['_PARTITIONSERVICELISTRESPONSE']._serialized_start=1217 - _globals['_PARTITIONSERVICELISTRESPONSE']._serialized_end=1309 - _globals['_PARTITIONSERVICE']._serialized_start=1312 - _globals['_PARTITIONSERVICE']._serialized_end=1557 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/partition_pb2.pyi b/python/metalstack/api/v2/partition_pb2.pyi deleted file mode 100644 index 62ddaaef..00000000 --- a/python/metalstack/api/v2/partition_pb2.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Partition(_message.Message): - __slots__ = ("id", "meta", "description", "boot_configuration", "dns_servers", "ntp_servers", "mgmt_service_addresses") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - BOOT_CONFIGURATION_FIELD_NUMBER: _ClassVar[int] - DNS_SERVERS_FIELD_NUMBER: _ClassVar[int] - NTP_SERVERS_FIELD_NUMBER: _ClassVar[int] - MGMT_SERVICE_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - description: str - boot_configuration: PartitionBootConfiguration - dns_servers: _containers.RepeatedCompositeFieldContainer[DNSServer] - ntp_servers: _containers.RepeatedCompositeFieldContainer[NTPServer] - mgmt_service_addresses: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., description: _Optional[str] = ..., boot_configuration: _Optional[_Union[PartitionBootConfiguration, _Mapping]] = ..., dns_servers: _Optional[_Iterable[_Union[DNSServer, _Mapping]]] = ..., ntp_servers: _Optional[_Iterable[_Union[NTPServer, _Mapping]]] = ..., mgmt_service_addresses: _Optional[_Iterable[str]] = ...) -> None: ... - -class PartitionQuery(_message.Message): - __slots__ = ("id", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - labels: _common_pb2.Labels - def __init__(self, id: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class PartitionBootConfiguration(_message.Message): - __slots__ = ("image_url", "kernel_url", "commandline") - IMAGE_URL_FIELD_NUMBER: _ClassVar[int] - KERNEL_URL_FIELD_NUMBER: _ClassVar[int] - COMMANDLINE_FIELD_NUMBER: _ClassVar[int] - image_url: str - kernel_url: str - commandline: str - def __init__(self, image_url: _Optional[str] = ..., kernel_url: _Optional[str] = ..., commandline: _Optional[str] = ...) -> None: ... - -class DNSServer(_message.Message): - __slots__ = ("ip",) - IP_FIELD_NUMBER: _ClassVar[int] - ip: str - def __init__(self, ip: _Optional[str] = ...) -> None: ... - -class NTPServer(_message.Message): - __slots__ = ("address",) - ADDRESS_FIELD_NUMBER: _ClassVar[int] - address: str - def __init__(self, address: _Optional[str] = ...) -> None: ... - -class PartitionServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class PartitionServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: PartitionQuery - def __init__(self, query: _Optional[_Union[PartitionQuery, _Mapping]] = ...) -> None: ... - -class PartitionServiceGetResponse(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: Partition - def __init__(self, partition: _Optional[_Union[Partition, _Mapping]] = ...) -> None: ... - -class PartitionServiceListResponse(_message.Message): - __slots__ = ("partitions",) - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - partitions: _containers.RepeatedCompositeFieldContainer[Partition] - def __init__(self, partitions: _Optional[_Iterable[_Union[Partition, _Mapping]]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/predefined_rules_pb.py b/python/metalstack/api/v2/predefined_rules_pb.py new file mode 100644 index 00000000..48cb602f --- /dev/null +++ b/python/metalstack/api/v2/predefined_rules_pb.py @@ -0,0 +1,244 @@ +# Generated from metalstack/api/v2/predefined_rules.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Final, TYPE_CHECKING + +from protobuf import Extension +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ....buf.validate.validate_pb import MapRules, RepeatedRules, StringRules + +if TYPE_CHECKING: + from protobuf import DescFile + + +ext_macaddress: Final[Extension[StringRules, bool]] = Extension() +""" +Macaddress returns true if the given string is a valid macaddress + +```proto +extend buf.validate.StringRules { optional bool macaddress = 80048951 [json_name = "[metalstack.api.v2.macaddress]"] } +``` +""" + +ext_is_name: Final[Extension[StringRules, bool]] = Extension() +""" +IsName returns true if name field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_name = 80048952 [json_name = "[metalstack.api.v2.is_name]"] } +``` +""" + +ext_is_description: Final[Extension[StringRules, bool]] = Extension() +""" +IsDescription returns true if description field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_description = 80048953 [json_name = "[metalstack.api.v2.is_description]"] } +``` +""" + +ext_is_partition: Final[Extension[StringRules, bool]] = Extension() +""" +IsPartition returns true if partition field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_partition = 80048954 [json_name = "[metalstack.api.v2.is_partition]"] } +``` +""" + +ext_is_prefix: Final[Extension[StringRules, bool]] = Extension() +""" +IsPrefix validates if the given string is a valid prefix + +```proto +extend buf.validate.StringRules { optional bool is_prefix = 80048955 [json_name = "[metalstack.api.v2.is_prefix]"] } +``` +""" + +ext_is_uri: Final[Extension[StringRules, bool]] = Extension() +""" +IsUri validates if the given string is a valid URI + +```proto +extend buf.validate.StringRules { optional bool is_uri = 80048956 [json_name = "[metalstack.api.v2.is_uri]"] } +``` +""" + +ext_is_ip_or_hostname: Final[Extension[StringRules, bool]] = Extension() +""" +IsIpOrHostname validates that the given string is either a ip or a hostname + +```proto +extend buf.validate.StringRules { optional bool is_ip_or_hostname = 80048957 [json_name = "[metalstack.api.v2.is_ip_or_hostname]"] } +``` +""" + +ext_trimmed: Final[Extension[StringRules, bool]] = Extension() +""" +Trimmed enforces the string to be trimmed, e.g. no whitespaces at the begin and end + +```proto +extend buf.validate.StringRules { optional bool trimmed = 80048958 [json_name = "[metalstack.api.v2.trimmed]"] } +``` +""" + +ext_is_user: Final[Extension[StringRules, bool]] = Extension() +""" +IsUser returns true if name field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_user = 80048959 [json_name = "[metalstack.api.v2.is_user]"] } +``` +""" + +ext_is_option: Final[Extension[StringRules, bool]] = Extension() +""" +IsOption returns true if name field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_option = 80048960 [json_name = "[metalstack.api.v2.is_option]"] } +``` +""" + +ext_is_key: Final[Extension[StringRules, bool]] = Extension() +""" +IsKey returns true if name field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_key = 80048961 [json_name = "[metalstack.api.v2.is_key]"] } +``` +""" + +ext_is_tenant_login: Final[Extension[StringRules, bool]] = Extension() +""" +IsTenantLogin returns true if name field satisfies our requirements + +```proto +extend buf.validate.StringRules { optional bool is_tenant_login = 80048962 [json_name = "[metalstack.api.v2.is_tenant_login]"] } +``` +""" + +ext_prefixes: Final[Extension[RepeatedRules, bool]] = Extension() +""" +Prefixes validates if a slice of prefixes in string form are valid + +```proto +extend buf.validate.RepeatedRules { optional bool prefixes = 80058951 [json_name = "[metalstack.api.v2.prefixes]"] } +``` +""" + +ext_ips: Final[Extension[RepeatedRules, bool]] = Extension() +""" +Ips validates if a slice of ips in string form are valid + +```proto +extend buf.validate.RepeatedRules { optional bool ips = 80058952 [json_name = "[metalstack.api.v2.ips]"] } +``` +""" + +ext_are_host_and_port: Final[Extension[RepeatedRules, bool]] = Extension() +""" +AreHostAndPort validates if a slice of strings are all in the form of : + +```proto +extend buf.validate.RepeatedRules { optional bool are_host_and_port = 80058953 [json_name = "[metalstack.api.v2.are_host_and_port]"] } +``` +""" + +ext_all_trimmed: Final[Extension[RepeatedRules, bool]] = Extension() +""" +All Trimmed enforces all strings to be trimmed, e.g. no whitespaces at the begin and end + +```proto +extend buf.validate.RepeatedRules { optional bool all_trimmed = 80058954 [json_name = "[metalstack.api.v2.all_trimmed]"] } +``` +""" + +ext_keys_and_values_trimmed: Final[Extension[MapRules, bool]] = Extension() +""" +Keys and Values trimmed enforces all map keys and values to be trimmed, e.g. no whitespaces at the begin and end + +```proto +extend buf.validate.MapRules { optional bool keys_and_values_trimmed = 80068951 [json_name = "[metalstack.api.v2.keys_and_values_trimmed]"] } +``` +""" + +ext_keys_trimmed: Final[Extension[MapRules, bool]] = Extension() +""" +Keys trimmed enforces all map keys and values to be trimmed, e.g. no whitespaces at the begin and end + +```proto +extend buf.validate.MapRules { optional bool keys_trimmed = 80068952 [json_name = "[metalstack.api.v2.keys_trimmed]"] } +``` +""" + +ext_project_roles_keys_valid: Final[Extension[MapRules, bool]] = Extension() +""" +ProjectRolesKeysValid ensures that project roles keys met our requirements + +```proto +extend buf.validate.MapRules { optional bool project_roles_keys_valid = 80068953 [json_name = "[metalstack.api.v2.project_roles_keys_valid]"] } +``` +""" + +ext_tenant_roles_keys_valid: Final[Extension[MapRules, bool]] = Extension() +""" +TenantRolesKeysValid ensures that tenant roles keys met our requirements + +```proto +extend buf.validate.MapRules { optional bool tenant_roles_keys_valid = 80068954 [json_name = "[metalstack.api.v2.tenant_roles_keys_valid]"] } +``` +""" + +ext_machine_roles_keys_valid: Final[Extension[MapRules, bool]] = Extension() +""" +MachineRolesKeysValid ensures that machine roles keys met our requirements + +```proto +extend buf.validate.MapRules { optional bool machine_roles_keys_valid = 80068955 [json_name = "[metalstack.api.v2.machine_roles_keys_valid]"] } +``` +""" + + +_DESC = file_desc( + b"\n(metalstack/api/v2/predefined_rules.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto:\xb8\x01\n\nmacaddress\x18\xb7\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\nmacaddressBz\xc2Hw\nu\n\x11string.macaddress\x12&this string must be a valid macaddress\x1a8this.matches('^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$'):\x99\x01\n\x07is_name\x18\xb8\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x06isNameBb\xc2H_\n]\n\x0estring.is_name\x12#must be within 2 and 128 characters\x1a&this.size() >= 2 && this.size() <= 128:\x9a\x01\n\x0eis_description\x18\xb9\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\risDescriptionBU\xc2HR\nP\n\x15string.is_description\x12#must be shorter than 256 characters\x1a\x12this.size() <= 256:\xa8\x01\n\x0cis_partition\x18\xba\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x0bisPartitionBg\xc2Hd\nb\n\x13string.is_partition\x12#must be within 2 and 128 characters\x1a&this.size() >= 2 && this.size() <= 128:\x82\x01\n\tis_prefix\x18\xbb\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x08isPrefixBG\xc2HD\nB\n\x0fstring.prefixes\x12\x1cgiven prefixes must be valid\x1a\x11this.isIpPrefix():m\n\x06is_uri\x18\xbc\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x05isUriB8\xc2H5\n3\n\nstring.uri\x12\x17given uri must be valid\x1a\x0cthis.isUri():\xa7\x01\n\x11is_ip_or_hostname\x18\xbd\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x0eisIpOrHostnameB^\xc2H[\nY\n\rvalid_address\x12&must be a valid IP address or hostname\x1a this.isIp() || this.isHostname():\x9d\x01\n\x07trimmed\x18\xbe\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x07trimmedBe\xc2Hb\n`\n\x0estring.trimmed\x12+value must not start or end with whitespace\x1a!this.trim().size() == this.size():\x99\x01\n\x07is_user\x18\xbf\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x06isUserBb\xc2H_\n]\n\x0estring.is_user\x12#must be within 2 and 512 characters\x1a&this.size() >= 2 && this.size() <= 512:\x9f\x01\n\tis_option\x18\xc0\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x08isOptionBd\xc2Ha\n_\n\x10string.is_option\x12#must be within 1 and 128 characters\x1a&this.size() >= 1 && this.size() <= 128:\x98\x01\n\x06is_key\x18\xc1\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\x05isKeyBc\xc2H`\n^\n\rstring.is_key\x12$must be within 1 and 8192 characters\x1a'this.size() >= 1 && this.size() <= 8192:\xb0\x01\n\x0fis_tenant_login\x18\xc2\xe6\x95& \x01(\x08\x12\x19.buf.validate.StringRulesR\risTenantLoginBj\xc2Hg\ne\n\x16string.is_tenant_login\x12#must be within 2 and 256 characters\x1a&this.size() >= 2 && this.size() <= 256:\x8f\x01\n\x08prefixes\x18\xc7\xb4\x96& \x01(\x08\x12\x1b.buf.validate.RepeatedRulesR\x08prefixesBS\xc2HP\nN\n\x11repeated.prefixes\x12\x1cgiven prefixes must be valid\x1a\x1bthis.all(m, m.isIpPrefix()):u\n\x03ips\x18\xc8\xb4\x96& \x01(\x08\x12\x1b.buf.validate.RepeatedRulesR\x03ipsBC\xc2H@\n>\n\x0crepeated.ips\x12\x17given ips must be valid\x1a\x15this.all(m, m.isIp()):\xe6\x01\n\x11are_host_and_port\x18\xc9\xb4\x96& \x01(\x08\x12\x1b.buf.validate.RepeatedRulesR\x0eareHostAndPortB\x9a\x01\xc2H\x96\x01\n\x93\x01\n\x1arepeated.are_host_and_port\x12Pgiven entries must all be in the form of : but port is optional\x1a#this.all(m, m.isHostAndPort(false)):\xba\x01\n\x0ball_trimmed\x18\xca\xb4\x96& \x01(\x08\x12\x1b.buf.validate.RepeatedRulesR\nallTrimmedBy\xc2Hv\nt\n\x14repeated.all_trimmed\x122given values must not start or end with whitespace\x1a(this.all(m, m.trim().size() == m.size()):\x84\x02\n\x17keys_and_values_trimmed\x18\xd7\x82\x97& \x01(\x08\x12\x16.buf.validate.MapRulesR\x14keysAndValuesTrimmedB\xb1\x01\xc2H\xad\x01\n\xaa\x01\n\x1bmap.keys_and_values_trimmed\x125keys and values must not start or end with whitespace\x1aTthis.all(k, k.trim().size() == k.size()) && this.all(v, v.trim().size() == v.size()):\xab\x01\n\x0ckeys_trimmed\x18\xd8\x82\x97& \x01(\x08\x12\x16.buf.validate.MapRulesR\x0bkeysTrimmedBm\xc2Hj\nh\n\x10map.keys_trimmed\x12*keys must not start or end with whitespace\x1a(this.all(k, k.trim().size() == k.size()):\x92\x02\n\x18project_roles_keys_valid\x18\xd9\x82\x97& \x01(\x08\x12\x16.buf.validate.MapRulesR\x15projectRolesKeysValidB\xbd\x01\xc2H\xb9\x01\n\xb6\x01\n\x17project_roles.key.valid\x12&subject must be a '*', or a valid UUID\x1asthis.all(k, k == '*' || k.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')):\xe8\x01\n\x17tenant_roles_keys_valid\x18\xda\x82\x97& \x01(\x08\x12\x16.buf.validate.MapRulesR\x14tenantRolesKeysValidB\x95\x01\xc2H\x91\x01\n\x8e\x01\n\x16tenant_roles.key.valid\x123subject must be '*' or between 2 and 128 characters\x1a?this.all(k, k == '*' || this.size() >= 2 || this.size() <=128 ):\xa9\x02\n\x18machine_roles_keys_valid\x18\xdb\x82\x97& \x01(\x08\x12\x16.buf.validate.MapRulesR\x15machineRolesKeysValidB\xd4\x01\xc2H\xd0\x01\n\xcd\x01\n\x17machine_roles.key.valid\x122subject must be empty string, '*', or a valid UUID\x1a~this.all(k, k == '' || k == '*' || k.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'))B\xca\x01\n\x15com.metalstack.api.v2B\x14PredefinedRulesProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2", + [ + validate_pb.desc(), + ], + { + "macaddress": ext_macaddress, + "is_name": ext_is_name, + "is_description": ext_is_description, + "is_partition": ext_is_partition, + "is_prefix": ext_is_prefix, + "is_uri": ext_is_uri, + "is_ip_or_hostname": ext_is_ip_or_hostname, + "trimmed": ext_trimmed, + "is_user": ext_is_user, + "is_option": ext_is_option, + "is_key": ext_is_key, + "is_tenant_login": ext_is_tenant_login, + "prefixes": ext_prefixes, + "ips": ext_ips, + "are_host_and_port": ext_are_host_and_port, + "all_trimmed": ext_all_trimmed, + "keys_and_values_trimmed": ext_keys_and_values_trimmed, + "keys_trimmed": ext_keys_trimmed, + "project_roles_keys_valid": ext_project_roles_keys_valid, + "tenant_roles_keys_valid": ext_tenant_roles_keys_valid, + "machine_roles_keys_valid": ext_machine_roles_keys_valid, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/predefined_rules.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/predefined_rules_pb2.py b/python/metalstack/api/v2/predefined_rules_pb2.py deleted file mode 100644 index b1e5a8c9..00000000 --- a/python/metalstack/api/v2/predefined_rules_pb2.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/predefined_rules.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/predefined_rules.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(metalstack/api/v2/predefined_rules.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto:\xb8\x01\n\nmacaddress\x12\x19.buf.validate.StringRules\x18\xb7\xe6\x95& \x01(\x08\x42z\xc2Hw\nu\n\x11string.macaddress\x12&this string must be a valid macaddress\x1a\x38this.matches(\'^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$\')R\nmacaddress:\x99\x01\n\x07is_name\x12\x19.buf.validate.StringRules\x18\xb8\xe6\x95& \x01(\x08\x42\x62\xc2H_\n]\n\x0estring.is_name\x12#must be within 2 and 128 characters\x1a&this.size() >= 2 && this.size() <= 128R\x06isName:\x9a\x01\n\x0eis_description\x12\x19.buf.validate.StringRules\x18\xb9\xe6\x95& \x01(\x08\x42U\xc2HR\nP\n\x15string.is_description\x12#must be shorter than 256 characters\x1a\x12this.size() <= 256R\risDescription:\xa8\x01\n\x0cis_partition\x12\x19.buf.validate.StringRules\x18\xba\xe6\x95& \x01(\x08\x42g\xc2Hd\nb\n\x13string.is_partition\x12#must be within 2 and 128 characters\x1a&this.size() >= 2 && this.size() <= 128R\x0bisPartition:\x82\x01\n\tis_prefix\x12\x19.buf.validate.StringRules\x18\xbb\xe6\x95& \x01(\x08\x42G\xc2HD\nB\n\x0fstring.prefixes\x12\x1cgiven prefixes must be valid\x1a\x11this.isIpPrefix()R\x08isPrefix:m\n\x06is_uri\x12\x19.buf.validate.StringRules\x18\xbc\xe6\x95& \x01(\x08\x42\x38\xc2H5\n3\n\nstring.uri\x12\x17given uri must be valid\x1a\x0cthis.isUri()R\x05isUri:\xa7\x01\n\x11is_ip_or_hostname\x12\x19.buf.validate.StringRules\x18\xbd\xe6\x95& \x01(\x08\x42^\xc2H[\nY\n\rvalid_address\x12&must be a valid IP address or hostname\x1a this.isIp() || this.isHostname()R\x0eisIpOrHostname:\x9d\x01\n\x07trimmed\x12\x19.buf.validate.StringRules\x18\xbe\xe6\x95& \x01(\x08\x42\x65\xc2Hb\n`\n\x0estring.trimmed\x12+value must not start or end with whitespace\x1a!this.trim().size() == this.size()R\x07trimmed:\x99\x01\n\x07is_user\x12\x19.buf.validate.StringRules\x18\xbf\xe6\x95& \x01(\x08\x42\x62\xc2H_\n]\n\x0estring.is_user\x12#must be within 2 and 512 characters\x1a&this.size() >= 2 && this.size() <= 512R\x06isUser:\x9f\x01\n\tis_option\x12\x19.buf.validate.StringRules\x18\xc0\xe6\x95& \x01(\x08\x42\x64\xc2Ha\n_\n\x10string.is_option\x12#must be within 1 and 128 characters\x1a&this.size() >= 1 && this.size() <= 128R\x08isOption:\x98\x01\n\x06is_key\x12\x19.buf.validate.StringRules\x18\xc1\xe6\x95& \x01(\x08\x42\x63\xc2H`\n^\n\rstring.is_key\x12$must be within 1 and 8192 characters\x1a\'this.size() >= 1 && this.size() <= 8192R\x05isKey:\xb0\x01\n\x0fis_tenant_login\x12\x19.buf.validate.StringRules\x18\xc2\xe6\x95& \x01(\x08\x42j\xc2Hg\ne\n\x16string.is_tenant_login\x12#must be within 2 and 256 characters\x1a&this.size() >= 2 && this.size() <= 256R\risTenantLogin:\x8f\x01\n\x08prefixes\x12\x1b.buf.validate.RepeatedRules\x18\xc7\xb4\x96& \x01(\x08\x42S\xc2HP\nN\n\x11repeated.prefixes\x12\x1cgiven prefixes must be valid\x1a\x1bthis.all(m, m.isIpPrefix())R\x08prefixes:u\n\x03ips\x12\x1b.buf.validate.RepeatedRules\x18\xc8\xb4\x96& \x01(\x08\x42\x43\xc2H@\n>\n\x0crepeated.ips\x12\x17given ips must be valid\x1a\x15this.all(m, m.isIp())R\x03ips:\xe6\x01\n\x11\x61re_host_and_port\x12\x1b.buf.validate.RepeatedRules\x18\xc9\xb4\x96& \x01(\x08\x42\x9a\x01\xc2H\x96\x01\n\x93\x01\n\x1arepeated.are_host_and_port\x12Pgiven entries must all be in the form of : but port is optional\x1a#this.all(m, m.isHostAndPort(false))R\x0e\x61reHostAndPort:\xba\x01\n\x0b\x61ll_trimmed\x12\x1b.buf.validate.RepeatedRules\x18\xca\xb4\x96& \x01(\x08\x42y\xc2Hv\nt\n\x14repeated.all_trimmed\x12\x32given values must not start or end with whitespace\x1a(this.all(m, m.trim().size() == m.size())R\nallTrimmed:\x84\x02\n\x17keys_and_values_trimmed\x12\x16.buf.validate.MapRules\x18\xd7\x82\x97& \x01(\x08\x42\xb1\x01\xc2H\xad\x01\n\xaa\x01\n\x1bmap.keys_and_values_trimmed\x12\x35keys and values must not start or end with whitespace\x1aTthis.all(k, k.trim().size() == k.size()) && this.all(v, v.trim().size() == v.size())R\x14keysAndValuesTrimmed:\xab\x01\n\x0ckeys_trimmed\x12\x16.buf.validate.MapRules\x18\xd8\x82\x97& \x01(\x08\x42m\xc2Hj\nh\n\x10map.keys_trimmed\x12*keys must not start or end with whitespace\x1a(this.all(k, k.trim().size() == k.size())R\x0bkeysTrimmed:\x92\x02\n\x18project_roles_keys_valid\x12\x16.buf.validate.MapRules\x18\xd9\x82\x97& \x01(\x08\x42\xbd\x01\xc2H\xb9\x01\n\xb6\x01\n\x17project_roles.key.valid\x12&subject must be a \'*\', or a valid UUID\x1asthis.all(k, k == \'*\' || k.matches(\'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\'))R\x15projectRolesKeysValid:\xe8\x01\n\x17tenant_roles_keys_valid\x12\x16.buf.validate.MapRules\x18\xda\x82\x97& \x01(\x08\x42\x95\x01\xc2H\x91\x01\n\x8e\x01\n\x16tenant_roles.key.valid\x12\x33subject must be \'*\' or between 2 and 128 characters\x1a?this.all(k, k == \'*\' || this.size() >= 2 || this.size() <=128 )R\x14tenantRolesKeysValid:\xa9\x02\n\x18machine_roles_keys_valid\x12\x16.buf.validate.MapRules\x18\xdb\x82\x97& \x01(\x08\x42\xd4\x01\xc2H\xd0\x01\n\xcd\x01\n\x17machine_roles.key.valid\x12\x32subject must be empty string, \'*\', or a valid UUID\x1a~this.all(k, k == \'\' || k == \'*\' || k.matches(\'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\'))R\x15machineRolesKeysValidB\xca\x01\n\x15\x63om.metalstack.api.v2B\x14PredefinedRulesProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.predefined_rules_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\024PredefinedRulesProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['macaddress']._loaded_options = None - _globals['macaddress']._serialized_options = b'\302Hw\nu\n\021string.macaddress\022&this string must be a valid macaddress\0328this.matches(\'^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$\')' - _globals['is_name']._loaded_options = None - _globals['is_name']._serialized_options = b'\302H_\n]\n\016string.is_name\022#must be within 2 and 128 characters\032&this.size() >= 2 && this.size() <= 128' - _globals['is_description']._loaded_options = None - _globals['is_description']._serialized_options = b'\302HR\nP\n\025string.is_description\022#must be shorter than 256 characters\032\022this.size() <= 256' - _globals['is_partition']._loaded_options = None - _globals['is_partition']._serialized_options = b'\302Hd\nb\n\023string.is_partition\022#must be within 2 and 128 characters\032&this.size() >= 2 && this.size() <= 128' - _globals['is_prefix']._loaded_options = None - _globals['is_prefix']._serialized_options = b'\302HD\nB\n\017string.prefixes\022\034given prefixes must be valid\032\021this.isIpPrefix()' - _globals['is_uri']._loaded_options = None - _globals['is_uri']._serialized_options = b'\302H5\n3\n\nstring.uri\022\027given uri must be valid\032\014this.isUri()' - _globals['is_ip_or_hostname']._loaded_options = None - _globals['is_ip_or_hostname']._serialized_options = b'\302H[\nY\n\rvalid_address\022&must be a valid IP address or hostname\032 this.isIp() || this.isHostname()' - _globals['trimmed']._loaded_options = None - _globals['trimmed']._serialized_options = b'\302Hb\n`\n\016string.trimmed\022+value must not start or end with whitespace\032!this.trim().size() == this.size()' - _globals['is_user']._loaded_options = None - _globals['is_user']._serialized_options = b'\302H_\n]\n\016string.is_user\022#must be within 2 and 512 characters\032&this.size() >= 2 && this.size() <= 512' - _globals['is_option']._loaded_options = None - _globals['is_option']._serialized_options = b'\302Ha\n_\n\020string.is_option\022#must be within 1 and 128 characters\032&this.size() >= 1 && this.size() <= 128' - _globals['is_key']._loaded_options = None - _globals['is_key']._serialized_options = b'\302H`\n^\n\rstring.is_key\022$must be within 1 and 8192 characters\032\'this.size() >= 1 && this.size() <= 8192' - _globals['is_tenant_login']._loaded_options = None - _globals['is_tenant_login']._serialized_options = b'\302Hg\ne\n\026string.is_tenant_login\022#must be within 2 and 256 characters\032&this.size() >= 2 && this.size() <= 256' - _globals['prefixes']._loaded_options = None - _globals['prefixes']._serialized_options = b'\302HP\nN\n\021repeated.prefixes\022\034given prefixes must be valid\032\033this.all(m, m.isIpPrefix())' - _globals['ips']._loaded_options = None - _globals['ips']._serialized_options = b'\302H@\n>\n\014repeated.ips\022\027given ips must be valid\032\025this.all(m, m.isIp())' - _globals['are_host_and_port']._loaded_options = None - _globals['are_host_and_port']._serialized_options = b'\302H\226\001\n\223\001\n\032repeated.are_host_and_port\022Pgiven entries must all be in the form of : but port is optional\032#this.all(m, m.isHostAndPort(false))' - _globals['all_trimmed']._loaded_options = None - _globals['all_trimmed']._serialized_options = b'\302Hv\nt\n\024repeated.all_trimmed\0222given values must not start or end with whitespace\032(this.all(m, m.trim().size() == m.size())' - _globals['keys_and_values_trimmed']._loaded_options = None - _globals['keys_and_values_trimmed']._serialized_options = b'\302H\255\001\n\252\001\n\033map.keys_and_values_trimmed\0225keys and values must not start or end with whitespace\032Tthis.all(k, k.trim().size() == k.size()) && this.all(v, v.trim().size() == v.size())' - _globals['keys_trimmed']._loaded_options = None - _globals['keys_trimmed']._serialized_options = b'\302Hj\nh\n\020map.keys_trimmed\022*keys must not start or end with whitespace\032(this.all(k, k.trim().size() == k.size())' - _globals['project_roles_keys_valid']._loaded_options = None - _globals['project_roles_keys_valid']._serialized_options = b'\302H\271\001\n\266\001\n\027project_roles.key.valid\022&subject must be a \'*\', or a valid UUID\032sthis.all(k, k == \'*\' || k.matches(\'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\'))' - _globals['tenant_roles_keys_valid']._loaded_options = None - _globals['tenant_roles_keys_valid']._serialized_options = b'\302H\221\001\n\216\001\n\026tenant_roles.key.valid\0223subject must be \'*\' or between 2 and 128 characters\032?this.all(k, k == \'*\' || this.size() >= 2 || this.size() <=128 )' - _globals['machine_roles_keys_valid']._loaded_options = None - _globals['machine_roles_keys_valid']._serialized_options = b'\302H\320\001\n\315\001\n\027machine_roles.key.valid\0222subject must be empty string, \'*\', or a valid UUID\032~this.all(k, k == \'\' || k == \'*\' || k.matches(\'^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\'))' -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/predefined_rules_pb2.pyi b/python/metalstack/api/v2/predefined_rules_pb2.pyi deleted file mode 100644 index f76fae01..00000000 --- a/python/metalstack/api/v2/predefined_rules_pb2.pyi +++ /dev/null @@ -1,47 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import descriptor as _descriptor -from typing import ClassVar as _ClassVar - -DESCRIPTOR: _descriptor.FileDescriptor -MACADDRESS_FIELD_NUMBER: _ClassVar[int] -macaddress: _descriptor.FieldDescriptor -IS_NAME_FIELD_NUMBER: _ClassVar[int] -is_name: _descriptor.FieldDescriptor -IS_DESCRIPTION_FIELD_NUMBER: _ClassVar[int] -is_description: _descriptor.FieldDescriptor -IS_PARTITION_FIELD_NUMBER: _ClassVar[int] -is_partition: _descriptor.FieldDescriptor -IS_PREFIX_FIELD_NUMBER: _ClassVar[int] -is_prefix: _descriptor.FieldDescriptor -IS_URI_FIELD_NUMBER: _ClassVar[int] -is_uri: _descriptor.FieldDescriptor -IS_IP_OR_HOSTNAME_FIELD_NUMBER: _ClassVar[int] -is_ip_or_hostname: _descriptor.FieldDescriptor -TRIMMED_FIELD_NUMBER: _ClassVar[int] -trimmed: _descriptor.FieldDescriptor -IS_USER_FIELD_NUMBER: _ClassVar[int] -is_user: _descriptor.FieldDescriptor -IS_OPTION_FIELD_NUMBER: _ClassVar[int] -is_option: _descriptor.FieldDescriptor -IS_KEY_FIELD_NUMBER: _ClassVar[int] -is_key: _descriptor.FieldDescriptor -IS_TENANT_LOGIN_FIELD_NUMBER: _ClassVar[int] -is_tenant_login: _descriptor.FieldDescriptor -PREFIXES_FIELD_NUMBER: _ClassVar[int] -prefixes: _descriptor.FieldDescriptor -IPS_FIELD_NUMBER: _ClassVar[int] -ips: _descriptor.FieldDescriptor -ARE_HOST_AND_PORT_FIELD_NUMBER: _ClassVar[int] -are_host_and_port: _descriptor.FieldDescriptor -ALL_TRIMMED_FIELD_NUMBER: _ClassVar[int] -all_trimmed: _descriptor.FieldDescriptor -KEYS_AND_VALUES_TRIMMED_FIELD_NUMBER: _ClassVar[int] -keys_and_values_trimmed: _descriptor.FieldDescriptor -KEYS_TRIMMED_FIELD_NUMBER: _ClassVar[int] -keys_trimmed: _descriptor.FieldDescriptor -PROJECT_ROLES_KEYS_VALID_FIELD_NUMBER: _ClassVar[int] -project_roles_keys_valid: _descriptor.FieldDescriptor -TENANT_ROLES_KEYS_VALID_FIELD_NUMBER: _ClassVar[int] -tenant_roles_keys_valid: _descriptor.FieldDescriptor -MACHINE_ROLES_KEYS_VALID_FIELD_NUMBER: _ClassVar[int] -machine_roles_keys_valid: _descriptor.FieldDescriptor diff --git a/python/metalstack/api/v2/project_connect.py b/python/metalstack/api/v2/project_connect.py index 183dad9f..899d05c2 100644 --- a/python/metalstack/api/v2/project_connect.py +++ b/python/metalstack/api/v2/project_connect.py @@ -1,68 +1,84 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/project.proto +# Generated from metalstack/api/v2/project.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.project_pb2 as metalstack_dot_api_dot_v2_dot_project__pb2 + +from .project_pb import ProjectServiceAddMemberRequest, ProjectServiceAddMemberResponse, ProjectServiceCreateRequest, ProjectServiceCreateResponse, ProjectServiceDeleteRequest, ProjectServiceDeleteResponse, ProjectServiceGetRequest, ProjectServiceGetResponse, ProjectServiceInviteAcceptRequest, ProjectServiceInviteAcceptResponse, ProjectServiceInviteDeleteRequest, ProjectServiceInviteDeleteResponse, ProjectServiceInviteGetRequest, ProjectServiceInviteGetResponse, ProjectServiceInviteRequest, ProjectServiceInviteResponse, ProjectServiceInvitesListRequest, ProjectServiceInvitesListResponse, ProjectServiceLeaveRequest, ProjectServiceLeaveResponse, ProjectServiceListRequest, ProjectServiceListResponse, ProjectServiceRemoveMemberRequest, ProjectServiceRemoveMemberResponse, ProjectServiceUpdateMemberRequest, ProjectServiceUpdateMemberResponse, ProjectServiceUpdateRequest, ProjectServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ProjectService(Protocol): - async def list(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: ProjectServiceListRequest, ctx: RequestContext[ProjectServiceListRequest, ProjectServiceListResponse]) -> ProjectServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def get(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: ProjectServiceGetRequest, ctx: RequestContext[ProjectServiceGetRequest, ProjectServiceGetResponse]) -> ProjectServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: ProjectServiceCreateRequest, ctx: RequestContext[ProjectServiceCreateRequest, ProjectServiceCreateResponse]) -> ProjectServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: ProjectServiceDeleteRequest, ctx: RequestContext[ProjectServiceDeleteRequest, ProjectServiceDeleteResponse]) -> ProjectServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: ProjectServiceUpdateRequest, ctx: RequestContext[ProjectServiceUpdateRequest, ProjectServiceUpdateResponse]) -> ProjectServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def leave(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def leave(self, request: ProjectServiceLeaveRequest, ctx: RequestContext[ProjectServiceLeaveRequest, ProjectServiceLeaveResponse]) -> ProjectServiceLeaveResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def add_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def add_member(self, request: ProjectServiceAddMemberRequest, ctx: RequestContext[ProjectServiceAddMemberRequest, ProjectServiceAddMemberResponse]) -> ProjectServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def remove_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def remove_member(self, request: ProjectServiceRemoveMemberRequest, ctx: RequestContext[ProjectServiceRemoveMemberRequest, ProjectServiceRemoveMemberResponse]) -> ProjectServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update_member(self, request: ProjectServiceUpdateMemberRequest, ctx: RequestContext[ProjectServiceUpdateMemberRequest, ProjectServiceUpdateMemberResponse]) -> ProjectServiceUpdateMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite(self, request: ProjectServiceInviteRequest, ctx: RequestContext[ProjectServiceInviteRequest, ProjectServiceInviteResponse]) -> ProjectServiceInviteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_accept(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_accept(self, request: ProjectServiceInviteAcceptRequest, ctx: RequestContext[ProjectServiceInviteAcceptRequest, ProjectServiceInviteAcceptResponse]) -> ProjectServiceInviteAcceptResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_delete(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_delete(self, request: ProjectServiceInviteDeleteRequest, ctx: RequestContext[ProjectServiceInviteDeleteRequest, ProjectServiceInviteDeleteResponse]) -> ProjectServiceInviteDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invites_list(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invites_list(self, request: ProjectServiceInvitesListRequest, ctx: RequestContext[ProjectServiceInvitesListRequest, ProjectServiceInvitesListResponse]) -> ProjectServiceInvitesListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_get(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_get(self, request: ProjectServiceInviteGetRequest, ctx: RequestContext[ProjectServiceInviteGetRequest, ProjectServiceInviteGetResponse]) -> ProjectServiceInviteGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ProjectServiceASGIApplication(ConnectASGIApplication[ProjectService]): - def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ProjectService | AsyncGenerator[ProjectService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -70,8 +86,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="List", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -80,8 +96,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Get", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse, + input=ProjectServiceGetRequest, + output=ProjectServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -90,8 +106,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Create", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse, + input=ProjectServiceCreateRequest, + output=ProjectServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -100,8 +116,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse, + input=ProjectServiceDeleteRequest, + output=ProjectServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -110,8 +126,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Update", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse, + input=ProjectServiceUpdateRequest, + output=ProjectServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -120,8 +136,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Leave", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse, + input=ProjectServiceLeaveRequest, + output=ProjectServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.leave, @@ -130,8 +146,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse, + input=ProjectServiceAddMemberRequest, + output=ProjectServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.add_member, @@ -140,8 +156,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse, + input=ProjectServiceRemoveMemberRequest, + output=ProjectServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.remove_member, @@ -150,8 +166,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse, + input=ProjectServiceUpdateMemberRequest, + output=ProjectServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update_member, @@ -160,8 +176,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="Invite", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse, + input=ProjectServiceInviteRequest, + output=ProjectServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite, @@ -170,8 +186,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse, + input=ProjectServiceInviteAcceptRequest, + output=ProjectServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_accept, @@ -180,8 +196,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse, + input=ProjectServiceInviteDeleteRequest, + output=ProjectServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_delete, @@ -190,8 +206,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse, + input=ProjectServiceInvitesListRequest, + output=ProjectServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invites_list, @@ -200,8 +216,8 @@ def __init__(self, service: ProjectService | AsyncGenerator[ProjectService], *, method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse, + input=ProjectServiceInviteGetRequest, + output=ProjectServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_get, @@ -222,18 +238,18 @@ def path(self) -> str: class ProjectServiceClient(ConnectClient): async def list( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, + request: ProjectServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse: + ) -> ProjectServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -242,18 +258,18 @@ async def list( async def get( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, + request: ProjectServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse: + ) -> ProjectServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse, + input=ProjectServiceGetRequest, + output=ProjectServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -262,18 +278,18 @@ async def get( async def create( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, + request: ProjectServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse: + ) -> ProjectServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse, + input=ProjectServiceCreateRequest, + output=ProjectServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -282,18 +298,18 @@ async def create( async def delete( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, + request: ProjectServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse: + ) -> ProjectServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse, + input=ProjectServiceDeleteRequest, + output=ProjectServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -302,18 +318,18 @@ async def delete( async def update( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, + request: ProjectServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse: + ) -> ProjectServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse, + input=ProjectServiceUpdateRequest, + output=ProjectServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -322,18 +338,18 @@ async def update( async def leave( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, + request: ProjectServiceLeaveRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse: + ) -> ProjectServiceLeaveResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Leave", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse, + input=ProjectServiceLeaveRequest, + output=ProjectServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -342,18 +358,18 @@ async def leave( async def add_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, + request: ProjectServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse: + ) -> ProjectServiceAddMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse, + input=ProjectServiceAddMemberRequest, + output=ProjectServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -362,18 +378,18 @@ async def add_member( async def remove_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, + request: ProjectServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse: + ) -> ProjectServiceRemoveMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse, + input=ProjectServiceRemoveMemberRequest, + output=ProjectServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -382,18 +398,18 @@ async def remove_member( async def update_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, + request: ProjectServiceUpdateMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse: + ) -> ProjectServiceUpdateMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse, + input=ProjectServiceUpdateMemberRequest, + output=ProjectServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -402,18 +418,18 @@ async def update_member( async def invite( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, + request: ProjectServiceInviteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse: + ) -> ProjectServiceInviteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Invite", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse, + input=ProjectServiceInviteRequest, + output=ProjectServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -422,18 +438,18 @@ async def invite( async def invite_accept( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, + request: ProjectServiceInviteAcceptRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse: + ) -> ProjectServiceInviteAcceptResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse, + input=ProjectServiceInviteAcceptRequest, + output=ProjectServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -442,18 +458,18 @@ async def invite_accept( async def invite_delete( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, + request: ProjectServiceInviteDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse: + ) -> ProjectServiceInviteDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse, + input=ProjectServiceInviteDeleteRequest, + output=ProjectServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -462,18 +478,18 @@ async def invite_delete( async def invites_list( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, + request: ProjectServiceInvitesListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse: + ) -> ProjectServiceInvitesListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse, + input=ProjectServiceInvitesListRequest, + output=ProjectServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -482,69 +498,85 @@ async def invites_list( async def invite_get( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, + request: ProjectServiceInviteGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse: + ) -> ProjectServiceInviteGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse, + input=ProjectServiceInviteGetRequest, + output=ProjectServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class ProjectServiceSync(Protocol): + def list(self, request: ProjectServiceListRequest, ctx: RequestContext[ProjectServiceListRequest, ProjectServiceListResponse]) -> ProjectServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def get(self, request: ProjectServiceGetRequest, ctx: RequestContext[ProjectServiceGetRequest, ProjectServiceGetResponse]) -> ProjectServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def create(self, request: ProjectServiceCreateRequest, ctx: RequestContext[ProjectServiceCreateRequest, ProjectServiceCreateResponse]) -> ProjectServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: ProjectServiceDeleteRequest, ctx: RequestContext[ProjectServiceDeleteRequest, ProjectServiceDeleteResponse]) -> ProjectServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: ProjectServiceUpdateRequest, ctx: RequestContext[ProjectServiceUpdateRequest, ProjectServiceUpdateResponse]) -> ProjectServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class ProjectServiceSync(Protocol): - def list(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def get(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def leave(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def add_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def remove_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update_member(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_accept(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_delete(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invites_list(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_get(self, request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def leave(self, request: ProjectServiceLeaveRequest, ctx: RequestContext[ProjectServiceLeaveRequest, ProjectServiceLeaveResponse]) -> ProjectServiceLeaveResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def add_member(self, request: ProjectServiceAddMemberRequest, ctx: RequestContext[ProjectServiceAddMemberRequest, ProjectServiceAddMemberResponse]) -> ProjectServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def remove_member(self, request: ProjectServiceRemoveMemberRequest, ctx: RequestContext[ProjectServiceRemoveMemberRequest, ProjectServiceRemoveMemberResponse]) -> ProjectServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def update_member(self, request: ProjectServiceUpdateMemberRequest, ctx: RequestContext[ProjectServiceUpdateMemberRequest, ProjectServiceUpdateMemberResponse]) -> ProjectServiceUpdateMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite(self, request: ProjectServiceInviteRequest, ctx: RequestContext[ProjectServiceInviteRequest, ProjectServiceInviteResponse]) -> ProjectServiceInviteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_accept(self, request: ProjectServiceInviteAcceptRequest, ctx: RequestContext[ProjectServiceInviteAcceptRequest, ProjectServiceInviteAcceptResponse]) -> ProjectServiceInviteAcceptResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_delete(self, request: ProjectServiceInviteDeleteRequest, ctx: RequestContext[ProjectServiceInviteDeleteRequest, ProjectServiceInviteDeleteResponse]) -> ProjectServiceInviteDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invites_list(self, request: ProjectServiceInvitesListRequest, ctx: RequestContext[ProjectServiceInvitesListRequest, ProjectServiceInvitesListResponse]) -> ProjectServiceInvitesListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_get(self, request: ProjectServiceInviteGetRequest, ctx: RequestContext[ProjectServiceInviteGetRequest, ProjectServiceInviteGetResponse]) -> ProjectServiceInviteGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ProjectServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ProjectServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ProjectServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.ProjectService/List": EndpointSync.unary( method=MethodInfo( name="List", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -553,8 +585,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Get", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse, + input=ProjectServiceGetRequest, + output=ProjectServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -563,8 +595,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Create", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse, + input=ProjectServiceCreateRequest, + output=ProjectServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -573,8 +605,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Delete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse, + input=ProjectServiceDeleteRequest, + output=ProjectServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -583,8 +615,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Update", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse, + input=ProjectServiceUpdateRequest, + output=ProjectServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -593,8 +625,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Leave", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse, + input=ProjectServiceLeaveRequest, + output=ProjectServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.leave, @@ -603,8 +635,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse, + input=ProjectServiceAddMemberRequest, + output=ProjectServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.add_member, @@ -613,8 +645,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse, + input=ProjectServiceRemoveMemberRequest, + output=ProjectServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.remove_member, @@ -623,8 +655,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse, + input=ProjectServiceUpdateMemberRequest, + output=ProjectServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update_member, @@ -633,8 +665,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="Invite", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse, + input=ProjectServiceInviteRequest, + output=ProjectServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite, @@ -643,8 +675,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse, + input=ProjectServiceInviteAcceptRequest, + output=ProjectServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_accept, @@ -653,8 +685,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse, + input=ProjectServiceInviteDeleteRequest, + output=ProjectServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_delete, @@ -663,8 +695,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse, + input=ProjectServiceInvitesListRequest, + output=ProjectServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invites_list, @@ -673,8 +705,8 @@ def __init__(self, service: ProjectServiceSync, interceptors: Iterable[Intercept method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse, + input=ProjectServiceInviteGetRequest, + output=ProjectServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_get, @@ -695,282 +727,267 @@ def path(self) -> str: class ProjectServiceClientSync(ConnectClientSync): def list( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, + request: ProjectServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse: + ) -> ProjectServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceListResponse, + input=ProjectServiceListRequest, + output=ProjectServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def get( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, + request: ProjectServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse: + ) -> ProjectServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceGetResponse, + input=ProjectServiceGetRequest, + output=ProjectServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, + request: ProjectServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse: + ) -> ProjectServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceCreateResponse, + input=ProjectServiceCreateRequest, + output=ProjectServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, + request: ProjectServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse: + ) -> ProjectServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceDeleteResponse, + input=ProjectServiceDeleteRequest, + output=ProjectServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, + request: ProjectServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse: + ) -> ProjectServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateResponse, + input=ProjectServiceUpdateRequest, + output=ProjectServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def leave( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, + request: ProjectServiceLeaveRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse: + ) -> ProjectServiceLeaveResponse: return self.execute_unary( request=request, method=MethodInfo( name="Leave", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceLeaveResponse, + input=ProjectServiceLeaveRequest, + output=ProjectServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def add_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, + request: ProjectServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse: + ) -> ProjectServiceAddMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceAddMemberResponse, + input=ProjectServiceAddMemberRequest, + output=ProjectServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def remove_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, + request: ProjectServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse: + ) -> ProjectServiceRemoveMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceRemoveMemberResponse, + input=ProjectServiceRemoveMemberRequest, + output=ProjectServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update_member( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, + request: ProjectServiceUpdateMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse: + ) -> ProjectServiceUpdateMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceUpdateMemberResponse, + input=ProjectServiceUpdateMemberRequest, + output=ProjectServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, + request: ProjectServiceInviteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse: + ) -> ProjectServiceInviteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Invite", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteResponse, + input=ProjectServiceInviteRequest, + output=ProjectServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_accept( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, + request: ProjectServiceInviteAcceptRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse: + ) -> ProjectServiceInviteAcceptResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteAcceptResponse, + input=ProjectServiceInviteAcceptRequest, + output=ProjectServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_delete( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, + request: ProjectServiceInviteDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse: + ) -> ProjectServiceInviteDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteDeleteResponse, + input=ProjectServiceInviteDeleteRequest, + output=ProjectServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invites_list( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, + request: ProjectServiceInvitesListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse: + ) -> ProjectServiceInvitesListResponse: return self.execute_unary( request=request, method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInvitesListResponse, + input=ProjectServiceInvitesListRequest, + output=ProjectServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_get( self, - request: metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, + request: ProjectServiceInviteGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse: + ) -> ProjectServiceInviteGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.ProjectService", - input=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_project__pb2.ProjectServiceInviteGetResponse, + input=ProjectServiceInviteGetRequest, + output=ProjectServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/project_pb.py b/python/metalstack/api/v2/project_pb.py new file mode 100644 index 00000000..1a1873f7 --- /dev/null +++ b/python/metalstack/api/v2/project_pb.py @@ -0,0 +1,1371 @@ +# Generated from metalstack/api/v2/project.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from .common_pb import Labels, Meta, ProjectRole, UpdateLabels, UpdateMeta + + +_ProjectFields: TypeAlias = Literal["uuid", "meta", "name", "description", "tenant", "avatar_url"] + +class Project(Message[_ProjectFields]): + """ + Project defines a group of resources belonging to a tenant + a tenant can have multiple projects + + ```proto + message metalstack.api.v2.Project + ``` + + Attributes: + uuid: + Uuid of this project + + ```proto + string uuid = 1; + ``` + meta: + Meta for this project + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this project must be unique per tenant + + ```proto + string name = 3; + ``` + description: + Description of this project + + ```proto + string description = 4; + ``` + tenant: + Tenant this project belongs to + + ```proto + string tenant = 5; + ``` + avatar_url: + AvatarUrl of the Project + + ```proto + optional string avatar_url = 6; + ``` + """ + + __slots__ = ("uuid", "meta", "name", "description", "tenant", "avatar_url") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + meta: Meta | None = None, + name: str = "", + description: str = "", + tenant: str = "", + avatar_url: str | None = None, + ) -> None: + pass + + uuid: str + meta: Meta | None + name: str + description: str + tenant: str + avatar_url: str + +_ProjectMemberFields: TypeAlias = Literal["id", "role", "inherited_membership", "created_at", "meta"] + +class ProjectMember(Message[_ProjectMemberFields]): + """ + ProjectMember defines a user that participates in a project + + ```proto + message metalstack.api.v2.ProjectMember + ``` + + Attributes: + id: + Id is the user id of the member + + ```proto + string id = 1; + ``` + role: + Role is the role of the member + + ```proto + metalstack.api.v2.ProjectRole role = 2; + ``` + inherited_membership: + InheritedMembership indicates that this member has implicit permissions on the project through his membership within the tenant. + This member does not have direct project membership but gains permissions on this project from the role he has in the tenant. + Inherited memberships are not included in member lists for users with guest permission but only for direct tenant members. + + ```proto + bool inherited_membership = 3; + ``` + created_at: + CreatedAt the date when the member was added to the project + + ```proto + optional google.protobuf.Timestamp created_at = 4; + ``` + meta: + Meta for this project member + + ```proto + optional metalstack.api.v2.Meta meta = 5; + ``` + """ + + __slots__ = ("id", "role", "inherited_membership", "created_at", "meta") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + role: ProjectRole | None = None, + inherited_membership: bool = False, + created_at: Timestamp | None = None, + meta: Meta | None = None, + ) -> None: + pass + + id: str + role: ProjectRole + inherited_membership: bool + created_at: Timestamp | None + meta: Meta | None + +_ProjectInviteFields: TypeAlias = Literal["secret", "project", "role", "joined", "project_name", "tenant", "tenant_name", "expires_at", "joined_at"] + +class ProjectInvite(Message[_ProjectInviteFields]): + """ + ProjectInvite defines invite to project + + ```proto + message metalstack.api.v2.ProjectInvite + ``` + + Attributes: + secret: + Secret is the secret part of the invite, typically part of the url + + ```proto + string secret = 1; + ``` + project: + Project is the project id for which this invite was created + + ```proto + string project = 2; + ``` + role: + Role is the role in this project the user will get after accepting the invitation + + ```proto + metalstack.api.v2.ProjectRole role = 3; + ``` + joined: + Joined is false as long as a user has not accepted the invite + + ```proto + bool joined = 4; + ``` + project_name: + ProjectName is the project name for which this invite was created + + ```proto + string project_name = 5; + ``` + tenant: + Tenant is the login of the tenant inviting another user to join this project + + ```proto + string tenant = 6; + ``` + tenant_name: + TenantName is the name of the tenant inviting another user to join this project + + ```proto + string tenant_name = 7; + ``` + expires_at: + ExpiresAt the date when this invite expires + + ```proto + optional google.protobuf.Timestamp expires_at = 8; + ``` + joined_at: + JoinedAt the date when the member accepted this invite + + ```proto + optional google.protobuf.Timestamp joined_at = 9; + ``` + """ + + __slots__ = ("secret", "project", "role", "joined", "project_name", "tenant", "tenant_name", "expires_at", "joined_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + project: str = "", + role: ProjectRole | None = None, + joined: bool = False, + project_name: str = "", + tenant: str = "", + tenant_name: str = "", + expires_at: Timestamp | None = None, + joined_at: Timestamp | None = None, + ) -> None: + pass + + secret: str + project: str + role: ProjectRole + joined: bool + project_name: str + tenant: str + tenant_name: str + expires_at: Timestamp | None + joined_at: Timestamp | None + +_ProjectServiceListRequestFields: TypeAlias = Literal["query"] + +class ProjectServiceListRequest(Message[_ProjectServiceListRequestFields]): + """ + ProjectServiceListRequest is the request payload to list all projects + + ```proto + message metalstack.api.v2.ProjectServiceListRequest + ``` + + Attributes: + query: + Query for projects + + ```proto + optional metalstack.api.v2.ProjectQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: ProjectQuery | None = None, + ) -> None: + pass + + query: ProjectQuery | None + +_ProjectQueryFields: TypeAlias = Literal["uuid", "name", "tenant", "labels"] + +class ProjectQuery(Message[_ProjectQueryFields]): + """ + ProjectQuery is used to search projects + + ```proto + message metalstack.api.v2.ProjectQuery + ``` + + Attributes: + uuid: + Uuid lists only projects with this uuid + + ```proto + optional string uuid = 1; + ``` + name: + Name lists only projects with this name + + ```proto + optional string name = 2; + ``` + tenant: + Tenant lists only projects of this tenant + + ```proto + optional string tenant = 3; + ``` + labels: + Labels lists only projects containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 4; + ``` + """ + + __slots__ = ("uuid", "name", "tenant", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + name: str | None = None, + tenant: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + uuid: str + name: str + tenant: str + labels: Labels | None + +_ProjectServiceListResponseFields: TypeAlias = Literal["projects"] + +class ProjectServiceListResponse(Message[_ProjectServiceListResponseFields]): + """ + ProjectServiceListResponse is the response payload to list all projects + + ```proto + message metalstack.api.v2.ProjectServiceListResponse + ``` + + Attributes: + projects: + Projects is a list of all your projects + + ```proto + repeated metalstack.api.v2.Project projects = 1; + ``` + """ + + __slots__ = ("projects",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + projects: list[Project] | None = None, + ) -> None: + pass + + projects: list[Project] + +_ProjectServiceGetRequestFields: TypeAlias = Literal["project"] + +class ProjectServiceGetRequest(Message[_ProjectServiceGetRequestFields]): + """ + ProjectServiceGetRequest is the request payload to get a project + + ```proto + message metalstack.api.v2.ProjectServiceGetRequest + ``` + + Attributes: + project: + Project is the uuid of the project to get + + ```proto + string project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + ) -> None: + pass + + project: str + +_ProjectServiceGetResponseFields: TypeAlias = Literal["project", "project_members"] + +class ProjectServiceGetResponse(Message[_ProjectServiceGetResponseFields]): + """ + ProjectServiceGetResponse is the response payload to get a projects + + ```proto + message metalstack.api.v2.ProjectServiceGetResponse + ``` + + Attributes: + project: + Project is the project + + ```proto + optional metalstack.api.v2.Project project = 1; + ``` + project_members: + ProjectMembers in this project, projects guests will only see direct project members and not implicit memberships from tenant permissions + + ```proto + repeated metalstack.api.v2.ProjectMember project_members = 2; + ``` + """ + + __slots__ = ("project", "project_members") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: Project | None = None, + project_members: list[ProjectMember] | None = None, + ) -> None: + pass + + project: Project | None + project_members: list[ProjectMember] + +_ProjectServiceCreateRequestFields: TypeAlias = Literal["login", "name", "description", "avatar_url", "labels"] + +class ProjectServiceCreateRequest(Message[_ProjectServiceCreateRequestFields]): + """ + ProjectServiceCreateRequest is the request payload to Create a project + + ```proto + message metalstack.api.v2.ProjectServiceCreateRequest + ``` + + Attributes: + login: + Login is the tenant of this project + TODO: is login really a good name? + + ```proto + string login = 1; + ``` + name: + Name of this project, unique per tenant + + ```proto + string name = 2; + ``` + description: + Description of this project + + ```proto + string description = 3; + ``` + avatar_url: + Avatar URL of the project + + ```proto + optional string avatar_url = 4; + ``` + labels: + Labels on the project + + ```proto + optional metalstack.api.v2.Labels labels = 5; + ``` + """ + + __slots__ = ("login", "name", "description", "avatar_url", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + name: str = "", + description: str = "", + avatar_url: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + login: str + name: str + description: str + avatar_url: str + labels: Labels | None + +_ProjectServiceCreateResponseFields: TypeAlias = Literal["project"] + +class ProjectServiceCreateResponse(Message[_ProjectServiceCreateResponseFields]): + """ + ProjectServiceCreateResponse is the response payload of creation of a project + + ```proto + message metalstack.api.v2.ProjectServiceCreateResponse + ``` + + Attributes: + project: + Project is the project + + ```proto + optional metalstack.api.v2.Project project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: Project | None = None, + ) -> None: + pass + + project: Project | None + +_ProjectServiceDeleteRequestFields: TypeAlias = Literal["project"] + +class ProjectServiceDeleteRequest(Message[_ProjectServiceDeleteRequestFields]): + """ + ProjectServiceDeleteRequest is the request payload to delete a project + + ```proto + message metalstack.api.v2.ProjectServiceDeleteRequest + ``` + + Attributes: + project: + Project is the uuid of the project to delete + + ```proto + string project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + ) -> None: + pass + + project: str + +_ProjectServiceDeleteResponseFields: TypeAlias = Literal["project"] + +class ProjectServiceDeleteResponse(Message[_ProjectServiceDeleteResponseFields]): + """ + ProjectServiceDeleteResponse is the response payload to delete a project + + ```proto + message metalstack.api.v2.ProjectServiceDeleteResponse + ``` + + Attributes: + project: + Project is the project + + ```proto + optional metalstack.api.v2.Project project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: Project | None = None, + ) -> None: + pass + + project: Project | None + +_ProjectServiceUpdateRequestFields: TypeAlias = Literal["project", "update_meta", "name", "description", "avatar_url", "labels"] + +class ProjectServiceUpdateRequest(Message[_ProjectServiceUpdateRequestFields]): + """ + ProjectServiceUpdateRequest is the request payload to update a project + + ```proto + message metalstack.api.v2.ProjectServiceUpdateRequest + ``` + + Attributes: + project: + Project is the uuid of the project to get + + ```proto + string project = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + name: + Name of this project unique per tenant + + ```proto + optional string name = 3; + ``` + description: + Description of this project + + ```proto + optional string description = 4; + ``` + avatar_url: + Avatar URL of the project + + ```proto + optional string avatar_url = 5; + ``` + labels: + Labels on this project + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 6; + ``` + """ + + __slots__ = ("project", "update_meta", "name", "description", "avatar_url", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + update_meta: UpdateMeta | None = None, + name: str | None = None, + description: str | None = None, + avatar_url: str | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + project: str + update_meta: UpdateMeta | None + name: str + description: str + avatar_url: str + labels: UpdateLabels | None + +_ProjectServiceUpdateResponseFields: TypeAlias = Literal["project"] + +class ProjectServiceUpdateResponse(Message[_ProjectServiceUpdateResponseFields]): + """ + ProjectServiceUpdateResponse is the response payload to update a project + + ```proto + message metalstack.api.v2.ProjectServiceUpdateResponse + ``` + + Attributes: + project: + Project is the project + + ```proto + optional metalstack.api.v2.Project project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: Project | None = None, + ) -> None: + pass + + project: Project | None + +_ProjectServiceInviteRequestFields: TypeAlias = Literal["project", "role"] + +class ProjectServiceInviteRequest(Message[_ProjectServiceInviteRequestFields]): + """ + ProjectServiceInviteRequest is used to invite a member to a project + + ```proto + message metalstack.api.v2.ProjectServiceInviteRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + role: + Role of this user in this project + + ```proto + metalstack.api.v2.ProjectRole role = 2; + ``` + """ + + __slots__ = ("project", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + role: ProjectRole | None = None, + ) -> None: + pass + + project: str + role: ProjectRole + +_ProjectServiceInviteResponseFields: TypeAlias = Literal["invite"] + +class ProjectServiceInviteResponse(Message[_ProjectServiceInviteResponseFields]): + """ + ProjectServiceInviteResponse is the response payload to a invite member request + + ```proto + message metalstack.api.v2.ProjectServiceInviteResponse + ``` + + Attributes: + invite: + Inviter contains a secret which can be sent to a potential user + can be appended to the invitation endpoint at our cloud console like + console.metalstack.cloud/invite/ + + ```proto + optional metalstack.api.v2.ProjectInvite invite = 1; + ``` + """ + + __slots__ = ("invite",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invite: ProjectInvite | None = None, + ) -> None: + pass + + invite: ProjectInvite | None + +_ProjectServiceInvitesListRequestFields: TypeAlias = Literal["project"] + +class ProjectServiceInvitesListRequest(Message[_ProjectServiceInvitesListRequestFields]): + """ + ProjectServiceInvitesListRequest is the request payload to a list invites request + + ```proto + message metalstack.api.v2.ProjectServiceInvitesListRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + ) -> None: + pass + + project: str + +_ProjectServiceInvitesListResponseFields: TypeAlias = Literal["invites"] + +class ProjectServiceInvitesListResponse(Message[_ProjectServiceInvitesListResponseFields]): + """ + ProjectServiceInvitesListResponse is the response payload to a list invites request + + ```proto + message metalstack.api.v2.ProjectServiceInvitesListResponse + ``` + + Attributes: + invites: + Invites not already accepted the invitation to this project + + ```proto + repeated metalstack.api.v2.ProjectInvite invites = 1; + ``` + """ + + __slots__ = ("invites",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invites: list[ProjectInvite] | None = None, + ) -> None: + pass + + invites: list[ProjectInvite] + +_ProjectServiceInviteGetRequestFields: TypeAlias = Literal["secret"] + +class ProjectServiceInviteGetRequest(Message[_ProjectServiceInviteGetRequestFields]): + """ + ProjectServiceInviteGetRequest is the request payload to get a invite + + ```proto + message metalstack.api.v2.ProjectServiceInviteGetRequest + ``` + + Attributes: + secret: + Secret of the invite to list + + ```proto + string secret = 1; + ``` + """ + + __slots__ = ("secret",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + ) -> None: + pass + + secret: str + +_ProjectServiceInviteGetResponseFields: TypeAlias = Literal["invite"] + +class ProjectServiceInviteGetResponse(Message[_ProjectServiceInviteGetResponseFields]): + """ + ProjectServiceInviteGetResponse is the response payload to a get invite request + + ```proto + message metalstack.api.v2.ProjectServiceInviteGetResponse + ``` + + Attributes: + invite: + Invite is the invite + + ```proto + optional metalstack.api.v2.ProjectInvite invite = 1; + ``` + """ + + __slots__ = ("invite",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invite: ProjectInvite | None = None, + ) -> None: + pass + + invite: ProjectInvite | None + +_ProjectServiceLeaveRequestFields: TypeAlias = Literal["project"] + +class ProjectServiceLeaveRequest(Message[_ProjectServiceLeaveRequestFields]): + """ + ProjectServiceLeaveRequest is used to leave a project + + ```proto + message metalstack.api.v2.ProjectServiceLeaveRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + """ + + __slots__ = ("project",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + ) -> None: + pass + + project: str + +_ProjectServiceLeaveResponseFields: TypeAlias = NoReturn + +class ProjectServiceLeaveResponse(Message[_ProjectServiceLeaveResponseFields]): + """ + ProjectServiceLeaveResponse is the response payload to a leave project request + + ```proto + message metalstack.api.v2.ProjectServiceLeaveResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_ProjectServiceAddMemberRequestFields: TypeAlias = Literal["project", "member", "role"] + +class ProjectServiceAddMemberRequest(Message[_ProjectServiceAddMemberRequestFields]): + """ + ProjectServiceAddMemberRequest is the request payload for adding a member to a project + + ```proto + message metalstack.api.v2.ProjectServiceAddMemberRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + member: + Login of the member to add + + ```proto + string member = 2; + ``` + role: + Role to assign to the new member + + ```proto + metalstack.api.v2.ProjectRole role = 3; + ``` + """ + + __slots__ = ("project", "member", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + member: str = "", + role: ProjectRole | None = None, + ) -> None: + pass + + project: str + member: str + role: ProjectRole + +_ProjectServiceAddMemberResponseFields: TypeAlias = Literal["project_member"] + +class ProjectServiceAddMemberResponse(Message[_ProjectServiceAddMemberResponseFields]): + """ + ProjectServiceAddMemberResponse is the response payload for the add member request + + ```proto + message metalstack.api.v2.ProjectServiceAddMemberResponse + ``` + + Attributes: + project_member: + ProjectRole is the added project member + + ```proto + metalstack.api.v2.ProjectRole project_member = 1; + ``` + """ + + __slots__ = ("project_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project_member: ProjectRole | None = None, + ) -> None: + pass + + project_member: ProjectRole + +_ProjectServiceRemoveMemberRequestFields: TypeAlias = Literal["project", "member"] + +class ProjectServiceRemoveMemberRequest(Message[_ProjectServiceRemoveMemberRequestFields]): + """ + ProjectServiceRemoveMemberRequest is used to remove a member from a project + + ```proto + message metalstack.api.v2.ProjectServiceRemoveMemberRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + member: + Member is the id of the member to remove from this project + + ```proto + string member = 2; + ``` + """ + + __slots__ = ("project", "member") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + member: str = "", + ) -> None: + pass + + project: str + member: str + +_ProjectServiceRemoveMemberResponseFields: TypeAlias = NoReturn + +class ProjectServiceRemoveMemberResponse(Message[_ProjectServiceRemoveMemberResponseFields]): + """ + ProjectServiceRemoveMemberResponse is the response payload to a remove member request + + ```proto + message metalstack.api.v2.ProjectServiceRemoveMemberResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_ProjectServiceUpdateMemberRequestFields: TypeAlias = Literal["project", "member", "role"] + +class ProjectServiceUpdateMemberRequest(Message[_ProjectServiceUpdateMemberRequestFields]): + """ + ProjectServiceUpdateMemberRequest is used to update a member of a project + + ```proto + message metalstack.api.v2.ProjectServiceUpdateMemberRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + member: + Member is the id of the member to remove from this project + + ```proto + string member = 2; + ``` + role: + Role is the role in this project the user will get after the update + + ```proto + metalstack.api.v2.ProjectRole role = 3; + ``` + """ + + __slots__ = ("project", "member", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + member: str = "", + role: ProjectRole | None = None, + ) -> None: + pass + + project: str + member: str + role: ProjectRole + +_ProjectServiceUpdateMemberResponseFields: TypeAlias = Literal["project_member"] + +class ProjectServiceUpdateMemberResponse(Message[_ProjectServiceUpdateMemberResponseFields]): + """ + ProjectServiceUpdateMemberResponse is the response payload to a update member request + + ```proto + message metalstack.api.v2.ProjectServiceUpdateMemberResponse + ``` + + Attributes: + project_member: + ProjectMember is the updated project member + + ```proto + optional metalstack.api.v2.ProjectMember project_member = 1; + ``` + """ + + __slots__ = ("project_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + project_member: ProjectMember | None = None, + ) -> None: + pass + + project_member: ProjectMember | None + +_ProjectServiceInviteAcceptRequestFields: TypeAlias = Literal["secret"] + +class ProjectServiceInviteAcceptRequest(Message[_ProjectServiceInviteAcceptRequestFields]): + """ + ProjectServiceInviteAcceptRequest is the request payload to a accept invite request + + ```proto + message metalstack.api.v2.ProjectServiceInviteAcceptRequest + ``` + + Attributes: + secret: + Secret is the invitation secret part of the invitation url + + ```proto + string secret = 1; + ``` + """ + + __slots__ = ("secret",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + ) -> None: + pass + + secret: str + +_ProjectServiceInviteAcceptResponseFields: TypeAlias = Literal["project", "project_name"] + +class ProjectServiceInviteAcceptResponse(Message[_ProjectServiceInviteAcceptResponseFields]): + """ + ProjectServiceInviteAcceptResponse is the response payload to a accept invite request + + ```proto + message metalstack.api.v2.ProjectServiceInviteAcceptResponse + ``` + + Attributes: + project: + Project ID of the project joined + + ```proto + string project = 1; + ``` + project_name: + ProjectName of the project joined + + ```proto + string project_name = 2; + ``` + """ + + __slots__ = ("project", "project_name") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + project_name: str = "", + ) -> None: + pass + + project: str + project_name: str + +_ProjectServiceInviteDeleteRequestFields: TypeAlias = Literal["project", "secret"] + +class ProjectServiceInviteDeleteRequest(Message[_ProjectServiceInviteDeleteRequestFields]): + """ + ProjectServiceInviteDeleteRequest is the request payload to a delete invite + + ```proto + message metalstack.api.v2.ProjectServiceInviteDeleteRequest + ``` + + Attributes: + project: + Project is the uuid of the project + + ```proto + string project = 1; + ``` + secret: + Secret of the invite to delete + + ```proto + string secret = 2; + ``` + """ + + __slots__ = ("project", "secret") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + secret: str = "", + ) -> None: + pass + + project: str + secret: str + +_ProjectServiceInviteDeleteResponseFields: TypeAlias = NoReturn + +class ProjectServiceInviteDeleteResponse(Message[_ProjectServiceInviteDeleteResponseFields]): + """ + ProjectServiceInviteDeleteResponse is the response payload of a delete invite request + + ```proto + message metalstack.api.v2.ProjectServiceInviteDeleteResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + + +_DESC = file_desc( + b'\n\x1fmetalstack/api/v2/project.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xf2\x01\n\x07Project\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x0bdescription\x18\x04 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\x16\n\x06tenant\x18\x05 \x01(\tR\x06tenant\x12/\n\navatar_url\x18\x06 \x01(\tH\x00R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01B\r\n\x0b_avatar_url"\xf8\x01\n\rProjectMember\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12<\n\x04role\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x121\n\x14inherited_membership\x18\x03 \x01(\x08R\x13inheritedMembership\x129\n\ncreated_at\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampR\tcreatedAt\x12+\n\x04meta\x18\x05 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta"\xe7\x02\n\rProjectInvite\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\x12\x18\n\x07project\x18\x02 \x01(\tR\x07project\x12<\n\x04role\x18\x03 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x16\n\x06joined\x18\x04 \x01(\x08R\x06joined\x12!\n\x0cproject_name\x18\x05 \x01(\tR\x0bprojectName\x12\x16\n\x06tenant\x18\x06 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x07 \x01(\tR\ntenantName\x129\n\nexpires_at\x18\x08 \x01(\x0b2\x1a.google.protobuf.TimestampR\texpiresAt\x127\n\tjoined_at\x18\t \x01(\x0b2\x1a.google.protobuf.TimestampR\x08joinedAt"R\n\x19ProjectServiceListRequest\x125\n\x05query\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.ProjectQueryR\x05query"\xe1\x01\n\x0cProjectQuery\x12!\n\x04uuid\x18\x01 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12(\n\x06tenant\x18\x03 \x01(\tH\x02R\x06tenantB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x04 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_nameB\t\n\x07_tenantB\t\n\x07_labels"T\n\x1aProjectServiceListResponse\x126\n\x08projects\x18\x01 \x03(\x0b2\x1a.metalstack.api.v2.ProjectR\x08projects">\n\x18ProjectServiceGetRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"\x9c\x01\n\x19ProjectServiceGetResponse\x124\n\x07project\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.ProjectR\x07project\x12I\n\x0fproject_members\x18\x02 \x03(\x0b2 .metalstack.api.v2.ProjectMemberR\x0eprojectMembers"\x83\x02\n\x1bProjectServiceCreateRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1f\n\x04name\x18\x02 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x0bdescription\x18\x03 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12/\n\navatar_url\x18\x04 \x01(\tH\x00R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x121\n\x06labels\x18\x05 \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labelsB\r\n\x0b_avatar_url"T\n\x1cProjectServiceCreateResponse\x124\n\x07project\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.ProjectR\x07project"A\n\x1bProjectServiceDeleteRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"T\n\x1cProjectServiceDeleteResponse\x124\n\x07project\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.ProjectR\x07project"\x85\x03\n\x1bProjectServiceUpdateRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12/\n\navatar_url\x18\x05 \x01(\tH\x02R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x06labels\x18\x06 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_descriptionB\r\n\x0b_avatar_urlB\t\n\x07_labels"T\n\x1cProjectServiceUpdateResponse\x124\n\x07project\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.ProjectR\x07project"\x7f\n\x1bProjectServiceInviteRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12<\n\x04role\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"X\n\x1cProjectServiceInviteResponse\x128\n\x06invite\x18\x01 \x01(\x0b2 .metalstack.api.v2.ProjectInviteR\x06invite"F\n ProjectServiceInvitesListRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"_\n!ProjectServiceInvitesListResponse\x12:\n\x07invites\x18\x01 \x03(\x0b2 .metalstack.api.v2.ProjectInviteR\x07invites"8\n\x1eProjectServiceInviteGetRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret"[\n\x1fProjectServiceInviteGetResponse\x128\n\x06invite\x18\x01 \x01(\x0b2 .metalstack.api.v2.ProjectInviteR\x06invite"@\n\x1aProjectServiceLeaveRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"\x1d\n\x1bProjectServiceLeaveResponse"\xa7\x01\n\x1eProjectServiceAddMemberRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12#\n\x06member\x18\x02 \x01(\tR\x06memberB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12<\n\x04role\x18\x03 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"h\n\x1fProjectServiceAddMemberResponse\x12E\n\x0eproject_member\x18\x01 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\rprojectMember"_\n!ProjectServiceRemoveMemberRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member"$\n"ProjectServiceRemoveMemberResponse"\x9d\x01\n!ProjectServiceUpdateMemberRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member\x12<\n\x04role\x18\x03 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"m\n"ProjectServiceUpdateMemberResponse\x12G\n\x0eproject_member\x18\x01 \x01(\x0b2 .metalstack.api.v2.ProjectMemberR\rprojectMember";\n!ProjectServiceInviteAcceptRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret"a\n"ProjectServiceInviteAcceptResponse\x12\x18\n\x07project\x18\x01 \x01(\tR\x07project\x12!\n\x0cproject_name\x18\x02 \x01(\tR\x0bprojectName"_\n!ProjectServiceInviteDeleteRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret"$\n"ProjectServiceInviteDeleteResponse2\xe1\r\n\x0eProjectService\x12m\n\x04List\x12,.metalstack.api.v2.ProjectServiceListRequest\x1a-.metalstack.api.v2.ProjectServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12m\n\x03Get\x12+.metalstack.api.v2.ProjectServiceGetRequest\x1a,.metalstack.api.v2.ProjectServiceGetResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06Create\x12..metalstack.api.v2.ProjectServiceCreateRequest\x1a/.metalstack.api.v2.ProjectServiceCreateResponse"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12t\n\x06Delete\x12..metalstack.api.v2.ProjectServiceDeleteRequest\x1a/.metalstack.api.v2.ProjectServiceDeleteResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.ProjectServiceUpdateRequest\x1a/.metalstack.api.v2.ProjectServiceUpdateResponse"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12q\n\x05Leave\x12-.metalstack.api.v2.ProjectServiceLeaveRequest\x1a..metalstack.api.v2.ProjectServiceLeaveResponse"\t\xca\xf3\x18\x01\x03\xe0\xf3\x18\x01\x12}\n\tAddMember\x121.metalstack.api.v2.ProjectServiceAddMemberRequest\x1a2.metalstack.api.v2.ProjectServiceAddMemberResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x86\x01\n\x0cRemoveMember\x124.metalstack.api.v2.ProjectServiceRemoveMemberRequest\x1a5.metalstack.api.v2.ProjectServiceRemoveMemberResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x86\x01\n\x0cUpdateMember\x124.metalstack.api.v2.ProjectServiceUpdateMemberRequest\x1a5.metalstack.api.v2.ProjectServiceUpdateMemberResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Invite\x12..metalstack.api.v2.ProjectServiceInviteRequest\x1a/.metalstack.api.v2.ProjectServiceInviteResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x85\x01\n\x0cInviteAccept\x124.metalstack.api.v2.ProjectServiceInviteAcceptRequest\x1a5.metalstack.api.v2.ProjectServiceInviteAcceptResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12\x86\x01\n\x0cInviteDelete\x124.metalstack.api.v2.ProjectServiceInviteDeleteRequest\x1a5.metalstack.api.v2.ProjectServiceInviteDeleteResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x0bInvitesList\x123.metalstack.api.v2.ProjectServiceInvitesListRequest\x1a4.metalstack.api.v2.ProjectServiceInvitesListResponse"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12|\n\tInviteGet\x121.metalstack.api.v2.ProjectServiceInviteGetRequest\x1a2.metalstack.api.v2.ProjectServiceInviteGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xc2\x01\n\x15com.metalstack.api.v2B\x0cProjectProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Project": Project, + "ProjectMember": ProjectMember, + "ProjectInvite": ProjectInvite, + "ProjectServiceListRequest": ProjectServiceListRequest, + "ProjectQuery": ProjectQuery, + "ProjectServiceListResponse": ProjectServiceListResponse, + "ProjectServiceGetRequest": ProjectServiceGetRequest, + "ProjectServiceGetResponse": ProjectServiceGetResponse, + "ProjectServiceCreateRequest": ProjectServiceCreateRequest, + "ProjectServiceCreateResponse": ProjectServiceCreateResponse, + "ProjectServiceDeleteRequest": ProjectServiceDeleteRequest, + "ProjectServiceDeleteResponse": ProjectServiceDeleteResponse, + "ProjectServiceUpdateRequest": ProjectServiceUpdateRequest, + "ProjectServiceUpdateResponse": ProjectServiceUpdateResponse, + "ProjectServiceInviteRequest": ProjectServiceInviteRequest, + "ProjectServiceInviteResponse": ProjectServiceInviteResponse, + "ProjectServiceInvitesListRequest": ProjectServiceInvitesListRequest, + "ProjectServiceInvitesListResponse": ProjectServiceInvitesListResponse, + "ProjectServiceInviteGetRequest": ProjectServiceInviteGetRequest, + "ProjectServiceInviteGetResponse": ProjectServiceInviteGetResponse, + "ProjectServiceLeaveRequest": ProjectServiceLeaveRequest, + "ProjectServiceLeaveResponse": ProjectServiceLeaveResponse, + "ProjectServiceAddMemberRequest": ProjectServiceAddMemberRequest, + "ProjectServiceAddMemberResponse": ProjectServiceAddMemberResponse, + "ProjectServiceRemoveMemberRequest": ProjectServiceRemoveMemberRequest, + "ProjectServiceRemoveMemberResponse": ProjectServiceRemoveMemberResponse, + "ProjectServiceUpdateMemberRequest": ProjectServiceUpdateMemberRequest, + "ProjectServiceUpdateMemberResponse": ProjectServiceUpdateMemberResponse, + "ProjectServiceInviteAcceptRequest": ProjectServiceInviteAcceptRequest, + "ProjectServiceInviteAcceptResponse": ProjectServiceInviteAcceptResponse, + "ProjectServiceInviteDeleteRequest": ProjectServiceInviteDeleteRequest, + "ProjectServiceInviteDeleteResponse": ProjectServiceInviteDeleteResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/project.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/project_pb2.py b/python/metalstack/api/v2/project_pb2.py deleted file mode 100644 index 820afd07..00000000 --- a/python/metalstack/api/v2/project_pb2.py +++ /dev/null @@ -1,193 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/project.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/project.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/api/v2/project.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xf2\x01\n\x07Project\x12\x12\n\x04uuid\x18\x01 \x01(\tR\x04uuid\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12-\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12\x16\n\x06tenant\x18\x05 \x01(\tR\x06tenant\x12/\n\navatar_url\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x00R\tavatarUrl\x88\x01\x01\x42\r\n\x0b_avatar_url\"\xf8\x01\n\rProjectMember\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12<\n\x04role\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\x12\x31\n\x14inherited_membership\x18\x03 \x01(\x08R\x13inheritedMembership\x12\x39\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12+\n\x04meta\x18\x05 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\"\xe7\x02\n\rProjectInvite\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\x12\x18\n\x07project\x18\x02 \x01(\tR\x07project\x12<\n\x04role\x18\x03 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\x12\x16\n\x06joined\x18\x04 \x01(\x08R\x06joined\x12!\n\x0cproject_name\x18\x05 \x01(\tR\x0bprojectName\x12\x16\n\x06tenant\x18\x06 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x07 \x01(\tR\ntenantName\x12\x39\n\nexpires_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAt\x12\x37\n\tjoined_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08joinedAt\"R\n\x19ProjectServiceListRequest\x12\x35\n\x05query\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.ProjectQueryR\x05query\"\xe1\x01\n\x0cProjectQuery\x12!\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12(\n\x06tenant\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01H\x02R\x06tenant\x88\x01\x01\x12\x36\n\x06labels\x18\x04 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_nameB\t\n\x07_tenantB\t\n\x07_labels\"T\n\x1aProjectServiceListResponse\x12\x36\n\x08projects\x18\x01 \x03(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x08projects\">\n\x18ProjectServiceGetRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"\x9c\x01\n\x19ProjectServiceGetResponse\x12\x34\n\x07project\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x07project\x12I\n\x0fproject_members\x18\x02 \x03(\x0b\x32 .metalstack.api.v2.ProjectMemberR\x0eprojectMembers\"\x83\x02\n\x1bProjectServiceCreateRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05login\x12\x1f\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12/\n\navatar_url\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x00R\tavatarUrl\x88\x01\x01\x12\x31\n\x06labels\x18\x05 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labelsB\r\n\x0b_avatar_url\"T\n\x1cProjectServiceCreateResponse\x12\x34\n\x07project\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x07project\"A\n\x1bProjectServiceDeleteRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"T\n\x1cProjectServiceDeleteResponse\x12\x34\n\x07project\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x07project\"\x85\x03\n\x1bProjectServiceUpdateRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12/\n\navatar_url\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x02R\tavatarUrl\x88\x01\x01\x12<\n\x06labels\x18\x06 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x03R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_descriptionB\r\n\x0b_avatar_urlB\t\n\x07_labels\"T\n\x1cProjectServiceUpdateResponse\x12\x34\n\x07project\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x07project\"\x7f\n\x1bProjectServiceInviteRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12<\n\x04role\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"X\n\x1cProjectServiceInviteResponse\x12\x38\n\x06invite\x18\x01 \x01(\x0b\x32 .metalstack.api.v2.ProjectInviteR\x06invite\"F\n ProjectServiceInvitesListRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"_\n!ProjectServiceInvitesListResponse\x12:\n\x07invites\x18\x01 \x03(\x0b\x32 .metalstack.api.v2.ProjectInviteR\x07invites\"8\n\x1eProjectServiceInviteGetRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\"[\n\x1fProjectServiceInviteGetResponse\x12\x38\n\x06invite\x18\x01 \x01(\x0b\x32 .metalstack.api.v2.ProjectInviteR\x06invite\"@\n\x1aProjectServiceLeaveRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"\x1d\n\x1bProjectServiceLeaveResponse\"\xa7\x01\n\x1eProjectServiceAddMemberRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12#\n\x06member\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06member\x12<\n\x04role\x18\x03 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"h\n\x1fProjectServiceAddMemberResponse\x12\x45\n\x0eproject_member\x18\x01 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\rprojectMember\"_\n!ProjectServiceRemoveMemberRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member\"$\n\"ProjectServiceRemoveMemberResponse\"\x9d\x01\n!ProjectServiceUpdateMemberRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member\x12<\n\x04role\x18\x03 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"m\n\"ProjectServiceUpdateMemberResponse\x12G\n\x0eproject_member\x18\x01 \x01(\x0b\x32 .metalstack.api.v2.ProjectMemberR\rprojectMember\";\n!ProjectServiceInviteAcceptRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\"a\n\"ProjectServiceInviteAcceptResponse\x12\x18\n\x07project\x18\x01 \x01(\tR\x07project\x12!\n\x0cproject_name\x18\x02 \x01(\tR\x0bprojectName\"_\n!ProjectServiceInviteDeleteRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"$\n\"ProjectServiceInviteDeleteResponse2\xe1\r\n\x0eProjectService\x12m\n\x04List\x12,.metalstack.api.v2.ProjectServiceListRequest\x1a-.metalstack.api.v2.ProjectServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12m\n\x03Get\x12+.metalstack.api.v2.ProjectServiceGetRequest\x1a,.metalstack.api.v2.ProjectServiceGetResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12u\n\x06\x43reate\x12..metalstack.api.v2.ProjectServiceCreateRequest\x1a/.metalstack.api.v2.ProjectServiceCreateResponse\"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12t\n\x06\x44\x65lete\x12..metalstack.api.v2.ProjectServiceDeleteRequest\x1a/.metalstack.api.v2.ProjectServiceDeleteResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12u\n\x06Update\x12..metalstack.api.v2.ProjectServiceUpdateRequest\x1a/.metalstack.api.v2.ProjectServiceUpdateResponse\"\n\xca\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12q\n\x05Leave\x12-.metalstack.api.v2.ProjectServiceLeaveRequest\x1a..metalstack.api.v2.ProjectServiceLeaveResponse\"\t\xca\xf3\x18\x01\x03\xe0\xf3\x18\x01\x12}\n\tAddMember\x12\x31.metalstack.api.v2.ProjectServiceAddMemberRequest\x1a\x32.metalstack.api.v2.ProjectServiceAddMemberResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x86\x01\n\x0cRemoveMember\x12\x34.metalstack.api.v2.ProjectServiceRemoveMemberRequest\x1a\x35.metalstack.api.v2.ProjectServiceRemoveMemberResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x86\x01\n\x0cUpdateMember\x12\x34.metalstack.api.v2.ProjectServiceUpdateMemberRequest\x1a\x35.metalstack.api.v2.ProjectServiceUpdateMemberResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12t\n\x06Invite\x12..metalstack.api.v2.ProjectServiceInviteRequest\x1a/.metalstack.api.v2.ProjectServiceInviteResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x85\x01\n\x0cInviteAccept\x12\x34.metalstack.api.v2.ProjectServiceInviteAcceptRequest\x1a\x35.metalstack.api.v2.ProjectServiceInviteAcceptResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12\x86\x01\n\x0cInviteDelete\x12\x34.metalstack.api.v2.ProjectServiceInviteDeleteRequest\x1a\x35.metalstack.api.v2.ProjectServiceInviteDeleteResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x0bInvitesList\x12\x33.metalstack.api.v2.ProjectServiceInvitesListRequest\x1a\x34.metalstack.api.v2.ProjectServiceInvitesListResponse\"\t\xca\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12|\n\tInviteGet\x12\x31.metalstack.api.v2.ProjectServiceInviteGetRequest\x1a\x32.metalstack.api.v2.ProjectServiceInviteGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xc2\x01\n\x15\x63om.metalstack.api.v2B\x0cProjectProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.project_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\014ProjectProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_PROJECT'].fields_by_name['name']._loaded_options = None - _globals['_PROJECT'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PROJECT'].fields_by_name['description']._loaded_options = None - _globals['_PROJECT'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_PROJECT'].fields_by_name['avatar_url']._loaded_options = None - _globals['_PROJECT'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_PROJECTMEMBER'].fields_by_name['role']._loaded_options = None - _globals['_PROJECTMEMBER'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_PROJECTINVITE'].fields_by_name['role']._loaded_options = None - _globals['_PROJECTINVITE'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_PROJECTQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_PROJECTQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTQUERY'].fields_by_name['name']._loaded_options = None - _globals['_PROJECTQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PROJECTQUERY'].fields_by_name['tenant']._loaded_options = None - _globals['_PROJECTQUERY'].fields_by_name['tenant']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_PROJECTSERVICEGETREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEGETREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._loaded_options = None - _globals['_PROJECTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_PROJECTSERVICEDELETEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEDELETEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['avatar_url']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEREQUEST'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_PROJECTSERVICEINVITEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEINVITEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEINVITEREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_PROJECTSERVICEINVITEREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_PROJECTSERVICEINVITESLISTREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEINVITESLISTREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICELEAVEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICELEAVEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._loaded_options = None - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_PROJECTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_PROJECTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_PROJECTSERVICEINVITEDELETEREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_PROJECTSERVICEINVITEDELETEREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_PROJECTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_PROJECTSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Get']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_PROJECTSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Create']._serialized_options = b'\302\363\030\002\001\002\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Delete']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Update']._serialized_options = b'\312\363\030\002\001\002\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['Leave']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Leave']._serialized_options = b'\312\363\030\001\003\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['AddMember']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['AddMember']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['RemoveMember']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['RemoveMember']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['UpdateMember']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['UpdateMember']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['Invite']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['Invite']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['InviteAccept']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['InviteAccept']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['InviteDelete']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['InviteDelete']._serialized_options = b'\312\363\030\001\001\340\363\030\001' - _globals['_PROJECTSERVICE'].methods_by_name['InvitesList']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['InvitesList']._serialized_options = b'\312\363\030\001\001\340\363\030\002' - _globals['_PROJECTSERVICE'].methods_by_name['InviteGet']._loaded_options = None - _globals['_PROJECTSERVICE'].methods_by_name['InviteGet']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_PROJECT']._serialized_start=191 - _globals['_PROJECT']._serialized_end=433 - _globals['_PROJECTMEMBER']._serialized_start=436 - _globals['_PROJECTMEMBER']._serialized_end=684 - _globals['_PROJECTINVITE']._serialized_start=687 - _globals['_PROJECTINVITE']._serialized_end=1046 - _globals['_PROJECTSERVICELISTREQUEST']._serialized_start=1048 - _globals['_PROJECTSERVICELISTREQUEST']._serialized_end=1130 - _globals['_PROJECTQUERY']._serialized_start=1133 - _globals['_PROJECTQUERY']._serialized_end=1358 - _globals['_PROJECTSERVICELISTRESPONSE']._serialized_start=1360 - _globals['_PROJECTSERVICELISTRESPONSE']._serialized_end=1444 - _globals['_PROJECTSERVICEGETREQUEST']._serialized_start=1446 - _globals['_PROJECTSERVICEGETREQUEST']._serialized_end=1508 - _globals['_PROJECTSERVICEGETRESPONSE']._serialized_start=1511 - _globals['_PROJECTSERVICEGETRESPONSE']._serialized_end=1667 - _globals['_PROJECTSERVICECREATEREQUEST']._serialized_start=1670 - _globals['_PROJECTSERVICECREATEREQUEST']._serialized_end=1929 - _globals['_PROJECTSERVICECREATERESPONSE']._serialized_start=1931 - _globals['_PROJECTSERVICECREATERESPONSE']._serialized_end=2015 - _globals['_PROJECTSERVICEDELETEREQUEST']._serialized_start=2017 - _globals['_PROJECTSERVICEDELETEREQUEST']._serialized_end=2082 - _globals['_PROJECTSERVICEDELETERESPONSE']._serialized_start=2084 - _globals['_PROJECTSERVICEDELETERESPONSE']._serialized_end=2168 - _globals['_PROJECTSERVICEUPDATEREQUEST']._serialized_start=2171 - _globals['_PROJECTSERVICEUPDATEREQUEST']._serialized_end=2560 - _globals['_PROJECTSERVICEUPDATERESPONSE']._serialized_start=2562 - _globals['_PROJECTSERVICEUPDATERESPONSE']._serialized_end=2646 - _globals['_PROJECTSERVICEINVITEREQUEST']._serialized_start=2648 - _globals['_PROJECTSERVICEINVITEREQUEST']._serialized_end=2775 - _globals['_PROJECTSERVICEINVITERESPONSE']._serialized_start=2777 - _globals['_PROJECTSERVICEINVITERESPONSE']._serialized_end=2865 - _globals['_PROJECTSERVICEINVITESLISTREQUEST']._serialized_start=2867 - _globals['_PROJECTSERVICEINVITESLISTREQUEST']._serialized_end=2937 - _globals['_PROJECTSERVICEINVITESLISTRESPONSE']._serialized_start=2939 - _globals['_PROJECTSERVICEINVITESLISTRESPONSE']._serialized_end=3034 - _globals['_PROJECTSERVICEINVITEGETREQUEST']._serialized_start=3036 - _globals['_PROJECTSERVICEINVITEGETREQUEST']._serialized_end=3092 - _globals['_PROJECTSERVICEINVITEGETRESPONSE']._serialized_start=3094 - _globals['_PROJECTSERVICEINVITEGETRESPONSE']._serialized_end=3185 - _globals['_PROJECTSERVICELEAVEREQUEST']._serialized_start=3187 - _globals['_PROJECTSERVICELEAVEREQUEST']._serialized_end=3251 - _globals['_PROJECTSERVICELEAVERESPONSE']._serialized_start=3253 - _globals['_PROJECTSERVICELEAVERESPONSE']._serialized_end=3282 - _globals['_PROJECTSERVICEADDMEMBERREQUEST']._serialized_start=3285 - _globals['_PROJECTSERVICEADDMEMBERREQUEST']._serialized_end=3452 - _globals['_PROJECTSERVICEADDMEMBERRESPONSE']._serialized_start=3454 - _globals['_PROJECTSERVICEADDMEMBERRESPONSE']._serialized_end=3558 - _globals['_PROJECTSERVICEREMOVEMEMBERREQUEST']._serialized_start=3560 - _globals['_PROJECTSERVICEREMOVEMEMBERREQUEST']._serialized_end=3655 - _globals['_PROJECTSERVICEREMOVEMEMBERRESPONSE']._serialized_start=3657 - _globals['_PROJECTSERVICEREMOVEMEMBERRESPONSE']._serialized_end=3693 - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST']._serialized_start=3696 - _globals['_PROJECTSERVICEUPDATEMEMBERREQUEST']._serialized_end=3853 - _globals['_PROJECTSERVICEUPDATEMEMBERRESPONSE']._serialized_start=3855 - _globals['_PROJECTSERVICEUPDATEMEMBERRESPONSE']._serialized_end=3964 - _globals['_PROJECTSERVICEINVITEACCEPTREQUEST']._serialized_start=3966 - _globals['_PROJECTSERVICEINVITEACCEPTREQUEST']._serialized_end=4025 - _globals['_PROJECTSERVICEINVITEACCEPTRESPONSE']._serialized_start=4027 - _globals['_PROJECTSERVICEINVITEACCEPTRESPONSE']._serialized_end=4124 - _globals['_PROJECTSERVICEINVITEDELETEREQUEST']._serialized_start=4126 - _globals['_PROJECTSERVICEINVITEDELETEREQUEST']._serialized_end=4221 - _globals['_PROJECTSERVICEINVITEDELETERESPONSE']._serialized_start=4223 - _globals['_PROJECTSERVICEINVITEDELETERESPONSE']._serialized_end=4259 - _globals['_PROJECTSERVICE']._serialized_start=4262 - _globals['_PROJECTSERVICE']._serialized_end=6023 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/project_pb2.pyi b/python/metalstack/api/v2/project_pb2.pyi deleted file mode 100644 index 0f82ba19..00000000 --- a/python/metalstack/api/v2/project_pb2.pyi +++ /dev/null @@ -1,275 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Project(_message.Message): - __slots__ = ("uuid", "meta", "name", "description", "tenant", "avatar_url") - UUID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - TENANT_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - uuid: str - meta: _common_pb2.Meta - name: str - description: str - tenant: str - avatar_url: str - def __init__(self, uuid: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., tenant: _Optional[str] = ..., avatar_url: _Optional[str] = ...) -> None: ... - -class ProjectMember(_message.Message): - __slots__ = ("id", "role", "inherited_membership", "created_at", "meta") - ID_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - INHERITED_MEMBERSHIP_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - id: str - role: _common_pb2.ProjectRole - inherited_membership: bool - created_at: _timestamp_pb2.Timestamp - meta: _common_pb2.Meta - def __init__(self, id: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.ProjectRole, str]] = ..., inherited_membership: _Optional[bool] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ...) -> None: ... - -class ProjectInvite(_message.Message): - __slots__ = ("secret", "project", "role", "joined", "project_name", "tenant", "tenant_name", "expires_at", "joined_at") - SECRET_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - JOINED_FIELD_NUMBER: _ClassVar[int] - PROJECT_NAME_FIELD_NUMBER: _ClassVar[int] - TENANT_FIELD_NUMBER: _ClassVar[int] - TENANT_NAME_FIELD_NUMBER: _ClassVar[int] - EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] - JOINED_AT_FIELD_NUMBER: _ClassVar[int] - secret: str - project: str - role: _common_pb2.ProjectRole - joined: bool - project_name: str - tenant: str - tenant_name: str - expires_at: _timestamp_pb2.Timestamp - joined_at: _timestamp_pb2.Timestamp - def __init__(self, secret: _Optional[str] = ..., project: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.ProjectRole, str]] = ..., joined: _Optional[bool] = ..., project_name: _Optional[str] = ..., tenant: _Optional[str] = ..., tenant_name: _Optional[str] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., joined_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class ProjectServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: ProjectQuery - def __init__(self, query: _Optional[_Union[ProjectQuery, _Mapping]] = ...) -> None: ... - -class ProjectQuery(_message.Message): - __slots__ = ("uuid", "name", "tenant", "labels") - UUID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - TENANT_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - uuid: str - name: str - tenant: str - labels: _common_pb2.Labels - def __init__(self, uuid: _Optional[str] = ..., name: _Optional[str] = ..., tenant: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class ProjectServiceListResponse(_message.Message): - __slots__ = ("projects",) - PROJECTS_FIELD_NUMBER: _ClassVar[int] - projects: _containers.RepeatedCompositeFieldContainer[Project] - def __init__(self, projects: _Optional[_Iterable[_Union[Project, _Mapping]]] = ...) -> None: ... - -class ProjectServiceGetRequest(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: str - def __init__(self, project: _Optional[str] = ...) -> None: ... - -class ProjectServiceGetResponse(_message.Message): - __slots__ = ("project", "project_members") - PROJECT_FIELD_NUMBER: _ClassVar[int] - PROJECT_MEMBERS_FIELD_NUMBER: _ClassVar[int] - project: Project - project_members: _containers.RepeatedCompositeFieldContainer[ProjectMember] - def __init__(self, project: _Optional[_Union[Project, _Mapping]] = ..., project_members: _Optional[_Iterable[_Union[ProjectMember, _Mapping]]] = ...) -> None: ... - -class ProjectServiceCreateRequest(_message.Message): - __slots__ = ("login", "name", "description", "avatar_url", "labels") - LOGIN_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - login: str - name: str - description: str - avatar_url: str - labels: _common_pb2.Labels - def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., avatar_url: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class ProjectServiceCreateResponse(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: Project - def __init__(self, project: _Optional[_Union[Project, _Mapping]] = ...) -> None: ... - -class ProjectServiceDeleteRequest(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: str - def __init__(self, project: _Optional[str] = ...) -> None: ... - -class ProjectServiceDeleteResponse(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: Project - def __init__(self, project: _Optional[_Union[Project, _Mapping]] = ...) -> None: ... - -class ProjectServiceUpdateRequest(_message.Message): - __slots__ = ("project", "update_meta", "name", "description", "avatar_url", "labels") - PROJECT_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - project: str - update_meta: _common_pb2.UpdateMeta - name: str - description: str - avatar_url: str - labels: _common_pb2.UpdateLabels - def __init__(self, project: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., avatar_url: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class ProjectServiceUpdateResponse(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: Project - def __init__(self, project: _Optional[_Union[Project, _Mapping]] = ...) -> None: ... - -class ProjectServiceInviteRequest(_message.Message): - __slots__ = ("project", "role") - PROJECT_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - project: str - role: _common_pb2.ProjectRole - def __init__(self, project: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - -class ProjectServiceInviteResponse(_message.Message): - __slots__ = ("invite",) - INVITE_FIELD_NUMBER: _ClassVar[int] - invite: ProjectInvite - def __init__(self, invite: _Optional[_Union[ProjectInvite, _Mapping]] = ...) -> None: ... - -class ProjectServiceInvitesListRequest(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: str - def __init__(self, project: _Optional[str] = ...) -> None: ... - -class ProjectServiceInvitesListResponse(_message.Message): - __slots__ = ("invites",) - INVITES_FIELD_NUMBER: _ClassVar[int] - invites: _containers.RepeatedCompositeFieldContainer[ProjectInvite] - def __init__(self, invites: _Optional[_Iterable[_Union[ProjectInvite, _Mapping]]] = ...) -> None: ... - -class ProjectServiceInviteGetRequest(_message.Message): - __slots__ = ("secret",) - SECRET_FIELD_NUMBER: _ClassVar[int] - secret: str - def __init__(self, secret: _Optional[str] = ...) -> None: ... - -class ProjectServiceInviteGetResponse(_message.Message): - __slots__ = ("invite",) - INVITE_FIELD_NUMBER: _ClassVar[int] - invite: ProjectInvite - def __init__(self, invite: _Optional[_Union[ProjectInvite, _Mapping]] = ...) -> None: ... - -class ProjectServiceLeaveRequest(_message.Message): - __slots__ = ("project",) - PROJECT_FIELD_NUMBER: _ClassVar[int] - project: str - def __init__(self, project: _Optional[str] = ...) -> None: ... - -class ProjectServiceLeaveResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ProjectServiceAddMemberRequest(_message.Message): - __slots__ = ("project", "member", "role") - PROJECT_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - project: str - member: str - role: _common_pb2.ProjectRole - def __init__(self, project: _Optional[str] = ..., member: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - -class ProjectServiceAddMemberResponse(_message.Message): - __slots__ = ("project_member",) - PROJECT_MEMBER_FIELD_NUMBER: _ClassVar[int] - project_member: _common_pb2.ProjectRole - def __init__(self, project_member: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - -class ProjectServiceRemoveMemberRequest(_message.Message): - __slots__ = ("project", "member") - PROJECT_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - project: str - member: str - def __init__(self, project: _Optional[str] = ..., member: _Optional[str] = ...) -> None: ... - -class ProjectServiceRemoveMemberResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class ProjectServiceUpdateMemberRequest(_message.Message): - __slots__ = ("project", "member", "role") - PROJECT_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - project: str - member: str - role: _common_pb2.ProjectRole - def __init__(self, project: _Optional[str] = ..., member: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - -class ProjectServiceUpdateMemberResponse(_message.Message): - __slots__ = ("project_member",) - PROJECT_MEMBER_FIELD_NUMBER: _ClassVar[int] - project_member: ProjectMember - def __init__(self, project_member: _Optional[_Union[ProjectMember, _Mapping]] = ...) -> None: ... - -class ProjectServiceInviteAcceptRequest(_message.Message): - __slots__ = ("secret",) - SECRET_FIELD_NUMBER: _ClassVar[int] - secret: str - def __init__(self, secret: _Optional[str] = ...) -> None: ... - -class ProjectServiceInviteAcceptResponse(_message.Message): - __slots__ = ("project", "project_name") - PROJECT_FIELD_NUMBER: _ClassVar[int] - PROJECT_NAME_FIELD_NUMBER: _ClassVar[int] - project: str - project_name: str - def __init__(self, project: _Optional[str] = ..., project_name: _Optional[str] = ...) -> None: ... - -class ProjectServiceInviteDeleteRequest(_message.Message): - __slots__ = ("project", "secret") - PROJECT_FIELD_NUMBER: _ClassVar[int] - SECRET_FIELD_NUMBER: _ClassVar[int] - project: str - secret: str - def __init__(self, project: _Optional[str] = ..., secret: _Optional[str] = ...) -> None: ... - -class ProjectServiceInviteDeleteResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... diff --git a/python/metalstack/api/v2/size_connect.py b/python/metalstack/api/v2/size_connect.py index 4ed02112..4cd0f854 100644 --- a/python/metalstack/api/v2/size_connect.py +++ b/python/metalstack/api/v2/size_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/size.proto +# Generated from metalstack/api/v2/size.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.size_pb2 as metalstack_dot_api_dot_v2_dot_size__pb2 + +from .size_pb import SizeServiceGetRequest, SizeServiceGetResponse, SizeServiceListRequest, SizeServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: SizeServiceGetRequest, ctx: RequestContext[SizeServiceGetRequest, SizeServiceGetResponse]) -> SizeServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: SizeServiceListRequest, ctx: RequestContext[SizeServiceListRequest, SizeServiceListResponse]) -> SizeServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeServiceASGIApplication(ConnectASGIApplication[SizeService]): - def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeService | AsyncGenerator[SizeService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interc method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse, + input=SizeServiceGetRequest, + output=SizeServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: SizeService | AsyncGenerator[SizeService], *, interc method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse, + input=SizeServiceListRequest, + output=SizeServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class SizeServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, + request: SizeServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse: + ) -> SizeServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse, + input=SizeServiceGetRequest, + output=SizeServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, + request: SizeServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse: + ) -> SizeServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse, + input=SizeServiceListRequest, + output=SizeServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class SizeServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: SizeServiceGetRequest, ctx: RequestContext[SizeServiceGetRequest, SizeServiceGetResponse]) -> SizeServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: SizeServiceListRequest, ctx: RequestContext[SizeServiceListRequest, SizeServiceListResponse]) -> SizeServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.SizeService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse, + input=SizeServiceGetRequest, + output=SizeServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: SizeServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse, + input=SizeServiceListRequest, + output=SizeServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class SizeServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, + request: SizeServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse: + ) -> SizeServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceGetResponse, + input=SizeServiceGetRequest, + output=SizeServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, + request: SizeServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse: + ) -> SizeServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeService", - input=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__pb2.SizeServiceListResponse, + input=SizeServiceListRequest, + output=SizeServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/size_imageconstraint_connect.py b/python/metalstack/api/v2/size_imageconstraint_connect.py index ab3bc4cb..d1a2176e 100644 --- a/python/metalstack/api/v2/size_imageconstraint_connect.py +++ b/python/metalstack/api/v2/size_imageconstraint_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/size_imageconstraint.proto +# Generated from metalstack/api/v2/size_imageconstraint.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.size_imageconstraint_pb2 as metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2 + +from .size_imageconstraint_pb import SizeImageConstraintServiceTryRequest, SizeImageConstraintServiceTryResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeImageConstraintService(Protocol): - async def try_(self, request: metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def try_(self, request: SizeImageConstraintServiceTryRequest, ctx: RequestContext[SizeImageConstraintServiceTryRequest, SizeImageConstraintServiceTryResponse]) -> SizeImageConstraintServiceTryResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeImageConstraintServiceASGIApplication(ConnectASGIApplication[SizeImageConstraintService]): - def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImageConstraintService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeImageConstraintService | AsyncGenerator[SizeImageConstraintService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: SizeImageConstraintService | AsyncGenerator[SizeImag method=MethodInfo( name="Try", service_name="metalstack.api.v2.SizeImageConstraintService", - input=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, - output=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse, + input=SizeImageConstraintServiceTryRequest, + output=SizeImageConstraintServiceTryResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.try_, @@ -53,43 +69,46 @@ def path(self) -> str: class SizeImageConstraintServiceClient(ConnectClient): async def try_( self, - request: metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, + request: SizeImageConstraintServiceTryRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse: + ) -> SizeImageConstraintServiceTryResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Try", service_name="metalstack.api.v2.SizeImageConstraintService", - input=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, - output=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse, + input=SizeImageConstraintServiceTryRequest, + output=SizeImageConstraintServiceTryResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class SizeImageConstraintServiceSync(Protocol): - def try_(self, request: metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def try_(self, request: SizeImageConstraintServiceTryRequest, ctx: RequestContext[SizeImageConstraintServiceTryRequest, SizeImageConstraintServiceTryResponse]) -> SizeImageConstraintServiceTryResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeImageConstraintServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeImageConstraintServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeImageConstraintServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.SizeImageConstraintService/Try": EndpointSync.unary( method=MethodInfo( name="Try", service_name="metalstack.api.v2.SizeImageConstraintService", - input=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, - output=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse, + input=SizeImageConstraintServiceTryRequest, + output=SizeImageConstraintServiceTryResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.try_, @@ -110,22 +129,20 @@ def path(self) -> str: class SizeImageConstraintServiceClientSync(ConnectClientSync): def try_( self, - request: metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, + request: SizeImageConstraintServiceTryRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse: + ) -> SizeImageConstraintServiceTryResponse: return self.execute_unary( request=request, method=MethodInfo( name="Try", service_name="metalstack.api.v2.SizeImageConstraintService", - input=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryRequest, - output=metalstack_dot_api_dot_v2_dot_size__imageconstraint__pb2.SizeImageConstraintServiceTryResponse, + input=SizeImageConstraintServiceTryRequest, + output=SizeImageConstraintServiceTryResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/size_imageconstraint_pb.py b/python/metalstack/api/v2/size_imageconstraint_pb.py new file mode 100644 index 00000000..1a8276ef --- /dev/null +++ b/python/metalstack/api/v2/size_imageconstraint_pb.py @@ -0,0 +1,265 @@ +# Generated from metalstack/api/v2/size_imageconstraint.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Meta + + +_SizeImageConstraintServiceTryRequestFields: TypeAlias = Literal["size", "image"] + +class SizeImageConstraintServiceTryRequest(Message[_SizeImageConstraintServiceTryRequestFields]): + """ + SizeImageConstraintServiceTryRequest is the request payload for a size image constraint try request + + ```proto + message metalstack.api.v2.SizeImageConstraintServiceTryRequest + ``` + + Attributes: + size: + Size to try + + ```proto + string size = 1; + ``` + image: + Image to try + + ```proto + string image = 2; + ``` + """ + + __slots__ = ("size", "image") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + image: str = "", + ) -> None: + pass + + size: str + image: str + +_SizeImageConstraintServiceTryResponseFields: TypeAlias = NoReturn + +class SizeImageConstraintServiceTryResponse(Message[_SizeImageConstraintServiceTryResponseFields]): + """ + SizeImageConstraintServiceTryResponse is the response payload for a size image constraint try request + + ```proto + message metalstack.api.v2.SizeImageConstraintServiceTryResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_SizeImageConstraintFields: TypeAlias = Literal["size", "image_constraints", "meta", "name", "description"] + +class SizeImageConstraint(Message[_SizeImageConstraintFields]): + """ + SizeImageConstraint expresses optional restrictions for specific size to image combinations + this might be required if the support for a specific hardware in a given size is only supported + with a newer version of the image. + + If the size in question is not found, no restrictions apply. + If the image in question is not found, no restrictions apply as well. + If the image in question is found, but does not match the given expression, machine creation must be forbidden. + + ```proto + message metalstack.api.v2.SizeImageConstraint + ``` + + Attributes: + size: + Size where this constraint should apply + + ```proto + string size = 1; + ``` + image_constraints: + ImageConstraints to apply to this size + + ```proto + repeated metalstack.api.v2.ImageConstraint image_constraints = 2; + ``` + meta: + Meta for this size image constraint + + ```proto + optional metalstack.api.v2.Meta meta = 3; + ``` + name: + Name of this size image constraint + + ```proto + optional string name = 4; + ``` + description: + Description of this size image constraint + + ```proto + optional string description = 5; + ``` + """ + + __slots__ = ("size", "image_constraints", "meta", "name", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str = "", + image_constraints: list[ImageConstraint] | None = None, + meta: Meta | None = None, + name: str | None = None, + description: str | None = None, + ) -> None: + pass + + size: str + image_constraints: list[ImageConstraint] + meta: Meta | None + name: str + description: str + +_ImageConstraintFields: TypeAlias = Literal["image", "semver_match"] + +class ImageConstraint(Message[_ImageConstraintFields]): + """ + ImageConstraint defines a constraint for an image + examples: + images: + ubuntu: ">= 20.04.20211011" + debian: ">= 10.0.20210101" + + ```proto + message metalstack.api.v2.ImageConstraint + ``` + + Attributes: + image: + Image of the constraint + + ```proto + string image = 1; + ``` + semver_match: + SemverMatch which defines in semver match format which image version should apply + + ```proto + string semver_match = 2; + ``` + """ + + __slots__ = ("image", "semver_match") + + if TYPE_CHECKING: + + def __init__( + self, + *, + image: str = "", + semver_match: str = "", + ) -> None: + pass + + image: str + semver_match: str + +_SizeImageConstraintQueryFields: TypeAlias = Literal["size", "name", "description"] + +class SizeImageConstraintQuery(Message[_SizeImageConstraintQueryFields]): + """ + SizeImageConstraintQuery is used to search size image constraints + + ```proto + message metalstack.api.v2.SizeImageConstraintQuery + ``` + + Attributes: + size: + Size of the size image constraint + + ```proto + optional string size = 1; + ``` + name: + Name of the size image constraint to query + + ```proto + optional string name = 2; + ``` + description: + Description of the size image constraint to query + + ```proto + optional string description = 3; + ``` + """ + + __slots__ = ("size", "name", "description") + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: str | None = None, + name: str | None = None, + description: str | None = None, + ) -> None: + pass + + size: str + name: str + description: str + + +_DESC = file_desc( + b'\n,metalstack/api/v2/size_imageconstraint.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"j\n$SizeImageConstraintServiceTryRequest\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12!\n\x05image\x18\x02 \x01(\tR\x05imageB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\'\n%SizeImageConstraintServiceTryResponse"\xa7\x02\n\x13SizeImageConstraint\x12\x1f\n\x04size\x18\x01 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12O\n\x11image_constraints\x18\x02 \x03(\x0b2".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12+\n\x04meta\x18\x03 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x04 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\x07\n\x05_nameB\x0e\n\x0c_description"d\n\x0fImageConstraint\x12!\n\x05image\x18\x01 \x01(\tR\x05imageB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12.\n\x0csemver_match\x18\x02 \x01(\tR\x0bsemverMatchB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"\xbc\x01\n\x18SizeImageConstraintQuery\x12$\n\x04size\x18\x01 \x01(\tH\x00R\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\x07\n\x05_sizeB\x07\n\x05_nameB\x0e\n\x0c_description2\xa1\x01\n\x1aSizeImageConstraintService\x12\x82\x01\n\x03Try\x127.metalstack.api.v2.SizeImageConstraintServiceTryRequest\x1a8.metalstack.api.v2.SizeImageConstraintServiceTryResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xce\x01\n\x15com.metalstack.api.v2B\x18SizeImageconstraintProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "SizeImageConstraintServiceTryRequest": SizeImageConstraintServiceTryRequest, + "SizeImageConstraintServiceTryResponse": SizeImageConstraintServiceTryResponse, + "SizeImageConstraint": SizeImageConstraint, + "ImageConstraint": ImageConstraint, + "SizeImageConstraintQuery": SizeImageConstraintQuery, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/size_imageconstraint.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/size_imageconstraint_pb2.py b/python/metalstack/api/v2/size_imageconstraint_pb2.py deleted file mode 100644 index 6463609d..00000000 --- a/python/metalstack/api/v2/size_imageconstraint_pb2.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/size_imageconstraint.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/size_imageconstraint.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n,metalstack/api/v2/size_imageconstraint.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"j\n$SizeImageConstraintServiceTryRequest\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12!\n\x05image\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05image\"\'\n%SizeImageConstraintServiceTryResponse\"\xa7\x02\n\x13SizeImageConstraint\x12\x1f\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12O\n\x11image_constraints\x18\x02 \x03(\x0b\x32\".metalstack.api.v2.ImageConstraintR\x10imageConstraints\x12+\n\x04meta\x18\x03 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x42\x07\n\x05_nameB\x0e\n\x0c_description\"d\n\x0fImageConstraint\x12!\n\x05image\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x05image\x12.\n\x0csemver_match\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0bsemverMatch\"\xbc\x01\n\x18SizeImageConstraintQuery\x12$\n\x04size\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04size\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x42\x07\n\x05_sizeB\x07\n\x05_nameB\x0e\n\x0c_description2\xa1\x01\n\x1aSizeImageConstraintService\x12\x82\x01\n\x03Try\x12\x37.metalstack.api.v2.SizeImageConstraintServiceTryRequest\x1a\x38.metalstack.api.v2.SizeImageConstraintServiceTryResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xce\x01\n\x15\x63om.metalstack.api.v2B\x18SizeImageconstraintProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.size_imageconstraint_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\030SizeImageconstraintProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST'].fields_by_name['image']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST'].fields_by_name['image']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['name']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['description']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINT'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_IMAGECONSTRAINT'].fields_by_name['image']._loaded_options = None - _globals['_IMAGECONSTRAINT'].fields_by_name['image']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_IMAGECONSTRAINT'].fields_by_name['semver_match']._loaded_options = None - _globals['_IMAGECONSTRAINT'].fields_by_name['semver_match']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['size']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['name']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['description']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Try']._loaded_options = None - _globals['_SIZEIMAGECONSTRAINTSERVICE'].methods_by_name['Try']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST']._serialized_start=170 - _globals['_SIZEIMAGECONSTRAINTSERVICETRYREQUEST']._serialized_end=276 - _globals['_SIZEIMAGECONSTRAINTSERVICETRYRESPONSE']._serialized_start=278 - _globals['_SIZEIMAGECONSTRAINTSERVICETRYRESPONSE']._serialized_end=317 - _globals['_SIZEIMAGECONSTRAINT']._serialized_start=320 - _globals['_SIZEIMAGECONSTRAINT']._serialized_end=615 - _globals['_IMAGECONSTRAINT']._serialized_start=617 - _globals['_IMAGECONSTRAINT']._serialized_end=717 - _globals['_SIZEIMAGECONSTRAINTQUERY']._serialized_start=720 - _globals['_SIZEIMAGECONSTRAINTQUERY']._serialized_end=908 - _globals['_SIZEIMAGECONSTRAINTSERVICE']._serialized_start=911 - _globals['_SIZEIMAGECONSTRAINTSERVICE']._serialized_end=1072 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/size_imageconstraint_pb2.pyi b/python/metalstack/api/v2/size_imageconstraint_pb2.pyi deleted file mode 100644 index c85182d9..00000000 --- a/python/metalstack/api/v2/size_imageconstraint_pb2.pyi +++ /dev/null @@ -1,54 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeImageConstraintServiceTryRequest(_message.Message): - __slots__ = ("size", "image") - SIZE_FIELD_NUMBER: _ClassVar[int] - IMAGE_FIELD_NUMBER: _ClassVar[int] - size: str - image: str - def __init__(self, size: _Optional[str] = ..., image: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintServiceTryResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class SizeImageConstraint(_message.Message): - __slots__ = ("size", "image_constraints", "meta", "name", "description") - SIZE_FIELD_NUMBER: _ClassVar[int] - IMAGE_CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - size: str - image_constraints: _containers.RepeatedCompositeFieldContainer[ImageConstraint] - meta: _common_pb2.Meta - name: str - description: str - def __init__(self, size: _Optional[str] = ..., image_constraints: _Optional[_Iterable[_Union[ImageConstraint, _Mapping]]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... - -class ImageConstraint(_message.Message): - __slots__ = ("image", "semver_match") - IMAGE_FIELD_NUMBER: _ClassVar[int] - SEMVER_MATCH_FIELD_NUMBER: _ClassVar[int] - image: str - semver_match: str - def __init__(self, image: _Optional[str] = ..., semver_match: _Optional[str] = ...) -> None: ... - -class SizeImageConstraintQuery(_message.Message): - __slots__ = ("size", "name", "description") - SIZE_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - size: str - name: str - description: str - def __init__(self, size: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/api/v2/size_pb.py b/python/metalstack/api/v2/size_pb.py new file mode 100644 index 00000000..cdfdb277 --- /dev/null +++ b/python/metalstack/api/v2/size_pb.py @@ -0,0 +1,397 @@ +# Generated from metalstack/api/v2/size.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Labels, Meta + + +_SizeServiceGetRequestFields: TypeAlias = Literal["id"] + +class SizeServiceGetRequest(Message[_SizeServiceGetRequestFields]): + """ + SizeServiceGetRequest is the request payload for a size get request + + ```proto + message metalstack.api.v2.SizeServiceGetRequest + ``` + + Attributes: + id: + ID of the size to get + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_SizeServiceListRequestFields: TypeAlias = Literal["query"] + +class SizeServiceListRequest(Message[_SizeServiceListRequestFields]): + """ + SizeServiceListRequest is the request payload for a size list request + + ```proto + message metalstack.api.v2.SizeServiceListRequest + ``` + + Attributes: + query: + Query for sizes + + ```proto + optional metalstack.api.v2.SizeQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: SizeQuery | None = None, + ) -> None: + pass + + query: SizeQuery | None + +_SizeServiceGetResponseFields: TypeAlias = Literal["size"] + +class SizeServiceGetResponse(Message[_SizeServiceGetResponseFields]): + """ + SizeServiceGetResponse is the response payload for a size get request + + ```proto + message metalstack.api.v2.SizeServiceGetResponse + ``` + + Attributes: + size: + Size the size + + ```proto + optional metalstack.api.v2.Size size = 1; + ``` + """ + + __slots__ = ("size",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size: Size | None = None, + ) -> None: + pass + + size: Size | None + +_SizeServiceListResponseFields: TypeAlias = Literal["sizes"] + +class SizeServiceListResponse(Message[_SizeServiceListResponseFields]): + """ + SizeServiceListResponse is the response payload for a size list request + + ```proto + message metalstack.api.v2.SizeServiceListResponse + ``` + + Attributes: + sizes: + Sizes the sizes + + ```proto + repeated metalstack.api.v2.Size sizes = 1; + ``` + """ + + __slots__ = ("sizes",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + sizes: list[Size] | None = None, + ) -> None: + pass + + sizes: list[Size] + +_SizeFields: TypeAlias = Literal["id", "meta", "name", "description", "constraints"] + +class Size(Message[_SizeFields]): + """ + Size + + ```proto + message metalstack.api.v2.Size + ``` + + Attributes: + id: + Id of this size + + ```proto + string id = 1; + ``` + meta: + Meta for this size + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this size + + ```proto + optional string name = 3; + ``` + description: + Description of this size + + ```proto + optional string description = 4; + ``` + constraints: + Constraints which must match that a specific machine is considered of this size + + ```proto + repeated metalstack.api.v2.SizeConstraint constraints = 5; + ``` + """ + + __slots__ = ("id", "meta", "name", "description", "constraints") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + name: str | None = None, + description: str | None = None, + constraints: list[SizeConstraint] | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + name: str + description: str + constraints: list[SizeConstraint] + +_SizeConstraintFields: TypeAlias = Literal["type", "min", "max", "identifier"] + +class SizeConstraint(Message[_SizeConstraintFields]): + """ + SizeConstraint defines the boundaries for certain type of machine property which must match to identify this machine as this size. + + ```proto + message metalstack.api.v2.SizeConstraint + ``` + + Attributes: + type: + Type a machine matches to a size in order to make them easier to categorize + + ```proto + metalstack.api.v2.SizeConstraintType type = 1; + ``` + min: + Min the minimum value of the constraint + + ```proto + uint64 min = 2; + ``` + max: + Max the maximum value of the constraint + + ```proto + uint64 max = 3; + ``` + identifier: + Identifier glob pattern which matches to the given type, for example gpu pci id + + ```proto + optional string identifier = 4; + ``` + """ + + __slots__ = ("type", "min", "max", "identifier") + + if TYPE_CHECKING: + + def __init__( + self, + *, + type: SizeConstraintType | None = None, + min: int = 0, + max: int = 0, + identifier: str | None = None, + ) -> None: + pass + + type: SizeConstraintType + min: int + max: int + identifier: str + +_SizeQueryFields: TypeAlias = Literal["id", "name", "description", "labels"] + +class SizeQuery(Message[_SizeQueryFields]): + """ + SizeQuery is used to search sizes + + ```proto + message metalstack.api.v2.SizeQuery + ``` + + Attributes: + id: + ID of the size to get + + ```proto + optional string id = 1; + ``` + name: + Name of the size to query + + ```proto + optional string name = 2; + ``` + description: + Description of the size to query + + ```proto + optional string description = 3; + ``` + labels: + Labels lists only sizes containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 4; + ``` + """ + + __slots__ = ("id", "name", "description", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + name: str | None = None, + description: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + id: str + name: str + description: str + labels: Labels | None + +class SizeConstraintType(Enum): + """ + SizeConstraintType defines the property for which a constraint is defined + + ```proto + enum metalstack.api.v2.SizeConstraintType + ``` + + Attributes: + UNSPECIFIED: + SIZE_CONSTRAINT_TYPE_UNSPECIFIED type is not specified + + ```proto + SIZE_CONSTRAINT_TYPE_UNSPECIFIED = 0 + ``` + CORES: + SIZE_CONSTRAINT_TYPE_CORES defines the number of cores as property + + ```proto + SIZE_CONSTRAINT_TYPE_CORES = 1 + ``` + MEMORY: + SIZE_CONSTRAINT_TYPE_MEMORY defines the amount of memory as property + + ```proto + SIZE_CONSTRAINT_TYPE_MEMORY = 2 + ``` + STORAGE: + SIZE_CONSTRAINT_TYPE_STORAGE defines the amount of storage as property + + ```proto + SIZE_CONSTRAINT_TYPE_STORAGE = 3 + ``` + GPU: + SIZE_CONSTRAINT_TYPE_GPU defines the number of gpus as property + + ```proto + SIZE_CONSTRAINT_TYPE_GPU = 4 + ``` + """ + + UNSPECIFIED = 0 + CORES = 1 + MEMORY = 2 + STORAGE = 3 + GPU = 4 + + +_DESC = file_desc( + b'\n\x1cmetalstack/api/v2/size.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"4\n\x15SizeServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"L\n\x16SizeServiceListRequest\x122\n\x05query\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.SizeQueryR\x05query"E\n\x16SizeServiceGetResponse\x12+\n\x04size\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.SizeR\x04size"H\n\x17SizeServiceListResponse\x12-\n\x05sizes\x18\x01 \x03(\x0b2\x17.metalstack.api.v2.SizeR\x05sizes"\x88\x02\n\x04Size\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x04 \x01(\tH\x01R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12C\n\x0bconstraints\x18\x05 \x03(\x0b2!.metalstack.api.v2.SizeConstraintR\x0bconstraintsB\x07\n\x05_nameB\x0e\n\x0c_description"\xb9\x01\n\x0eSizeConstraint\x12C\n\x04type\x18\x01 \x01(\x0e2%.metalstack.api.v2.SizeConstraintTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x10\n\x03min\x18\x02 \x01(\x04R\x03min\x12\x10\n\x03max\x18\x03 \x01(\x04R\x03max\x12/\n\nidentifier\x18\x04 \x01(\tH\x00R\nidentifierB\n\xbaH\x07r\x05\x10\x00\x18\x80\x01\x88\x01\x01B\r\n\x0b_identifier"\xea\x01\n\tSizeQuery\x12 \n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x04 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01B\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels*\xe8\x01\n\x12SizeConstraintType\x12$\n SIZE_CONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12)\n\x1aSIZE_CONSTRAINT_TYPE_CORES\x10\x01\x1a\t\x82\xb2\x19\x05cores\x12+\n\x1bSIZE_CONSTRAINT_TYPE_MEMORY\x10\x02\x1a\n\x82\xb2\x19\x06memory\x12-\n\x1cSIZE_CONSTRAINT_TYPE_STORAGE\x10\x03\x1a\x0b\x82\xb2\x19\x07storage\x12%\n\x18SIZE_CONSTRAINT_TYPE_GPU\x10\x04\x1a\x07\x82\xb2\x19\x03gpu2\xdc\x01\n\x0bSizeService\x12d\n\x03Get\x12(.metalstack.api.v2.SizeServiceGetRequest\x1a).metalstack.api.v2.SizeServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12g\n\x04List\x12).metalstack.api.v2.SizeServiceListRequest\x1a*.metalstack.api.v2.SizeServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xbf\x01\n\x15com.metalstack.api.v2B\tSizeProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "SizeServiceGetRequest": SizeServiceGetRequest, + "SizeServiceListRequest": SizeServiceListRequest, + "SizeServiceGetResponse": SizeServiceGetResponse, + "SizeServiceListResponse": SizeServiceListResponse, + "Size": Size, + "SizeConstraint": SizeConstraint, + "SizeQuery": SizeQuery, + "SizeConstraintType": SizeConstraintType, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/size.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/size_pb2.py b/python/metalstack/api/v2/size_pb2.py deleted file mode 100644 index 2453c2e1..00000000 --- a/python/metalstack/api/v2/size_pb2.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/size.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/size.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cmetalstack/api/v2/size.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"4\n\x15SizeServiceGetRequest\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\"L\n\x16SizeServiceListRequest\x12\x32\n\x05query\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.SizeQueryR\x05query\"E\n\x16SizeServiceGetResponse\x12+\n\x04size\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.SizeR\x04size\"H\n\x17SizeServiceListResponse\x12-\n\x05sizes\x18\x01 \x03(\x0b\x32\x17.metalstack.api.v2.SizeR\x05sizes\"\x88\x02\n\x04Size\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x01R\x0b\x64\x65scription\x88\x01\x01\x12\x43\n\x0b\x63onstraints\x18\x05 \x03(\x0b\x32!.metalstack.api.v2.SizeConstraintR\x0b\x63onstraintsB\x07\n\x05_nameB\x0e\n\x0c_description\"\xb9\x01\n\x0eSizeConstraint\x12\x43\n\x04type\x18\x01 \x01(\x0e\x32%.metalstack.api.v2.SizeConstraintTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x10\n\x03min\x18\x02 \x01(\x04R\x03min\x12\x10\n\x03max\x18\x03 \x01(\x04R\x03max\x12/\n\nidentifier\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x00\x18\x80\x01H\x00R\nidentifier\x88\x01\x01\x42\r\n\x0b_identifier\"\xea\x01\n\tSizeQuery\x12 \n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x36\n\x06labels\x18\x04 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\t\n\x07_labels*\xe8\x01\n\x12SizeConstraintType\x12$\n SIZE_CONSTRAINT_TYPE_UNSPECIFIED\x10\x00\x12)\n\x1aSIZE_CONSTRAINT_TYPE_CORES\x10\x01\x1a\t\x82\xb2\x19\x05\x63ores\x12+\n\x1bSIZE_CONSTRAINT_TYPE_MEMORY\x10\x02\x1a\n\x82\xb2\x19\x06memory\x12-\n\x1cSIZE_CONSTRAINT_TYPE_STORAGE\x10\x03\x1a\x0b\x82\xb2\x19\x07storage\x12%\n\x18SIZE_CONSTRAINT_TYPE_GPU\x10\x04\x1a\x07\x82\xb2\x19\x03gpu2\xdc\x01\n\x0bSizeService\x12\x64\n\x03Get\x12(.metalstack.api.v2.SizeServiceGetRequest\x1a).metalstack.api.v2.SizeServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12g\n\x04List\x12).metalstack.api.v2.SizeServiceListRequest\x1a*.metalstack.api.v2.SizeServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xbf\x01\n\x15\x63om.metalstack.api.v2B\tSizeProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.size_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\tSizeProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_CORES"]._loaded_options = None - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_CORES"]._serialized_options = b'\202\262\031\005cores' - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_MEMORY"]._loaded_options = None - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_MEMORY"]._serialized_options = b'\202\262\031\006memory' - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_STORAGE"]._loaded_options = None - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_STORAGE"]._serialized_options = b'\202\262\031\007storage' - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_GPU"]._loaded_options = None - _globals['_SIZECONSTRAINTTYPE'].values_by_name["SIZE_CONSTRAINT_TYPE_GPU"]._serialized_options = b'\202\262\031\003gpu' - _globals['_SIZESERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZESERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZE'].fields_by_name['id']._loaded_options = None - _globals['_SIZE'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZE'].fields_by_name['name']._loaded_options = None - _globals['_SIZE'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZE'].fields_by_name['description']._loaded_options = None - _globals['_SIZE'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZECONSTRAINT'].fields_by_name['type']._loaded_options = None - _globals['_SIZECONSTRAINT'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SIZECONSTRAINT'].fields_by_name['identifier']._loaded_options = None - _globals['_SIZECONSTRAINT'].fields_by_name['identifier']._serialized_options = b'\272H\007r\005\020\000\030\200\001' - _globals['_SIZEQUERY'].fields_by_name['id']._loaded_options = None - _globals['_SIZEQUERY'].fields_by_name['id']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEQUERY'].fields_by_name['name']._loaded_options = None - _globals['_SIZEQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZEQUERY'].fields_by_name['description']._loaded_options = None - _globals['_SIZEQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZESERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_SIZESERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_SIZESERVICE'].methods_by_name['List']._loaded_options = None - _globals['_SIZESERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_SIZECONSTRAINTTYPE']._serialized_start=1124 - _globals['_SIZECONSTRAINTTYPE']._serialized_end=1356 - _globals['_SIZESERVICEGETREQUEST']._serialized_start=154 - _globals['_SIZESERVICEGETREQUEST']._serialized_end=206 - _globals['_SIZESERVICELISTREQUEST']._serialized_start=208 - _globals['_SIZESERVICELISTREQUEST']._serialized_end=284 - _globals['_SIZESERVICEGETRESPONSE']._serialized_start=286 - _globals['_SIZESERVICEGETRESPONSE']._serialized_end=355 - _globals['_SIZESERVICELISTRESPONSE']._serialized_start=357 - _globals['_SIZESERVICELISTRESPONSE']._serialized_end=429 - _globals['_SIZE']._serialized_start=432 - _globals['_SIZE']._serialized_end=696 - _globals['_SIZECONSTRAINT']._serialized_start=699 - _globals['_SIZECONSTRAINT']._serialized_end=884 - _globals['_SIZEQUERY']._serialized_start=887 - _globals['_SIZEQUERY']._serialized_end=1121 - _globals['_SIZESERVICE']._serialized_start=1359 - _globals['_SIZESERVICE']._serialized_end=1579 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/size_pb2.pyi b/python/metalstack/api/v2/size_pb2.pyi deleted file mode 100644 index f4fb7056..00000000 --- a/python/metalstack/api/v2/size_pb2.pyi +++ /dev/null @@ -1,86 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeConstraintType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SIZE_CONSTRAINT_TYPE_UNSPECIFIED: _ClassVar[SizeConstraintType] - SIZE_CONSTRAINT_TYPE_CORES: _ClassVar[SizeConstraintType] - SIZE_CONSTRAINT_TYPE_MEMORY: _ClassVar[SizeConstraintType] - SIZE_CONSTRAINT_TYPE_STORAGE: _ClassVar[SizeConstraintType] - SIZE_CONSTRAINT_TYPE_GPU: _ClassVar[SizeConstraintType] -SIZE_CONSTRAINT_TYPE_UNSPECIFIED: SizeConstraintType -SIZE_CONSTRAINT_TYPE_CORES: SizeConstraintType -SIZE_CONSTRAINT_TYPE_MEMORY: SizeConstraintType -SIZE_CONSTRAINT_TYPE_STORAGE: SizeConstraintType -SIZE_CONSTRAINT_TYPE_GPU: SizeConstraintType - -class SizeServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class SizeServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: SizeQuery - def __init__(self, query: _Optional[_Union[SizeQuery, _Mapping]] = ...) -> None: ... - -class SizeServiceGetResponse(_message.Message): - __slots__ = ("size",) - SIZE_FIELD_NUMBER: _ClassVar[int] - size: Size - def __init__(self, size: _Optional[_Union[Size, _Mapping]] = ...) -> None: ... - -class SizeServiceListResponse(_message.Message): - __slots__ = ("sizes",) - SIZES_FIELD_NUMBER: _ClassVar[int] - sizes: _containers.RepeatedCompositeFieldContainer[Size] - def __init__(self, sizes: _Optional[_Iterable[_Union[Size, _Mapping]]] = ...) -> None: ... - -class Size(_message.Message): - __slots__ = ("id", "meta", "name", "description", "constraints") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - CONSTRAINTS_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - name: str - description: str - constraints: _containers.RepeatedCompositeFieldContainer[SizeConstraint] - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., constraints: _Optional[_Iterable[_Union[SizeConstraint, _Mapping]]] = ...) -> None: ... - -class SizeConstraint(_message.Message): - __slots__ = ("type", "min", "max", "identifier") - TYPE_FIELD_NUMBER: _ClassVar[int] - MIN_FIELD_NUMBER: _ClassVar[int] - MAX_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - type: SizeConstraintType - min: int - max: int - identifier: str - def __init__(self, type: _Optional[_Union[SizeConstraintType, str]] = ..., min: _Optional[int] = ..., max: _Optional[int] = ..., identifier: _Optional[str] = ...) -> None: ... - -class SizeQuery(_message.Message): - __slots__ = ("id", "name", "description", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - name: str - description: str - labels: _common_pb2.Labels - def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/size_reservation_connect.py b/python/metalstack/api/v2/size_reservation_connect.py index 6d139d0a..2d8cb75d 100644 --- a/python/metalstack/api/v2/size_reservation_connect.py +++ b/python/metalstack/api/v2/size_reservation_connect.py @@ -1,32 +1,48 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/size_reservation.proto +# Generated from metalstack/api/v2/size_reservation.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.size_reservation_pb2 as metalstack_dot_api_dot_v2_dot_size__reservation__pb2 + +from .size_reservation_pb import SizeReservationServiceGetRequest, SizeReservationServiceGetResponse, SizeReservationServiceListRequest, SizeReservationServiceListResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SizeReservationService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: SizeReservationServiceGetRequest, ctx: RequestContext[SizeReservationServiceGetRequest, SizeReservationServiceGetResponse]) -> SizeReservationServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: SizeReservationServiceListRequest, ctx: RequestContext[SizeReservationServiceListRequest, SizeReservationServiceListResponse]) -> SizeReservationServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeReservationServiceASGIApplication(ConnectASGIApplication[SizeReservationService]): - def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeReservationService | AsyncGenerator[SizeReservationService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -34,8 +50,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse, + input=SizeReservationServiceGetRequest, + output=SizeReservationServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -44,8 +60,8 @@ def __init__(self, service: SizeReservationService | AsyncGenerator[SizeReservat method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -66,18 +82,18 @@ def path(self) -> str: class SizeReservationServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, + request: SizeReservationServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse: + ) -> SizeReservationServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse, + input=SizeReservationServiceGetRequest, + output=SizeReservationServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -86,45 +102,49 @@ async def get( async def list( self, - request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, + request: SizeReservationServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: + ) -> SizeReservationServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class SizeReservationServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: SizeReservationServiceGetRequest, ctx: RequestContext[SizeReservationServiceGetRequest, SizeReservationServiceGetResponse]) -> SizeReservationServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: SizeReservationServiceListRequest, ctx: RequestContext[SizeReservationServiceListRequest, SizeReservationServiceListResponse]) -> SizeReservationServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SizeReservationServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SizeReservationServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.SizeReservationService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse, + input=SizeReservationServiceGetRequest, + output=SizeReservationServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -133,8 +153,8 @@ def __init__(self, service: SizeReservationServiceSync, interceptors: Iterable[I method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -155,42 +175,39 @@ def path(self) -> str: class SizeReservationServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, + request: SizeReservationServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse: + ) -> SizeReservationServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceGetResponse, + input=SizeReservationServiceGetRequest, + output=SizeReservationServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, + request: SizeReservationServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse: + ) -> SizeReservationServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.SizeReservationService", - input=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_size__reservation__pb2.SizeReservationServiceListResponse, + input=SizeReservationServiceListRequest, + output=SizeReservationServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/size_reservation_pb.py b/python/metalstack/api/v2/size_reservation_pb.py new file mode 100644 index 00000000..4308376e --- /dev/null +++ b/python/metalstack/api/v2/size_reservation_pb.py @@ -0,0 +1,356 @@ +# Generated from metalstack/api/v2/size_reservation.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .common_pb import Labels, Meta + + +_SizeReservationServiceGetRequestFields: TypeAlias = Literal["id", "project"] + +class SizeReservationServiceGetRequest(Message[_SizeReservationServiceGetRequestFields]): + """ + SizeReservationServiceGetRequest is the request payload for a size get request + + ```proto + message metalstack.api.v2.SizeReservationServiceGetRequest + ``` + + Attributes: + id: + ID of the size reservation to get + + ```proto + string id = 1; + ``` + project: + Project of the size reservation + + ```proto + string project = 2; + ``` + """ + + __slots__ = ("id", "project") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + project: str = "", + ) -> None: + pass + + id: str + project: str + +_SizeReservationServiceListRequestFields: TypeAlias = Literal["project", "query"] + +class SizeReservationServiceListRequest(Message[_SizeReservationServiceListRequestFields]): + """ + SizeReservationServiceListRequest is the request payload for a size list request + + ```proto + message metalstack.api.v2.SizeReservationServiceListRequest + ``` + + Attributes: + project: + Project of the size reservation + + ```proto + string project = 1; + ``` + query: + Query for size reservations + + ```proto + optional metalstack.api.v2.SizeReservationQuery query = 2; + ``` + """ + + __slots__ = ("project", "query") + + if TYPE_CHECKING: + + def __init__( + self, + *, + project: str = "", + query: SizeReservationQuery | None = None, + ) -> None: + pass + + project: str + query: SizeReservationQuery | None + +_SizeReservationServiceGetResponseFields: TypeAlias = Literal["size_reservation"] + +class SizeReservationServiceGetResponse(Message[_SizeReservationServiceGetResponseFields]): + """ + SizeReservationServiceGetResponse is the response payload for a size reservation get request + + ```proto + message metalstack.api.v2.SizeReservationServiceGetResponse + ``` + + Attributes: + size_reservation: + Size reservation + + ```proto + optional metalstack.api.v2.SizeReservation size_reservation = 1; + ``` + """ + + __slots__ = ("size_reservation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservation: SizeReservation | None = None, + ) -> None: + pass + + size_reservation: SizeReservation | None + +_SizeReservationServiceListResponseFields: TypeAlias = Literal["size_reservations"] + +class SizeReservationServiceListResponse(Message[_SizeReservationServiceListResponseFields]): + """ + SizeReservationServiceListResponse is the response payload for a size reservation list request + + ```proto + message metalstack.api.v2.SizeReservationServiceListResponse + ``` + + Attributes: + size_reservations: + Size reservations + + ```proto + repeated metalstack.api.v2.SizeReservation size_reservations = 1; + ``` + """ + + __slots__ = ("size_reservations",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + size_reservations: list[SizeReservation] | None = None, + ) -> None: + pass + + size_reservations: list[SizeReservation] + +_SizeReservationFields: TypeAlias = Literal["id", "meta", "name", "description", "project", "size", "partitions", "amount"] + +class SizeReservation(Message[_SizeReservationFields]): + """ + SizeReservation + + ```proto + message metalstack.api.v2.SizeReservation + ``` + + Attributes: + id: + Id of this size reservation, is generated on creation + + ```proto + string id = 1; + ``` + meta: + Meta for this size reservation + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of this size reservation + + ```proto + string name = 3; + ``` + description: + Description of this size reservation + + ```proto + string description = 4; + ``` + project: + Project of the size reservation + + ```proto + string project = 5; + ``` + size: + Size id of this size reservation + + ```proto + string size = 6; + ``` + partitions: + Partition ids of this size reservation + + ```proto + repeated string partitions = 7; + ``` + amount: + Amount of reservations of this size reservation + + ```proto + int32 amount = 8; + ``` + """ + + __slots__ = ("id", "meta", "name", "description", "project", "size", "partitions", "amount") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + name: str = "", + description: str = "", + project: str = "", + size: str = "", + partitions: list[str] | None = None, + amount: int = 0, + ) -> None: + pass + + id: str + meta: Meta | None + name: str + description: str + project: str + size: str + partitions: list[str] + amount: int + +_SizeReservationQueryFields: TypeAlias = Literal["id", "name", "description", "size", "project", "partition", "labels"] + +class SizeReservationQuery(Message[_SizeReservationQueryFields]): + """ + SizeReservationQuery is used to search size reservations + + ```proto + message metalstack.api.v2.SizeReservationQuery + ``` + + Attributes: + id: + ID of the size reservation to get + + ```proto + optional string id = 1; + ``` + name: + Name of this size reservation + + ```proto + optional string name = 2; + ``` + description: + Description of this size reservation + + ```proto + optional string description = 3; + ``` + size: + Size id of this size reservation + + ```proto + optional string size = 4; + ``` + project: + Project of the size reservation + + ```proto + optional string project = 5; + ``` + partition: + Partition of the size reservation + + ```proto + optional string partition = 6; + ``` + labels: + Labels lists only size reservations containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 7; + ``` + """ + + __slots__ = ("id", "name", "description", "size", "project", "partition", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + name: str | None = None, + description: str | None = None, + size: str | None = None, + project: str | None = None, + partition: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + id: str + name: str + description: str + size: str + project: str + partition: str + labels: Labels | None + + +_DESC = file_desc( + b'\n(metalstack/api/v2/size_reservation.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"`\n SizeReservationServiceGetRequest\x12\x18\n\x02id\x18\x01 \x01(\tR\x02idB\x08\xbaH\x05r\x03\xb0\x01\x01\x12"\n\x07project\x18\x02 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01"\x86\x01\n!SizeReservationServiceListRequest\x12"\n\x07project\x18\x01 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12=\n\x05query\x18\x02 \x01(\x0b2\'.metalstack.api.v2.SizeReservationQueryR\x05query"r\n!SizeReservationServiceGetResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b2".metalstack.api.v2.SizeReservationR\x0fsizeReservation"u\n"SizeReservationServiceListResponse\x12O\n\x11size_reservations\x18\x01 \x03(\x0b2".metalstack.api.v2.SizeReservationR\x10sizeReservations"\xc7\x02\n\x0fSizeReservation\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08\xd8\x01\x01r\x03\xb0\x01\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12-\n\x0bdescription\x18\x04 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12"\n\x07project\x18\x05 \x01(\tR\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1f\n\x04size\x18\x06 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x124\n\npartitions\x18\x07 \x03(\tR\npartitionsB\x14\xbaH\x11\x92\x01\x0e\x08\x01\x18\x01"\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12\x1f\n\x06amount\x18\x08 \x01(\x05R\x06amountB\x07\xbaH\x04\x1a\x02 \x00"\x94\x03\n\x14SizeReservationQuery\x12\x1d\n\x02id\x18\x01 \x01(\tH\x00R\x02idB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04size\x18\x04 \x01(\tH\x03R\x04sizeB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tH\x04R\x07projectB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12.\n\tpartition\x18\x06 \x01(\tH\x05R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x07 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x06R\x06labels\x88\x01\x01B\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_sizeB\n\n\x08_projectB\x0c\n\n_partitionB\t\n\x07_labels2\x9a\x02\n\x16SizeReservationService\x12}\n\x03Get\x123.metalstack.api.v2.SizeReservationServiceGetRequest\x1a4.metalstack.api.v2.SizeReservationServiceGetResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12\x80\x01\n\x04List\x124.metalstack.api.v2.SizeReservationServiceListRequest\x1a5.metalstack.api.v2.SizeReservationServiceListResponse"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02B\xca\x01\n\x15com.metalstack.api.v2B\x14SizeReservationProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "SizeReservationServiceGetRequest": SizeReservationServiceGetRequest, + "SizeReservationServiceListRequest": SizeReservationServiceListRequest, + "SizeReservationServiceGetResponse": SizeReservationServiceGetResponse, + "SizeReservationServiceListResponse": SizeReservationServiceListResponse, + "SizeReservation": SizeReservation, + "SizeReservationQuery": SizeReservationQuery, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/size_reservation.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/size_reservation_pb2.py b/python/metalstack/api/v2/size_reservation_pb2.py deleted file mode 100644 index 51e78007..00000000 --- a/python/metalstack/api/v2/size_reservation_pb2.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/size_reservation.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/size_reservation.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(metalstack/api/v2/size_reservation.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"`\n SizeReservationServiceGetRequest\x12\x18\n\x02id\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x02id\x12\"\n\x07project\x18\x02 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\"\x86\x01\n!SizeReservationServiceListRequest\x12\"\n\x07project\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12=\n\x05query\x18\x02 \x01(\x0b\x32\'.metalstack.api.v2.SizeReservationQueryR\x05query\"r\n!SizeReservationServiceGetResponse\x12M\n\x10size_reservation\x18\x01 \x01(\x0b\x32\".metalstack.api.v2.SizeReservationR\x0fsizeReservation\"u\n\"SizeReservationServiceListResponse\x12O\n\x11size_reservations\x18\x01 \x03(\x0b\x32\".metalstack.api.v2.SizeReservationR\x10sizeReservations\"\xc7\x02\n\x0fSizeReservation\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x03\xb0\x01\x01\xd8\x01\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12-\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12\"\n\x07project\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x07project\x12\x1f\n\x04size\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04size\x12\x34\n\npartitions\x18\x07 \x03(\tB\x14\xbaH\x11\x92\x01\x0e\x08\x01\x18\x01\"\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\npartitions\x12\x1f\n\x06\x61mount\x18\x08 \x01(\x05\x42\x07\xbaH\x04\x1a\x02 \x00R\x06\x61mount\"\x94\x03\n\x14SizeReservationQuery\x12\x1d\n\x02id\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x02id\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12$\n\x04size\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04size\x88\x01\x01\x12\'\n\x07project\x18\x05 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x04R\x07project\x88\x01\x01\x12.\n\tpartition\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x05R\tpartition\x88\x01\x01\x12\x36\n\x06labels\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x06R\x06labels\x88\x01\x01\x42\x05\n\x03_idB\x07\n\x05_nameB\x0e\n\x0c_descriptionB\x07\n\x05_sizeB\n\n\x08_projectB\x0c\n\n_partitionB\t\n\x07_labels2\x9a\x02\n\x16SizeReservationService\x12}\n\x03Get\x12\x33.metalstack.api.v2.SizeReservationServiceGetRequest\x1a\x34.metalstack.api.v2.SizeReservationServiceGetResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x12\x80\x01\n\x04List\x12\x34.metalstack.api.v2.SizeReservationServiceListRequest\x1a\x35.metalstack.api.v2.SizeReservationServiceListResponse\"\x0b\xca\xf3\x18\x03\x01\x02\x03\xe0\xf3\x18\x02\x42\xca\x01\n\x15\x63om.metalstack.api.v2B\x14SizeReservationProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.size_reservation_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\024SizeReservationProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_SIZERESERVATIONSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONSERVICEGETREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_SIZERESERVATIONSERVICEGETREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONSERVICELISTREQUEST'].fields_by_name['project']._loaded_options = None - _globals['_SIZERESERVATIONSERVICELISTREQUEST'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATION'].fields_by_name['id']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['id']._serialized_options = b'\272H\010r\003\260\001\001\330\001\001' - _globals['_SIZERESERVATION'].fields_by_name['name']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZERESERVATION'].fields_by_name['description']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZERESERVATION'].fields_by_name['project']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATION'].fields_by_name['size']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZERESERVATION'].fields_by_name['partitions']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['partitions']._serialized_options = b'\272H\021\222\001\016\010\001\030\001\"\010r\006\320\263\256\261\002\001' - _globals['_SIZERESERVATION'].fields_by_name['amount']._loaded_options = None - _globals['_SIZERESERVATION'].fields_by_name['amount']._serialized_options = b'\272H\004\032\002 \000' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['id']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['id']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['name']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['description']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['size']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['size']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['project']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['project']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SIZERESERVATIONQUERY'].fields_by_name['partition']._loaded_options = None - _globals['_SIZERESERVATIONQUERY'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['Get']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_SIZERESERVATIONSERVICE'].methods_by_name['List']._serialized_options = b'\312\363\030\003\001\002\003\340\363\030\002' - _globals['_SIZERESERVATIONSERVICEGETREQUEST']._serialized_start=166 - _globals['_SIZERESERVATIONSERVICEGETREQUEST']._serialized_end=262 - _globals['_SIZERESERVATIONSERVICELISTREQUEST']._serialized_start=265 - _globals['_SIZERESERVATIONSERVICELISTREQUEST']._serialized_end=399 - _globals['_SIZERESERVATIONSERVICEGETRESPONSE']._serialized_start=401 - _globals['_SIZERESERVATIONSERVICEGETRESPONSE']._serialized_end=515 - _globals['_SIZERESERVATIONSERVICELISTRESPONSE']._serialized_start=517 - _globals['_SIZERESERVATIONSERVICELISTRESPONSE']._serialized_end=634 - _globals['_SIZERESERVATION']._serialized_start=637 - _globals['_SIZERESERVATION']._serialized_end=964 - _globals['_SIZERESERVATIONQUERY']._serialized_start=967 - _globals['_SIZERESERVATIONQUERY']._serialized_end=1371 - _globals['_SIZERESERVATIONSERVICE']._serialized_start=1374 - _globals['_SIZERESERVATIONSERVICE']._serialized_end=1656 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/size_reservation_pb2.pyi b/python/metalstack/api/v2/size_reservation_pb2.pyi deleted file mode 100644 index 135255bc..00000000 --- a/python/metalstack/api/v2/size_reservation_pb2.pyi +++ /dev/null @@ -1,76 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SizeReservationServiceGetRequest(_message.Message): - __slots__ = ("id", "project") - ID_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - id: str - project: str - def __init__(self, id: _Optional[str] = ..., project: _Optional[str] = ...) -> None: ... - -class SizeReservationServiceListRequest(_message.Message): - __slots__ = ("project", "query") - PROJECT_FIELD_NUMBER: _ClassVar[int] - QUERY_FIELD_NUMBER: _ClassVar[int] - project: str - query: SizeReservationQuery - def __init__(self, project: _Optional[str] = ..., query: _Optional[_Union[SizeReservationQuery, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceGetResponse(_message.Message): - __slots__ = ("size_reservation",) - SIZE_RESERVATION_FIELD_NUMBER: _ClassVar[int] - size_reservation: SizeReservation - def __init__(self, size_reservation: _Optional[_Union[SizeReservation, _Mapping]] = ...) -> None: ... - -class SizeReservationServiceListResponse(_message.Message): - __slots__ = ("size_reservations",) - SIZE_RESERVATIONS_FIELD_NUMBER: _ClassVar[int] - size_reservations: _containers.RepeatedCompositeFieldContainer[SizeReservation] - def __init__(self, size_reservations: _Optional[_Iterable[_Union[SizeReservation, _Mapping]]] = ...) -> None: ... - -class SizeReservation(_message.Message): - __slots__ = ("id", "meta", "name", "description", "project", "size", "partitions", "amount") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - PARTITIONS_FIELD_NUMBER: _ClassVar[int] - AMOUNT_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - name: str - description: str - project: str - size: str - partitions: _containers.RepeatedScalarFieldContainer[str] - amount: int - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., project: _Optional[str] = ..., size: _Optional[str] = ..., partitions: _Optional[_Iterable[str]] = ..., amount: _Optional[int] = ...) -> None: ... - -class SizeReservationQuery(_message.Message): - __slots__ = ("id", "name", "description", "size", "project", "partition", "labels") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - id: str - name: str - description: str - size: str - project: str - partition: str - labels: _common_pb2.Labels - def __init__(self, id: _Optional[str] = ..., name: _Optional[str] = ..., description: _Optional[str] = ..., size: _Optional[str] = ..., project: _Optional[str] = ..., partition: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/switch_pb.py b/python/metalstack/api/v2/switch_pb.py new file mode 100644 index 00000000..1ce2538e --- /dev/null +++ b/python/metalstack/api/v2/switch_pb.py @@ -0,0 +1,963 @@ +# Generated from metalstack/api/v2/switch.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from . import common_pb, machine_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from .common_pb import Meta + from .machine_pb import Machine, MachineFRU + + +_SwitchFields: TypeAlias = Literal["id", "meta", "description", "rack", "room", "partition", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os", "machine_connections", "last_sync", "last_sync_error"] + +class Switch(Message[_SwitchFields]): + """ + Switch represents a network switch. + + ```proto + message metalstack.api.v2.Switch + ``` + + Attributes: + id: + Id of the switch. + + ```proto + string id = 1; + ``` + meta: + Meta for this switch. + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + description: + Description of the switch. + + ```proto + string description = 3; + ``` + rack: + Rack ID if the switch resides in a rack. + + ```proto + optional string rack = 4; + ``` + room: + Room ID if the switch resides in a room. + + ```proto + optional string room = 5; + ``` + partition: + Partition the switch belongs to. + + ```proto + string partition = 6; + ``` + replace_mode: + ReplaceMode is used to mark a switch ready for replacement. + + ```proto + metalstack.api.v2.SwitchReplaceMode replace_mode = 7; + ``` + management_ip: + ManagementIp is the switch's IP for management access. + + ```proto + string management_ip = 8; + ``` + management_user: + ManagementUser is the user name to use for management access. + + ```proto + optional string management_user = 9; + ``` + console_command: + ConsoleCommand is the command for accessing the switch's console. + + ```proto + optional string console_command = 10; + ``` + nics: + Nics are the front panel ports of the switch. + + ```proto + repeated metalstack.api.v2.SwitchNic nics = 11; + ``` + os: + SwitchOs is the OS running on the switch. + + ```proto + optional metalstack.api.v2.SwitchOS os = 12; + ``` + machine_connections: + MachineConnections map machines to the nics they are connected to. + + ```proto + repeated metalstack.api.v2.MachineConnection machine_connections = 13; + ``` + last_sync: + LastSync contains information about the last heartbeat of the switch. + + ```proto + optional metalstack.api.v2.SwitchSync last_sync = 14; + ``` + last_sync_error: + LastSyncError contains information about the last unsuccessful heartbeat of the switch. + + ```proto + optional metalstack.api.v2.SwitchSync last_sync_error = 15; + ``` + """ + + __slots__ = ("id", "meta", "description", "rack", "room", "partition", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os", "machine_connections", "last_sync", "last_sync_error") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + meta: Meta | None = None, + description: str = "", + rack: str | None = None, + room: str | None = None, + partition: str = "", + replace_mode: SwitchReplaceMode | None = None, + management_ip: str = "", + management_user: str | None = None, + console_command: str | None = None, + nics: list[SwitchNic] | None = None, + os: SwitchOS | None = None, + machine_connections: list[MachineConnection] | None = None, + last_sync: SwitchSync | None = None, + last_sync_error: SwitchSync | None = None, + ) -> None: + pass + + id: str + meta: Meta | None + description: str + rack: str + room: str + partition: str + replace_mode: SwitchReplaceMode + management_ip: str + management_user: str + console_command: str + nics: list[SwitchNic] + os: SwitchOS | None + machine_connections: list[MachineConnection] + last_sync: SwitchSync | None + last_sync_error: SwitchSync | None + +_SwitchOSFields: TypeAlias = Literal["vendor", "version", "metal_core_version"] + +class SwitchOS(Message[_SwitchOSFields]): + """ + SwitchOS holds information about the NOS and versions running on the switch. + + ```proto + message metalstack.api.v2.SwitchOS + ``` + + Attributes: + vendor: + Vendor identifies what NOS distribution is running on the switch, e.g. SONiC. + + ```proto + metalstack.api.v2.SwitchOSVendor vendor = 1; + ``` + version: + Version specifies what NOS version is currently installed on the switch. + + ```proto + string version = 2; + ``` + metal_core_version: + MetalCoreVersion is the currently running version of the metal-core. + + ```proto + string metal_core_version = 3; + ``` + """ + + __slots__ = ("vendor", "version", "metal_core_version") + + if TYPE_CHECKING: + + def __init__( + self, + *, + vendor: SwitchOSVendor | None = None, + version: str = "", + metal_core_version: str = "", + ) -> None: + pass + + vendor: SwitchOSVendor + version: str + metal_core_version: str + +_SwitchNicFields: TypeAlias = Literal["name", "identifier", "mac", "vrf", "state", "bgp_filter", "bgp_port_state"] + +class SwitchNic(Message[_SwitchNicFields]): + """ + SwitchNic represents a front panel port and its configuration. + + ```proto + message metalstack.api.v2.SwitchNic + ``` + + Attributes: + name: + Name of the switch port + + ```proto + string name = 1; + ``` + identifier: + Identifier of the port + + ```proto + string identifier = 2; + ``` + mac: + MAC address of the port + + ```proto + string mac = 3; + ``` + vrf: + VRF name if the port is bound in one + + ```proto + optional string vrf = 4; + ``` + state: + NicState describes the current state of the switch port. + + ```proto + optional metalstack.api.v2.NicState state = 5; + ``` + bgp_filter: + BGPFilter optionally configured on a port. + + ```proto + optional metalstack.api.v2.BGPFilter bgp_filter = 6; + ``` + bgp_port_state: + BGPPortState represents the current BGP status of the port. + + ```proto + optional metalstack.api.v2.SwitchBGPPortState bgp_port_state = 7; + ``` + """ + + __slots__ = ("name", "identifier", "mac", "vrf", "state", "bgp_filter", "bgp_port_state") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + identifier: str = "", + mac: str = "", + vrf: str | None = None, + state: NicState | None = None, + bgp_filter: BGPFilter | None = None, + bgp_port_state: SwitchBGPPortState | None = None, + ) -> None: + pass + + name: str + identifier: str + mac: str + vrf: str + state: NicState | None + bgp_filter: BGPFilter | None + bgp_port_state: SwitchBGPPortState | None + +_BGPFilterFields: TypeAlias = Literal["cidrs", "vnis"] + +class BGPFilter(Message[_BGPFilterFields]): + """ + BGPFilter can be used to restrict BGP based on CIDRs and VNIs. + + ```proto + message metalstack.api.v2.BGPFilter + ``` + + Attributes: + cidrs: + CIDRs for which to allow BGP + + ```proto + repeated string cidrs = 1; + ``` + vnis: + VNIs for which to allow BGP + + ```proto + repeated string vnis = 2; + ``` + """ + + __slots__ = ("cidrs", "vnis") + + if TYPE_CHECKING: + + def __init__( + self, + *, + cidrs: list[str] | None = None, + vnis: list[str] | None = None, + ) -> None: + pass + + cidrs: list[str] + vnis: list[str] + +_SwitchBGPPortStateFields: TypeAlias = Literal["neighbor", "peer_group", "vrf_name", "bgp_state", "bgp_timer_up_established", "sent_prefix_counter", "accepted_prefix_counter"] + +class SwitchBGPPortState(Message[_SwitchBGPPortStateFields]): + """ + SwitchBGPPortState holds information about the BGP state of a port. + + ```proto + message metalstack.api.v2.SwitchBGPPortState + ``` + + Attributes: + neighbor: + Neighbor of this port. + + ```proto + string neighbor = 1; + ``` + peer_group: + PeerGroup of this port. + + ```proto + string peer_group = 2; + ``` + vrf_name: + VrfName of the VRF this port is bound to. + + ```proto + string vrf_name = 3; + ``` + bgp_state: + BgpState of the connection on this port. + + ```proto + metalstack.api.v2.BGPState bgp_state = 4; + ``` + bgp_timer_up_established: + BgpTimerUpEstablished reports when this port's BGP connection was established. + + ```proto + optional google.protobuf.Timestamp bgp_timer_up_established = 5; + ``` + sent_prefix_counter: + SentPrefixCounter counts the prefixes sent by the switch on this port. + + ```proto + uint64 sent_prefix_counter = 6; + ``` + accepted_prefix_counter: + AcceptedPrefixCounter counts the prefixes received on this port. + + ```proto + uint64 accepted_prefix_counter = 7; + ``` + """ + + __slots__ = ("neighbor", "peer_group", "vrf_name", "bgp_state", "bgp_timer_up_established", "sent_prefix_counter", "accepted_prefix_counter") + + if TYPE_CHECKING: + + def __init__( + self, + *, + neighbor: str = "", + peer_group: str = "", + vrf_name: str = "", + bgp_state: BGPState | None = None, + bgp_timer_up_established: Timestamp | None = None, + sent_prefix_counter: int = 0, + accepted_prefix_counter: int = 0, + ) -> None: + pass + + neighbor: str + peer_group: str + vrf_name: str + bgp_state: BGPState + bgp_timer_up_established: Timestamp | None + sent_prefix_counter: int + accepted_prefix_counter: int + +_NicStateFields: TypeAlias = Literal["desired", "actual"] + +class NicState(Message[_NicStateFields]): + """ + NicState represents the current state of a switch port. + + ```proto + message metalstack.api.v2.NicState + ``` + + Attributes: + desired: + Desired is the desired port state. + + ```proto + optional metalstack.api.v2.SwitchPortStatus desired = 1; + ``` + actual: + Actual is the actual port state. + + ```proto + metalstack.api.v2.SwitchPortStatus actual = 2; + ``` + """ + + __slots__ = ("desired", "actual") + + if TYPE_CHECKING: + + def __init__( + self, + *, + desired: SwitchPortStatus | None = None, + actual: SwitchPortStatus | None = None, + ) -> None: + pass + + desired: SwitchPortStatus + actual: SwitchPortStatus + +_MachineConnectionFields: TypeAlias = Literal["machine_id", "nic"] + +class MachineConnection(Message[_MachineConnectionFields]): + """ + MachineConnection associates a machine with the corresponding switch nic. + + ```proto + message metalstack.api.v2.MachineConnection + ``` + + Attributes: + machine_id: + MachineId of the machine connected to the nic. + + ```proto + string machine_id = 1; + ``` + nic: + Nic the machine is connected to. + + ```proto + optional metalstack.api.v2.SwitchNic nic = 2; + ``` + """ + + __slots__ = ("machine_id", "nic") + + if TYPE_CHECKING: + + def __init__( + self, + *, + machine_id: str = "", + nic: SwitchNic | None = None, + ) -> None: + pass + + machine_id: str + nic: SwitchNic | None + +_SwitchQueryFields: TypeAlias = Literal["id", "partition", "rack", "room", "os", "connected_machine_id"] + +class SwitchQuery(Message[_SwitchQueryFields]): + """ + SwitchQuery can be used to query a switch or a list of switches. + + ```proto + message metalstack.api.v2.SwitchQuery + ``` + + Attributes: + id: + Id of the switch to list. + + ```proto + optional string id = 1; + ``` + partition: + Partition of the switches to list. + + ```proto + optional string partition = 2; + ``` + rack: + Rack of the switches to list. + + ```proto + optional string rack = 3; + ``` + room: + Room ID if the switch resides in a room. + + ```proto + optional string room = 4; + ``` + os: + Switch OS specific queries. + + ```proto + optional metalstack.api.v2.SwitchOSQuery os = 5; + ``` + connected_machine_id: + ConnectedMachineID lists the switches which have the given machine id in the connected machines map. + + ```proto + optional string connected_machine_id = 6; + ``` + """ + + __slots__ = ("id", "partition", "rack", "room", "os", "connected_machine_id") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str | None = None, + partition: str | None = None, + rack: str | None = None, + room: str | None = None, + os: SwitchOSQuery | None = None, + connected_machine_id: str | None = None, + ) -> None: + pass + + id: str + partition: str + rack: str + room: str + os: SwitchOSQuery | None + connected_machine_id: str + +_SwitchOSQueryFields: TypeAlias = Literal["vendor", "version"] + +class SwitchOSQuery(Message[_SwitchOSQueryFields]): + """ + SwitchOSQuery holds OS specific query parameters. + + ```proto + message metalstack.api.v2.SwitchOSQuery + ``` + + Attributes: + vendor: + OsVendor of the switch OS by which to filter the switches. + + ```proto + optional metalstack.api.v2.SwitchOSVendor vendor = 1; + ``` + version: + OsVersion of the OS by which to filter the switches. + + ```proto + optional string version = 2; + ``` + """ + + __slots__ = ("vendor", "version") + + if TYPE_CHECKING: + + def __init__( + self, + *, + vendor: SwitchOSVendor | None = None, + version: str | None = None, + ) -> None: + pass + + vendor: SwitchOSVendor + version: str + +_SwitchSyncFields: TypeAlias = Literal["time", "duration", "error"] + +class SwitchSync(Message[_SwitchSyncFields]): + """ + SwitchSync summarizes information about a switch sync. + + ```proto + message metalstack.api.v2.SwitchSync + ``` + + Attributes: + time: + Time of the sync. + + ```proto + optional google.protobuf.Timestamp time = 1; + ``` + duration: + Duration of the sync. + + ```proto + optional google.protobuf.Duration duration = 2; + ``` + error: + Error if any occurred. + + ```proto + optional string error = 3; + ``` + """ + + __slots__ = ("time", "duration", "error") + + if TYPE_CHECKING: + + def __init__( + self, + *, + time: Timestamp | None = None, + duration: Duration | None = None, + error: str | None = None, + ) -> None: + pass + + time: Timestamp | None + duration: Duration | None + error: str + +_SwitchWithMachinesFields: TypeAlias = Literal["id", "partition", "rack", "connections"] + +class SwitchWithMachines(Message[_SwitchWithMachinesFields]): + """ + SwitchWithMachines contains a mapping from switch ports to connected machines. + + ```proto + message metalstack.api.v2.SwitchWithMachines + ``` + + Attributes: + id: + Id of the switch. + + ```proto + string id = 1; + ``` + partition: + Partition of the switch. + + ```proto + string partition = 2; + ``` + rack: + Rack of the switch. + + ```proto + string rack = 3; + ``` + connections: + Connections associates switch ports with the machines connected to them. + + ```proto + repeated metalstack.api.v2.SwitchNicWithMachine connections = 4; + ``` + """ + + __slots__ = ("id", "partition", "rack", "connections") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + partition: str = "", + rack: str = "", + connections: list[SwitchNicWithMachine] | None = None, + ) -> None: + pass + + id: str + partition: str + rack: str + connections: list[SwitchNicWithMachine] + +_SwitchNicWithMachineFields: TypeAlias = Literal["nic", "machine", "fru"] + +class SwitchNicWithMachine(Message[_SwitchNicWithMachineFields]): + """ + SwitchNicWithMachine associates a switch port with its connected machine. + + ```proto + message metalstack.api.v2.SwitchNicWithMachine + ``` + + Attributes: + nic: + Nic is the switch nic the machine is connected to. + + ```proto + optional metalstack.api.v2.SwitchNic nic = 1; + ``` + machine: + Machine connected to this nic. + + ```proto + optional metalstack.api.v2.Machine machine = 2; + ``` + fru: + FRU of the connected machine. + + ```proto + optional metalstack.api.v2.MachineFRU fru = 3; + ``` + """ + + __slots__ = ("nic", "machine", "fru") + + if TYPE_CHECKING: + + def __init__( + self, + *, + nic: SwitchNic | None = None, + machine: Machine | None = None, + fru: MachineFRU | None = None, + ) -> None: + pass + + nic: SwitchNic | None + machine: Machine | None + fru: MachineFRU | None + +class BGPState(Enum): + """ + BGPState represents the state of a BGP session. + + ```proto + enum metalstack.api.v2.BGPState + ``` + + Attributes: + UNSPECIFIED: + BGP_STATE_UNSPECIFIED is not specified. + + ```proto + BGP_STATE_UNSPECIFIED = 0 + ``` + IDLE: + BGP_STATE_IDLE is the Idle state of a BGP session. + + ```proto + BGP_STATE_IDLE = 1 + ``` + CONNECT: + BGP_STATE_CONNECT is the Connect state of a BGP session. + + ```proto + BGP_STATE_CONNECT = 2 + ``` + ACTIVE: + BGP_STATE_ACTIVE is the Active state of a BGP session. + + ```proto + BGP_STATE_ACTIVE = 3 + ``` + OPEN_SENT: + BGP_STATE_OPEN_SENT is the OpenSent state of a BGP session. + + ```proto + BGP_STATE_OPEN_SENT = 4 + ``` + OPEN_CONFIRM: + BGP_STATE_OPEN_CONFIRM is the OpenConfirm state of a BGP session. + + ```proto + BGP_STATE_OPEN_CONFIRM = 5 + ``` + ESTABLISHED: + BGP_STATE_ESTABLISHED is the Established state of a BGP session. + + ```proto + BGP_STATE_ESTABLISHED = 6 + ``` + """ + + UNSPECIFIED = 0 + IDLE = 1 + CONNECT = 2 + ACTIVE = 3 + OPEN_SENT = 4 + OPEN_CONFIRM = 5 + ESTABLISHED = 6 + +class SwitchReplaceMode(Enum): + """ + SwitchReplaceMode is used to mark a switch ready for replacement. + + ```proto + enum metalstack.api.v2.SwitchReplaceMode + ``` + + Attributes: + UNSPECIFIED: + SWITCH_REPLACE_MODE_UNSPECIFIED is not specified. + + ```proto + SWITCH_REPLACE_MODE_UNSPECIFIED = 0 + ``` + REPLACE: + SWITCH_REPLACE_MODE_REPLACE means this switch is waiting to be replaced. + + ```proto + SWITCH_REPLACE_MODE_REPLACE = 1 + ``` + OPERATIONAL: + SWITCH_REPLACE_MODE_OPERATIONAL means this switch is operational and cannot be replaced. + + ```proto + SWITCH_REPLACE_MODE_OPERATIONAL = 2 + ``` + """ + + UNSPECIFIED = 0 + REPLACE = 1 + OPERATIONAL = 2 + +class SwitchOSVendor(Enum): + """ + SwitchOSVendor represents a NOS distribution. + + ```proto + enum metalstack.api.v2.SwitchOSVendor + ``` + + Attributes: + UNSPECIFIED: + SWITCH_OS_VENDOR_UNSPECIFIED is not specified. + + ```proto + SWITCH_OS_VENDOR_UNSPECIFIED = 0 + ``` + CUMULUS: + SWITCH_OS_VENDOR_CUMULUS means this switch is running on Cumulus Linux. + + ```proto + SWITCH_OS_VENDOR_CUMULUS = 1 + ``` + SONIC: + SWITCH_OS_VENDOR_SONIC means this switch is running on SONiC NOS. + + ```proto + SWITCH_OS_VENDOR_SONIC = 2 + ``` + """ + + UNSPECIFIED = 0 + CUMULUS = 1 + SONIC = 2 + +class SwitchPortStatus(Enum): + """ + SwitchPortStatus specifies the state of a switch port. + + ```proto + enum metalstack.api.v2.SwitchPortStatus + ``` + + Attributes: + UNSPECIFIED: + SWITCH_PORT_STATUS_UNSPECIFIED is not specified. + + ```proto + SWITCH_PORT_STATUS_UNSPECIFIED = 0 + ``` + UP: + SWITCH_PORT_STATUS_UP means this port is up. + + ```proto + SWITCH_PORT_STATUS_UP = 1 + ``` + DOWN: + SWITCH_PORT_STATUS_DOWN means this port is down. + + ```proto + SWITCH_PORT_STATUS_DOWN = 2 + ``` + UNKNOWN: + SWITCH_PORT_STATUS_UNKNOWN means the status of this port is unknown. + + ```proto + SWITCH_PORT_STATUS_UNKNOWN = 3 + ``` + """ + + UNSPECIFIED = 0 + UP = 1 + DOWN = 2 + UNKNOWN = 3 + + +_DESC = file_desc( + b'\n\x1emetalstack/api/v2/switch.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xe2\x06\n\x06Switch\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0bdescription\x18\x03 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12$\n\x04rack\x18\x04 \x01(\tH\x00R\x04rackB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04room\x18\x05 \x01(\tH\x01R\x04roomB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12)\n\tpartition\x18\x06 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12Q\n\x0creplace_mode\x18\x07 \x01(\x0e2$.metalstack.api.v2.SwitchReplaceModeR\x0breplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12,\n\rmanagement_ip\x18\x08 \x01(\tR\x0cmanagementIpB\x07\xbaH\x04r\x02p\x01\x128\n\x0fmanagement_user\x18\t \x01(\tH\x02R\x0emanagementUserB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01\x88\x01\x01\x128\n\x0fconsole_command\x18\n \x01(\tH\x03R\x0econsoleCommandB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01\x88\x01\x01\x120\n\x04nics\x18\x0b \x03(\x0b2\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12+\n\x02os\x18\x0c \x01(\x0b2\x1b.metalstack.api.v2.SwitchOSR\x02os\x12U\n\x13machine_connections\x18\r \x03(\x0b2$.metalstack.api.v2.MachineConnectionR\x12machineConnections\x12:\n\tlast_sync\x18\x0e \x01(\x0b2\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12E\n\x0flast_sync_error\x18\x0f \x01(\x0b2\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncErrorB\x07\n\x05_rackB\x07\n\x05_roomB\x12\n\x10_management_userB\x12\n\x10_console_command"\xb1\x01\n\x08SwitchOS\x12C\n\x06vendor\x18\x01 \x01(\x0e2!.metalstack.api.v2.SwitchOSVendorR\x06vendorB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12%\n\x07version\x18\x02 \x01(\tR\x07versionB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x129\n\x12metal_core_version\x18\x03 \x01(\tR\x10metalCoreVersionB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01"\x9c\x03\n\tSwitchNic\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12+\n\nidentifier\x18\x02 \x01(\tR\nidentifierB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1d\n\x03mac\x18\x03 \x01(\tR\x03macB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x12"\n\x03vrf\x18\x04 \x01(\tH\x00R\x03vrfB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x05state\x18\x05 \x01(\x0b2\x1b.metalstack.api.v2.NicStateH\x01R\x05state\x88\x01\x01\x12@\n\nbgp_filter\x18\x06 \x01(\x0b2\x1c.metalstack.api.v2.BGPFilterH\x02R\tbgpFilter\x88\x01\x01\x12P\n\x0ebgp_port_state\x18\x07 \x01(\x0b2%.metalstack.api.v2.SwitchBGPPortStateH\x03R\x0cbgpPortState\x88\x01\x01B\x06\n\x04_vrfB\x08\n\x06_stateB\r\n\x0b_bgp_filterB\x11\n\x0f_bgp_port_state"T\n\tBGPFilter\x12"\n\x05cidrs\x18\x01 \x03(\tR\x05cidrsB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01\x12#\n\x04vnis\x18\x02 \x03(\tR\x04vnisB\x0f\xbaH\x0c\x92\x01\t"\x07r\x05\x10\x02\x18\x80\x01"\x92\x03\n\x12SwitchBGPPortState\x12\'\n\x08neighbor\x18\x01 \x01(\tR\x08neighborB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12*\n\npeer_group\x18\x02 \x01(\tR\tpeerGroupB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12&\n\x08vrf_name\x18\x03 \x01(\tR\x07vrfNameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12B\n\tbgp_state\x18\x04 \x01(\x0e2\x1b.metalstack.api.v2.BGPStateR\x08bgpStateB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12S\n\x18bgp_timer_up_established\x18\x05 \x01(\x0b2\x1a.google.protobuf.TimestampR\x15bgpTimerUpEstablished\x12.\n\x13sent_prefix_counter\x18\x06 \x01(\x04R\x11sentPrefixCounter\x126\n\x17accepted_prefix_counter\x18\x07 \x01(\x04R\x15acceptedPrefixCounter"\xab\x01\n\x08NicState\x12L\n\x07desired\x18\x01 \x01(\x0e2#.metalstack.api.v2.SwitchPortStatusH\x00R\x07desiredB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12E\n\x06actual\x18\x02 \x01(\x0e2#.metalstack.api.v2.SwitchPortStatusR\x06actualB\x08\xbaH\x05\x82\x01\x02\x10\x01B\n\n\x08_desired"b\n\x11MachineConnection\x12\x1d\n\nmachine_id\x18\x01 \x01(\tR\tmachineId\x12.\n\x03nic\x18\x02 \x01(\x0b2\x1c.metalstack.api.v2.SwitchNicR\x03nic"\xec\x02\n\x0bSwitchQuery\x12"\n\x02id\x18\x01 \x01(\tH\x00R\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x88\x01\x01\x12.\n\tpartition\x18\x02 \x01(\tH\x01R\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04rack\x18\x03 \x01(\tH\x02R\x04rackB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04room\x18\x04 \x01(\tH\x03R\x04roomB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x125\n\x02os\x18\x05 \x01(\x0b2 .metalstack.api.v2.SwitchOSQueryH\x04R\x02os\x88\x01\x01\x12?\n\x14connected_machine_id\x18\x06 \x01(\tH\x05R\x12connectedMachineIdB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01B\x05\n\x03_idB\x0c\n\n_partitionB\x07\n\x05_rackB\x07\n\x05_roomB\x05\n\x03_osB\x17\n\x15_connected_machine_id"\x9c\x01\n\rSwitchOSQuery\x12H\n\x06vendor\x18\x01 \x01(\x0e2!.metalstack.api.v2.SwitchOSVendorH\x00R\x06vendorB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12*\n\x07version\x18\x02 \x01(\tH\x01R\x07versionB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01B\t\n\x07_vendorB\n\n\x08_version"\x98\x01\n\nSwitchSync\x12.\n\x04time\x18\x01 \x01(\x0b2\x1a.google.protobuf.TimestampR\x04time\x125\n\x08duration\x18\x02 \x01(\x0b2\x19.google.protobuf.DurationR\x08duration\x12\x19\n\x05error\x18\x03 \x01(\tH\x00R\x05error\x88\x01\x01B\x08\n\x06_error"\xa1\x01\n\x12SwitchWithMachines\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n\tpartition\x18\x02 \x01(\tR\tpartition\x12\x12\n\x04rack\x18\x03 \x01(\tR\x04rack\x12I\n\x0bconnections\x18\x04 \x03(\x0b2\'.metalstack.api.v2.SwitchNicWithMachineR\x0bconnections"\xad\x01\n\x14SwitchNicWithMachine\x12.\n\x03nic\x18\x01 \x01(\x0b2\x1c.metalstack.api.v2.SwitchNicR\x03nic\x124\n\x07machine\x18\x02 \x01(\x0b2\x1a.metalstack.api.v2.MachineR\x07machine\x12/\n\x03fru\x18\x03 \x01(\x0b2\x1d.metalstack.api.v2.MachineFRUR\x03fru*\x89\x02\n\x08BGPState\x12\x19\n\x15BGP_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x0eBGP_STATE_IDLE\x10\x01\x1a\x08\x82\xb2\x19\x04Idle\x12"\n\x11BGP_STATE_CONNECT\x10\x02\x1a\x0b\x82\xb2\x19\x07Connect\x12 \n\x10BGP_STATE_ACTIVE\x10\x03\x1a\n\x82\xb2\x19\x06Active\x12%\n\x13BGP_STATE_OPEN_SENT\x10\x04\x1a\x0c\x82\xb2\x19\x08OpenSent\x12+\n\x16BGP_STATE_OPEN_CONFIRM\x10\x05\x1a\x0f\x82\xb2\x19\x0bOpenConfirm\x12*\n\x15BGP_STATE_ESTABLISHED\x10\x06\x1a\x0f\x82\xb2\x19\x0bEstablished*\xa2\x01\n\x11SwitchReplaceMode\x12)\n\x1fSWITCH_REPLACE_MODE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12,\n\x1bSWITCH_REPLACE_MODE_REPLACE\x10\x01\x1a\x0b\x82\xb2\x19\x07replace\x124\n\x1fSWITCH_REPLACE_MODE_OPERATIONAL\x10\x02\x1a\x0f\x82\xb2\x19\x0boperational*\x84\x01\n\x0eSwitchOSVendor\x12 \n\x1cSWITCH_OS_VENDOR_UNSPECIFIED\x10\x00\x12)\n\x18SWITCH_OS_VENDOR_CUMULUS\x10\x01\x1a\x0b\x82\xb2\x19\x07Cumulus\x12%\n\x16SWITCH_OS_VENDOR_SONIC\x10\x02\x1a\t\x82\xb2\x19\x05SONiC*\xad\x01\n\x10SwitchPortStatus\x12"\n\x1eSWITCH_PORT_STATUS_UNSPECIFIED\x10\x00\x12!\n\x15SWITCH_PORT_STATUS_UP\x10\x01\x1a\x06\x82\xb2\x19\x02up\x12%\n\x17SWITCH_PORT_STATUS_DOWN\x10\x02\x1a\x08\x82\xb2\x19\x04down\x12+\n\x1aSWITCH_PORT_STATUS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknownB\xc1\x01\n\x15com.metalstack.api.v2B\x0bSwitchProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + machine_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Switch": Switch, + "SwitchOS": SwitchOS, + "SwitchNic": SwitchNic, + "BGPFilter": BGPFilter, + "SwitchBGPPortState": SwitchBGPPortState, + "NicState": NicState, + "MachineConnection": MachineConnection, + "SwitchQuery": SwitchQuery, + "SwitchOSQuery": SwitchOSQuery, + "SwitchSync": SwitchSync, + "SwitchWithMachines": SwitchWithMachines, + "SwitchNicWithMachine": SwitchNicWithMachine, + "BGPState": BGPState, + "SwitchReplaceMode": SwitchReplaceMode, + "SwitchOSVendor": SwitchOSVendor, + "SwitchPortStatus": SwitchPortStatus, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/switch.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/switch_pb2.py b/python/metalstack/api/v2/switch_pb2.py deleted file mode 100644 index e8acbd5d..00000000 --- a/python/metalstack/api/v2/switch_pb2.py +++ /dev/null @@ -1,163 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/switch.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/switch.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/switch.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xe2\x06\n\x06Switch\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12$\n\x04rack\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04rack\x88\x01\x01\x12$\n\x04room\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04room\x88\x01\x01\x12)\n\tpartition\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\x12Q\n\x0creplace_mode\x18\x07 \x01(\x0e\x32$.metalstack.api.v2.SwitchReplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0breplaceMode\x12,\n\rmanagement_ip\x18\x08 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x0cmanagementIp\x12\x38\n\x0fmanagement_user\x18\t \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x02R\x0emanagementUser\x88\x01\x01\x12\x38\n\x0f\x63onsole_command\x18\n \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x03R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\x0b \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12+\n\x02os\x18\x0c \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSR\x02os\x12U\n\x13machine_connections\x18\r \x03(\x0b\x32$.metalstack.api.v2.MachineConnectionR\x12machineConnections\x12:\n\tlast_sync\x18\x0e \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12\x45\n\x0flast_sync_error\x18\x0f \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncErrorB\x07\n\x05_rackB\x07\n\x05_roomB\x12\n\x10_management_userB\x12\n\x10_console_command\"\xb1\x01\n\x08SwitchOS\x12\x43\n\x06vendor\x18\x01 \x01(\x0e\x32!.metalstack.api.v2.SwitchOSVendorB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06vendor\x12%\n\x07version\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07version\x12\x39\n\x12metal_core_version\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x10metalCoreVersion\"\x9c\x03\n\tSwitchNic\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12+\n\nidentifier\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\nidentifier\x12\x1d\n\x03mac\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12\"\n\x03vrf\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x03vrf\x88\x01\x01\x12\x36\n\x05state\x18\x05 \x01(\x0b\x32\x1b.metalstack.api.v2.NicStateH\x01R\x05state\x88\x01\x01\x12@\n\nbgp_filter\x18\x06 \x01(\x0b\x32\x1c.metalstack.api.v2.BGPFilterH\x02R\tbgpFilter\x88\x01\x01\x12P\n\x0e\x62gp_port_state\x18\x07 \x01(\x0b\x32%.metalstack.api.v2.SwitchBGPPortStateH\x03R\x0c\x62gpPortState\x88\x01\x01\x42\x06\n\x04_vrfB\x08\n\x06_stateB\r\n\x0b_bgp_filterB\x11\n\x0f_bgp_port_state\"T\n\tBGPFilter\x12\"\n\x05\x63idrs\x18\x01 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x05\x63idrs\x12#\n\x04vnis\x18\x02 \x03(\tB\x0f\xbaH\x0c\x92\x01\t\"\x07r\x05\x10\x02\x18\x80\x01R\x04vnis\"\x92\x03\n\x12SwitchBGPPortState\x12\'\n\x08neighbor\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x08neighbor\x12*\n\npeer_group\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\tpeerGroup\x12&\n\x08vrf_name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07vrfName\x12\x42\n\tbgp_state\x18\x04 \x01(\x0e\x32\x1b.metalstack.api.v2.BGPStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x08\x62gpState\x12S\n\x18\x62gp_timer_up_established\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x15\x62gpTimerUpEstablished\x12.\n\x13sent_prefix_counter\x18\x06 \x01(\x04R\x11sentPrefixCounter\x12\x36\n\x17\x61\x63\x63\x65pted_prefix_counter\x18\x07 \x01(\x04R\x15\x61\x63\x63\x65ptedPrefixCounter\"\xab\x01\n\x08NicState\x12L\n\x07\x64\x65sired\x18\x01 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x07\x64\x65sired\x88\x01\x01\x12\x45\n\x06\x61\x63tual\x18\x02 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06\x61\x63tualB\n\n\x08_desired\"b\n\x11MachineConnection\x12\x1d\n\nmachine_id\x18\x01 \x01(\tR\tmachineId\x12.\n\x03nic\x18\x02 \x01(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x03nic\"\xec\x02\n\x0bSwitchQuery\x12\"\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x01R\tpartition\x88\x01\x01\x12$\n\x04rack\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x02R\x04rack\x88\x01\x01\x12$\n\x04room\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x04room\x88\x01\x01\x12\x35\n\x02os\x18\x05 \x01(\x0b\x32 .metalstack.api.v2.SwitchOSQueryH\x04R\x02os\x88\x01\x01\x12?\n\x14\x63onnected_machine_id\x18\x06 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x05R\x12\x63onnectedMachineId\x88\x01\x01\x42\x05\n\x03_idB\x0c\n\n_partitionB\x07\n\x05_rackB\x07\n\x05_roomB\x05\n\x03_osB\x17\n\x15_connected_machine_id\"\x9c\x01\n\rSwitchOSQuery\x12H\n\x06vendor\x18\x01 \x01(\x0e\x32!.metalstack.api.v2.SwitchOSVendorB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x06vendor\x88\x01\x01\x12*\n\x07version\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x07version\x88\x01\x01\x42\t\n\x07_vendorB\n\n\x08_version\"\x98\x01\n\nSwitchSync\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x35\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08\x64uration\x12\x19\n\x05\x65rror\x18\x03 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_error\"\xa1\x01\n\x12SwitchWithMachines\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n\tpartition\x18\x02 \x01(\tR\tpartition\x12\x12\n\x04rack\x18\x03 \x01(\tR\x04rack\x12I\n\x0b\x63onnections\x18\x04 \x03(\x0b\x32\'.metalstack.api.v2.SwitchNicWithMachineR\x0b\x63onnections\"\xad\x01\n\x14SwitchNicWithMachine\x12.\n\x03nic\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x03nic\x12\x34\n\x07machine\x18\x02 \x01(\x0b\x32\x1a.metalstack.api.v2.MachineR\x07machine\x12/\n\x03\x66ru\x18\x03 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineFRUR\x03\x66ru*\x89\x02\n\x08\x42GPState\x12\x19\n\x15\x42GP_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x0e\x42GP_STATE_IDLE\x10\x01\x1a\x08\x82\xb2\x19\x04Idle\x12\"\n\x11\x42GP_STATE_CONNECT\x10\x02\x1a\x0b\x82\xb2\x19\x07\x43onnect\x12 \n\x10\x42GP_STATE_ACTIVE\x10\x03\x1a\n\x82\xb2\x19\x06\x41\x63tive\x12%\n\x13\x42GP_STATE_OPEN_SENT\x10\x04\x1a\x0c\x82\xb2\x19\x08OpenSent\x12+\n\x16\x42GP_STATE_OPEN_CONFIRM\x10\x05\x1a\x0f\x82\xb2\x19\x0bOpenConfirm\x12*\n\x15\x42GP_STATE_ESTABLISHED\x10\x06\x1a\x0f\x82\xb2\x19\x0b\x45stablished*\xa2\x01\n\x11SwitchReplaceMode\x12)\n\x1fSWITCH_REPLACE_MODE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\x00\x12,\n\x1bSWITCH_REPLACE_MODE_REPLACE\x10\x01\x1a\x0b\x82\xb2\x19\x07replace\x12\x34\n\x1fSWITCH_REPLACE_MODE_OPERATIONAL\x10\x02\x1a\x0f\x82\xb2\x19\x0boperational*\x84\x01\n\x0eSwitchOSVendor\x12 \n\x1cSWITCH_OS_VENDOR_UNSPECIFIED\x10\x00\x12)\n\x18SWITCH_OS_VENDOR_CUMULUS\x10\x01\x1a\x0b\x82\xb2\x19\x07\x43umulus\x12%\n\x16SWITCH_OS_VENDOR_SONIC\x10\x02\x1a\t\x82\xb2\x19\x05SONiC*\xad\x01\n\x10SwitchPortStatus\x12\"\n\x1eSWITCH_PORT_STATUS_UNSPECIFIED\x10\x00\x12!\n\x15SWITCH_PORT_STATUS_UP\x10\x01\x1a\x06\x82\xb2\x19\x02up\x12%\n\x17SWITCH_PORT_STATUS_DOWN\x10\x02\x1a\x08\x82\xb2\x19\x04\x64own\x12+\n\x1aSWITCH_PORT_STATUS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknownB\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0bSwitchProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.switch_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013SwitchProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_IDLE"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_IDLE"]._serialized_options = b'\202\262\031\004Idle' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_CONNECT"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_CONNECT"]._serialized_options = b'\202\262\031\007Connect' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_ACTIVE"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_ACTIVE"]._serialized_options = b'\202\262\031\006Active' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_SENT"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_SENT"]._serialized_options = b'\202\262\031\010OpenSent' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_CONFIRM"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_CONFIRM"]._serialized_options = b'\202\262\031\013OpenConfirm' - _globals['_BGPSTATE'].values_by_name["BGP_STATE_ESTABLISHED"]._loaded_options = None - _globals['_BGPSTATE'].values_by_name["BGP_STATE_ESTABLISHED"]._serialized_options = b'\202\262\031\013Established' - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_UNSPECIFIED"]._loaded_options = None - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_UNSPECIFIED"]._serialized_options = b'\202\262\031\000' - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_REPLACE"]._loaded_options = None - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_REPLACE"]._serialized_options = b'\202\262\031\007replace' - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_OPERATIONAL"]._loaded_options = None - _globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_OPERATIONAL"]._serialized_options = b'\202\262\031\013operational' - _globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_CUMULUS"]._loaded_options = None - _globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_CUMULUS"]._serialized_options = b'\202\262\031\007Cumulus' - _globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_SONIC"]._loaded_options = None - _globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_SONIC"]._serialized_options = b'\202\262\031\005SONiC' - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UP"]._loaded_options = None - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UP"]._serialized_options = b'\202\262\031\002up' - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_DOWN"]._loaded_options = None - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_DOWN"]._serialized_options = b'\202\262\031\004down' - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UNKNOWN"]._loaded_options = None - _globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UNKNOWN"]._serialized_options = b'\202\262\031\007unknown' - _globals['_SWITCH'].fields_by_name['id']._loaded_options = None - _globals['_SWITCH'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCH'].fields_by_name['description']._loaded_options = None - _globals['_SWITCH'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_SWITCH'].fields_by_name['rack']._loaded_options = None - _globals['_SWITCH'].fields_by_name['rack']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCH'].fields_by_name['room']._loaded_options = None - _globals['_SWITCH'].fields_by_name['room']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCH'].fields_by_name['partition']._loaded_options = None - _globals['_SWITCH'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_SWITCH'].fields_by_name['replace_mode']._loaded_options = None - _globals['_SWITCH'].fields_by_name['replace_mode']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCH'].fields_by_name['management_ip']._loaded_options = None - _globals['_SWITCH'].fields_by_name['management_ip']._serialized_options = b'\272H\004r\002p\001' - _globals['_SWITCH'].fields_by_name['management_user']._loaded_options = None - _globals['_SWITCH'].fields_by_name['management_user']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_SWITCH'].fields_by_name['console_command']._loaded_options = None - _globals['_SWITCH'].fields_by_name['console_command']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_SWITCHOS'].fields_by_name['vendor']._loaded_options = None - _globals['_SWITCHOS'].fields_by_name['vendor']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCHOS'].fields_by_name['version']._loaded_options = None - _globals['_SWITCHOS'].fields_by_name['version']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHOS'].fields_by_name['metal_core_version']._loaded_options = None - _globals['_SWITCHOS'].fields_by_name['metal_core_version']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHNIC'].fields_by_name['name']._loaded_options = None - _globals['_SWITCHNIC'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHNIC'].fields_by_name['identifier']._loaded_options = None - _globals['_SWITCHNIC'].fields_by_name['identifier']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHNIC'].fields_by_name['mac']._loaded_options = None - _globals['_SWITCHNIC'].fields_by_name['mac']._serialized_options = b'\272H\010r\006\270\263\256\261\002\001' - _globals['_SWITCHNIC'].fields_by_name['vrf']._loaded_options = None - _globals['_SWITCHNIC'].fields_by_name['vrf']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_BGPFILTER'].fields_by_name['cidrs']._loaded_options = None - _globals['_BGPFILTER'].fields_by_name['cidrs']._serialized_options = b'\272H\t\222\001\006\270\244\263\261\002\001' - _globals['_BGPFILTER'].fields_by_name['vnis']._loaded_options = None - _globals['_BGPFILTER'].fields_by_name['vnis']._serialized_options = b'\272H\014\222\001\t\"\007r\005\020\002\030\200\001' - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['neighbor']._loaded_options = None - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['neighbor']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['peer_group']._loaded_options = None - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['peer_group']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['vrf_name']._loaded_options = None - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['vrf_name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['bgp_state']._loaded_options = None - _globals['_SWITCHBGPPORTSTATE'].fields_by_name['bgp_state']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NICSTATE'].fields_by_name['desired']._loaded_options = None - _globals['_NICSTATE'].fields_by_name['desired']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_NICSTATE'].fields_by_name['actual']._loaded_options = None - _globals['_NICSTATE'].fields_by_name['actual']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCHQUERY'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHQUERY'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHQUERY'].fields_by_name['partition']._loaded_options = None - _globals['_SWITCHQUERY'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_SWITCHQUERY'].fields_by_name['rack']._loaded_options = None - _globals['_SWITCHQUERY'].fields_by_name['rack']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHQUERY'].fields_by_name['room']._loaded_options = None - _globals['_SWITCHQUERY'].fields_by_name['room']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_SWITCHQUERY'].fields_by_name['connected_machine_id']._loaded_options = None - _globals['_SWITCHQUERY'].fields_by_name['connected_machine_id']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_SWITCHOSQUERY'].fields_by_name['vendor']._loaded_options = None - _globals['_SWITCHOSQUERY'].fields_by_name['vendor']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_SWITCHOSQUERY'].fields_by_name['version']._loaded_options = None - _globals['_SWITCHOSQUERY'].fields_by_name['version']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_BGPSTATE']._serialized_start=3505 - _globals['_BGPSTATE']._serialized_end=3770 - _globals['_SWITCHREPLACEMODE']._serialized_start=3773 - _globals['_SWITCHREPLACEMODE']._serialized_end=3935 - _globals['_SWITCHOSVENDOR']._serialized_start=3938 - _globals['_SWITCHOSVENDOR']._serialized_end=4070 - _globals['_SWITCHPORTSTATUS']._serialized_start=4073 - _globals['_SWITCHPORTSTATUS']._serialized_end=4246 - _globals['_SWITCH']._serialized_start=255 - _globals['_SWITCH']._serialized_end=1121 - _globals['_SWITCHOS']._serialized_start=1124 - _globals['_SWITCHOS']._serialized_end=1301 - _globals['_SWITCHNIC']._serialized_start=1304 - _globals['_SWITCHNIC']._serialized_end=1716 - _globals['_BGPFILTER']._serialized_start=1718 - _globals['_BGPFILTER']._serialized_end=1802 - _globals['_SWITCHBGPPORTSTATE']._serialized_start=1805 - _globals['_SWITCHBGPPORTSTATE']._serialized_end=2207 - _globals['_NICSTATE']._serialized_start=2210 - _globals['_NICSTATE']._serialized_end=2381 - _globals['_MACHINECONNECTION']._serialized_start=2383 - _globals['_MACHINECONNECTION']._serialized_end=2481 - _globals['_SWITCHQUERY']._serialized_start=2484 - _globals['_SWITCHQUERY']._serialized_end=2848 - _globals['_SWITCHOSQUERY']._serialized_start=2851 - _globals['_SWITCHOSQUERY']._serialized_end=3007 - _globals['_SWITCHSYNC']._serialized_start=3010 - _globals['_SWITCHSYNC']._serialized_end=3162 - _globals['_SWITCHWITHMACHINES']._serialized_start=3165 - _globals['_SWITCHWITHMACHINES']._serialized_end=3326 - _globals['_SWITCHNICWITHMACHINE']._serialized_start=3329 - _globals['_SWITCHNICWITHMACHINE']._serialized_end=3502 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/switch_pb2.pyi b/python/metalstack/api/v2/switch_pb2.pyi deleted file mode 100644 index 01b86fcb..00000000 --- a/python/metalstack/api/v2/switch_pb2.pyi +++ /dev/null @@ -1,222 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class BGPState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - BGP_STATE_UNSPECIFIED: _ClassVar[BGPState] - BGP_STATE_IDLE: _ClassVar[BGPState] - BGP_STATE_CONNECT: _ClassVar[BGPState] - BGP_STATE_ACTIVE: _ClassVar[BGPState] - BGP_STATE_OPEN_SENT: _ClassVar[BGPState] - BGP_STATE_OPEN_CONFIRM: _ClassVar[BGPState] - BGP_STATE_ESTABLISHED: _ClassVar[BGPState] - -class SwitchReplaceMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SWITCH_REPLACE_MODE_UNSPECIFIED: _ClassVar[SwitchReplaceMode] - SWITCH_REPLACE_MODE_REPLACE: _ClassVar[SwitchReplaceMode] - SWITCH_REPLACE_MODE_OPERATIONAL: _ClassVar[SwitchReplaceMode] - -class SwitchOSVendor(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SWITCH_OS_VENDOR_UNSPECIFIED: _ClassVar[SwitchOSVendor] - SWITCH_OS_VENDOR_CUMULUS: _ClassVar[SwitchOSVendor] - SWITCH_OS_VENDOR_SONIC: _ClassVar[SwitchOSVendor] - -class SwitchPortStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - SWITCH_PORT_STATUS_UNSPECIFIED: _ClassVar[SwitchPortStatus] - SWITCH_PORT_STATUS_UP: _ClassVar[SwitchPortStatus] - SWITCH_PORT_STATUS_DOWN: _ClassVar[SwitchPortStatus] - SWITCH_PORT_STATUS_UNKNOWN: _ClassVar[SwitchPortStatus] -BGP_STATE_UNSPECIFIED: BGPState -BGP_STATE_IDLE: BGPState -BGP_STATE_CONNECT: BGPState -BGP_STATE_ACTIVE: BGPState -BGP_STATE_OPEN_SENT: BGPState -BGP_STATE_OPEN_CONFIRM: BGPState -BGP_STATE_ESTABLISHED: BGPState -SWITCH_REPLACE_MODE_UNSPECIFIED: SwitchReplaceMode -SWITCH_REPLACE_MODE_REPLACE: SwitchReplaceMode -SWITCH_REPLACE_MODE_OPERATIONAL: SwitchReplaceMode -SWITCH_OS_VENDOR_UNSPECIFIED: SwitchOSVendor -SWITCH_OS_VENDOR_CUMULUS: SwitchOSVendor -SWITCH_OS_VENDOR_SONIC: SwitchOSVendor -SWITCH_PORT_STATUS_UNSPECIFIED: SwitchPortStatus -SWITCH_PORT_STATUS_UP: SwitchPortStatus -SWITCH_PORT_STATUS_DOWN: SwitchPortStatus -SWITCH_PORT_STATUS_UNKNOWN: SwitchPortStatus - -class Switch(_message.Message): - __slots__ = ("id", "meta", "description", "rack", "room", "partition", "replace_mode", "management_ip", "management_user", "console_command", "nics", "os", "machine_connections", "last_sync", "last_sync_error") - ID_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - RACK_FIELD_NUMBER: _ClassVar[int] - ROOM_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - REPLACE_MODE_FIELD_NUMBER: _ClassVar[int] - MANAGEMENT_IP_FIELD_NUMBER: _ClassVar[int] - MANAGEMENT_USER_FIELD_NUMBER: _ClassVar[int] - CONSOLE_COMMAND_FIELD_NUMBER: _ClassVar[int] - NICS_FIELD_NUMBER: _ClassVar[int] - OS_FIELD_NUMBER: _ClassVar[int] - MACHINE_CONNECTIONS_FIELD_NUMBER: _ClassVar[int] - LAST_SYNC_FIELD_NUMBER: _ClassVar[int] - LAST_SYNC_ERROR_FIELD_NUMBER: _ClassVar[int] - id: str - meta: _common_pb2.Meta - description: str - rack: str - room: str - partition: str - replace_mode: SwitchReplaceMode - management_ip: str - management_user: str - console_command: str - nics: _containers.RepeatedCompositeFieldContainer[SwitchNic] - os: SwitchOS - machine_connections: _containers.RepeatedCompositeFieldContainer[MachineConnection] - last_sync: SwitchSync - last_sync_error: SwitchSync - def __init__(self, id: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., description: _Optional[str] = ..., rack: _Optional[str] = ..., room: _Optional[str] = ..., partition: _Optional[str] = ..., replace_mode: _Optional[_Union[SwitchReplaceMode, str]] = ..., management_ip: _Optional[str] = ..., management_user: _Optional[str] = ..., console_command: _Optional[str] = ..., nics: _Optional[_Iterable[_Union[SwitchNic, _Mapping]]] = ..., os: _Optional[_Union[SwitchOS, _Mapping]] = ..., machine_connections: _Optional[_Iterable[_Union[MachineConnection, _Mapping]]] = ..., last_sync: _Optional[_Union[SwitchSync, _Mapping]] = ..., last_sync_error: _Optional[_Union[SwitchSync, _Mapping]] = ...) -> None: ... - -class SwitchOS(_message.Message): - __slots__ = ("vendor", "version", "metal_core_version") - VENDOR_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - METAL_CORE_VERSION_FIELD_NUMBER: _ClassVar[int] - vendor: SwitchOSVendor - version: str - metal_core_version: str - def __init__(self, vendor: _Optional[_Union[SwitchOSVendor, str]] = ..., version: _Optional[str] = ..., metal_core_version: _Optional[str] = ...) -> None: ... - -class SwitchNic(_message.Message): - __slots__ = ("name", "identifier", "mac", "vrf", "state", "bgp_filter", "bgp_port_state") - NAME_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - MAC_FIELD_NUMBER: _ClassVar[int] - VRF_FIELD_NUMBER: _ClassVar[int] - STATE_FIELD_NUMBER: _ClassVar[int] - BGP_FILTER_FIELD_NUMBER: _ClassVar[int] - BGP_PORT_STATE_FIELD_NUMBER: _ClassVar[int] - name: str - identifier: str - mac: str - vrf: str - state: NicState - bgp_filter: BGPFilter - bgp_port_state: SwitchBGPPortState - def __init__(self, name: _Optional[str] = ..., identifier: _Optional[str] = ..., mac: _Optional[str] = ..., vrf: _Optional[str] = ..., state: _Optional[_Union[NicState, _Mapping]] = ..., bgp_filter: _Optional[_Union[BGPFilter, _Mapping]] = ..., bgp_port_state: _Optional[_Union[SwitchBGPPortState, _Mapping]] = ...) -> None: ... - -class BGPFilter(_message.Message): - __slots__ = ("cidrs", "vnis") - CIDRS_FIELD_NUMBER: _ClassVar[int] - VNIS_FIELD_NUMBER: _ClassVar[int] - cidrs: _containers.RepeatedScalarFieldContainer[str] - vnis: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, cidrs: _Optional[_Iterable[str]] = ..., vnis: _Optional[_Iterable[str]] = ...) -> None: ... - -class SwitchBGPPortState(_message.Message): - __slots__ = ("neighbor", "peer_group", "vrf_name", "bgp_state", "bgp_timer_up_established", "sent_prefix_counter", "accepted_prefix_counter") - NEIGHBOR_FIELD_NUMBER: _ClassVar[int] - PEER_GROUP_FIELD_NUMBER: _ClassVar[int] - VRF_NAME_FIELD_NUMBER: _ClassVar[int] - BGP_STATE_FIELD_NUMBER: _ClassVar[int] - BGP_TIMER_UP_ESTABLISHED_FIELD_NUMBER: _ClassVar[int] - SENT_PREFIX_COUNTER_FIELD_NUMBER: _ClassVar[int] - ACCEPTED_PREFIX_COUNTER_FIELD_NUMBER: _ClassVar[int] - neighbor: str - peer_group: str - vrf_name: str - bgp_state: BGPState - bgp_timer_up_established: _timestamp_pb2.Timestamp - sent_prefix_counter: int - accepted_prefix_counter: int - def __init__(self, neighbor: _Optional[str] = ..., peer_group: _Optional[str] = ..., vrf_name: _Optional[str] = ..., bgp_state: _Optional[_Union[BGPState, str]] = ..., bgp_timer_up_established: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., sent_prefix_counter: _Optional[int] = ..., accepted_prefix_counter: _Optional[int] = ...) -> None: ... - -class NicState(_message.Message): - __slots__ = ("desired", "actual") - DESIRED_FIELD_NUMBER: _ClassVar[int] - ACTUAL_FIELD_NUMBER: _ClassVar[int] - desired: SwitchPortStatus - actual: SwitchPortStatus - def __init__(self, desired: _Optional[_Union[SwitchPortStatus, str]] = ..., actual: _Optional[_Union[SwitchPortStatus, str]] = ...) -> None: ... - -class MachineConnection(_message.Message): - __slots__ = ("machine_id", "nic") - MACHINE_ID_FIELD_NUMBER: _ClassVar[int] - NIC_FIELD_NUMBER: _ClassVar[int] - machine_id: str - nic: SwitchNic - def __init__(self, machine_id: _Optional[str] = ..., nic: _Optional[_Union[SwitchNic, _Mapping]] = ...) -> None: ... - -class SwitchQuery(_message.Message): - __slots__ = ("id", "partition", "rack", "room", "os", "connected_machine_id") - ID_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - RACK_FIELD_NUMBER: _ClassVar[int] - ROOM_FIELD_NUMBER: _ClassVar[int] - OS_FIELD_NUMBER: _ClassVar[int] - CONNECTED_MACHINE_ID_FIELD_NUMBER: _ClassVar[int] - id: str - partition: str - rack: str - room: str - os: SwitchOSQuery - connected_machine_id: str - def __init__(self, id: _Optional[str] = ..., partition: _Optional[str] = ..., rack: _Optional[str] = ..., room: _Optional[str] = ..., os: _Optional[_Union[SwitchOSQuery, _Mapping]] = ..., connected_machine_id: _Optional[str] = ...) -> None: ... - -class SwitchOSQuery(_message.Message): - __slots__ = ("vendor", "version") - VENDOR_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - vendor: SwitchOSVendor - version: str - def __init__(self, vendor: _Optional[_Union[SwitchOSVendor, str]] = ..., version: _Optional[str] = ...) -> None: ... - -class SwitchSync(_message.Message): - __slots__ = ("time", "duration", "error") - TIME_FIELD_NUMBER: _ClassVar[int] - DURATION_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - time: _timestamp_pb2.Timestamp - duration: _duration_pb2.Duration - error: str - def __init__(self, time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., duration: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., error: _Optional[str] = ...) -> None: ... - -class SwitchWithMachines(_message.Message): - __slots__ = ("id", "partition", "rack", "connections") - ID_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - RACK_FIELD_NUMBER: _ClassVar[int] - CONNECTIONS_FIELD_NUMBER: _ClassVar[int] - id: str - partition: str - rack: str - connections: _containers.RepeatedCompositeFieldContainer[SwitchNicWithMachine] - def __init__(self, id: _Optional[str] = ..., partition: _Optional[str] = ..., rack: _Optional[str] = ..., connections: _Optional[_Iterable[_Union[SwitchNicWithMachine, _Mapping]]] = ...) -> None: ... - -class SwitchNicWithMachine(_message.Message): - __slots__ = ("nic", "machine", "fru") - NIC_FIELD_NUMBER: _ClassVar[int] - MACHINE_FIELD_NUMBER: _ClassVar[int] - FRU_FIELD_NUMBER: _ClassVar[int] - nic: SwitchNic - machine: _machine_pb2.Machine - fru: _machine_pb2.MachineFRU - def __init__(self, nic: _Optional[_Union[SwitchNic, _Mapping]] = ..., machine: _Optional[_Union[_machine_pb2.Machine, _Mapping]] = ..., fru: _Optional[_Union[_machine_pb2.MachineFRU, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/tenant_connect.py b/python/metalstack/api/v2/tenant_connect.py index 128d03a3..5e7b0c79 100644 --- a/python/metalstack/api/v2/tenant_connect.py +++ b/python/metalstack/api/v2/tenant_connect.py @@ -1,68 +1,84 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/tenant.proto +# Generated from metalstack/api/v2/tenant.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.tenant_pb2 as metalstack_dot_api_dot_v2_dot_tenant__pb2 + +from .tenant_pb import TenantServiceAddMemberRequest, TenantServiceAddMemberResponse, TenantServiceCreateRequest, TenantServiceCreateResponse, TenantServiceDeleteRequest, TenantServiceDeleteResponse, TenantServiceGetRequest, TenantServiceGetResponse, TenantServiceInviteAcceptRequest, TenantServiceInviteAcceptResponse, TenantServiceInviteDeleteRequest, TenantServiceInviteDeleteResponse, TenantServiceInviteGetRequest, TenantServiceInviteGetResponse, TenantServiceInviteRequest, TenantServiceInviteResponse, TenantServiceInvitesListRequest, TenantServiceInvitesListResponse, TenantServiceLeaveRequest, TenantServiceLeaveResponse, TenantServiceListRequest, TenantServiceListResponse, TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse, TenantServiceUpdateMemberRequest, TenantServiceUpdateMemberResponse, TenantServiceUpdateRequest, TenantServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class TenantService(Protocol): - async def create(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: TenantServiceCreateRequest, ctx: RequestContext[TenantServiceCreateRequest, TenantServiceCreateResponse]) -> TenantServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: TenantServiceListRequest, ctx: RequestContext[TenantServiceListRequest, TenantServiceListResponse]) -> TenantServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def get(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: TenantServiceGetRequest, ctx: RequestContext[TenantServiceGetRequest, TenantServiceGetResponse]) -> TenantServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: TenantServiceUpdateRequest, ctx: RequestContext[TenantServiceUpdateRequest, TenantServiceUpdateResponse]) -> TenantServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def delete(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def delete(self, request: TenantServiceDeleteRequest, ctx: RequestContext[TenantServiceDeleteRequest, TenantServiceDeleteResponse]) -> TenantServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def leave(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def leave(self, request: TenantServiceLeaveRequest, ctx: RequestContext[TenantServiceLeaveRequest, TenantServiceLeaveResponse]) -> TenantServiceLeaveResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def add_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def add_member(self, request: TenantServiceAddMemberRequest, ctx: RequestContext[TenantServiceAddMemberRequest, TenantServiceAddMemberResponse]) -> TenantServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def remove_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def remove_member(self, request: TenantServiceRemoveMemberRequest, ctx: RequestContext[TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse]) -> TenantServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update_member(self, request: TenantServiceUpdateMemberRequest, ctx: RequestContext[TenantServiceUpdateMemberRequest, TenantServiceUpdateMemberResponse]) -> TenantServiceUpdateMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite(self, request: TenantServiceInviteRequest, ctx: RequestContext[TenantServiceInviteRequest, TenantServiceInviteResponse]) -> TenantServiceInviteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_accept(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_accept(self, request: TenantServiceInviteAcceptRequest, ctx: RequestContext[TenantServiceInviteAcceptRequest, TenantServiceInviteAcceptResponse]) -> TenantServiceInviteAcceptResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_delete(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_delete(self, request: TenantServiceInviteDeleteRequest, ctx: RequestContext[TenantServiceInviteDeleteRequest, TenantServiceInviteDeleteResponse]) -> TenantServiceInviteDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invites_list(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invites_list(self, request: TenantServiceInvitesListRequest, ctx: RequestContext[TenantServiceInvitesListRequest, TenantServiceInvitesListResponse]) -> TenantServiceInvitesListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def invite_get(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def invite_get(self, request: TenantServiceInviteGetRequest, ctx: RequestContext[TenantServiceInviteGetRequest, TenantServiceInviteGetResponse]) -> TenantServiceInviteGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TenantServiceASGIApplication(ConnectASGIApplication[TenantService]): - def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TenantService | AsyncGenerator[TenantService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -70,8 +86,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Create", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -80,8 +96,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="List", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -90,8 +106,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Get", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse, + input=TenantServiceGetRequest, + output=TenantServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -100,8 +116,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Update", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse, + input=TenantServiceUpdateRequest, + output=TenantServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -110,8 +126,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Delete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse, + input=TenantServiceDeleteRequest, + output=TenantServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.delete, @@ -120,8 +136,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Leave", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse, + input=TenantServiceLeaveRequest, + output=TenantServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.leave, @@ -130,8 +146,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.add_member, @@ -140,8 +156,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.remove_member, @@ -150,8 +166,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse, + input=TenantServiceUpdateMemberRequest, + output=TenantServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update_member, @@ -160,8 +176,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="Invite", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse, + input=TenantServiceInviteRequest, + output=TenantServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite, @@ -170,8 +186,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse, + input=TenantServiceInviteAcceptRequest, + output=TenantServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_accept, @@ -180,8 +196,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse, + input=TenantServiceInviteDeleteRequest, + output=TenantServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_delete, @@ -190,8 +206,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse, + input=TenantServiceInvitesListRequest, + output=TenantServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invites_list, @@ -200,8 +216,8 @@ def __init__(self, service: TenantService | AsyncGenerator[TenantService], *, in method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse, + input=TenantServiceInviteGetRequest, + output=TenantServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.invite_get, @@ -222,18 +238,18 @@ def path(self) -> str: class TenantServiceClient(ConnectClient): async def create( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, + request: TenantServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: + ) -> TenantServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -242,18 +258,18 @@ async def create( async def list( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, + request: TenantServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse: + ) -> TenantServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -262,18 +278,18 @@ async def list( async def get( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, + request: TenantServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse: + ) -> TenantServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse, + input=TenantServiceGetRequest, + output=TenantServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -282,18 +298,18 @@ async def get( async def update( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, + request: TenantServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse: + ) -> TenantServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse, + input=TenantServiceUpdateRequest, + output=TenantServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -302,18 +318,18 @@ async def update( async def delete( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, + request: TenantServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse: + ) -> TenantServiceDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse, + input=TenantServiceDeleteRequest, + output=TenantServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -322,18 +338,18 @@ async def delete( async def leave( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, + request: TenantServiceLeaveRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse: + ) -> TenantServiceLeaveResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Leave", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse, + input=TenantServiceLeaveRequest, + output=TenantServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -342,18 +358,18 @@ async def leave( async def add_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, + request: TenantServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: + ) -> TenantServiceAddMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -362,18 +378,18 @@ async def add_member( async def remove_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, + request: TenantServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: + ) -> TenantServiceRemoveMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -382,18 +398,18 @@ async def remove_member( async def update_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, + request: TenantServiceUpdateMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse: + ) -> TenantServiceUpdateMemberResponse: return await self.execute_unary( request=request, method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse, + input=TenantServiceUpdateMemberRequest, + output=TenantServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -402,18 +418,18 @@ async def update_member( async def invite( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, + request: TenantServiceInviteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse: + ) -> TenantServiceInviteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Invite", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse, + input=TenantServiceInviteRequest, + output=TenantServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -422,18 +438,18 @@ async def invite( async def invite_accept( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, + request: TenantServiceInviteAcceptRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse: + ) -> TenantServiceInviteAcceptResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse, + input=TenantServiceInviteAcceptRequest, + output=TenantServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -442,18 +458,18 @@ async def invite_accept( async def invite_delete( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, + request: TenantServiceInviteDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse: + ) -> TenantServiceInviteDeleteResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse, + input=TenantServiceInviteDeleteRequest, + output=TenantServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -462,18 +478,18 @@ async def invite_delete( async def invites_list( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, + request: TenantServiceInvitesListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse: + ) -> TenantServiceInvitesListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse, + input=TenantServiceInvitesListRequest, + output=TenantServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -482,69 +498,85 @@ async def invites_list( async def invite_get( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, + request: TenantServiceInviteGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse: + ) -> TenantServiceInviteGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse, + input=TenantServiceInviteGetRequest, + output=TenantServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class TenantServiceSync(Protocol): + def create(self, request: TenantServiceCreateRequest, ctx: RequestContext[TenantServiceCreateRequest, TenantServiceCreateResponse]) -> TenantServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def list(self, request: TenantServiceListRequest, ctx: RequestContext[TenantServiceListRequest, TenantServiceListResponse]) -> TenantServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def get(self, request: TenantServiceGetRequest, ctx: RequestContext[TenantServiceGetRequest, TenantServiceGetResponse]) -> TenantServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: TenantServiceUpdateRequest, ctx: RequestContext[TenantServiceUpdateRequest, TenantServiceUpdateResponse]) -> TenantServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def delete(self, request: TenantServiceDeleteRequest, ctx: RequestContext[TenantServiceDeleteRequest, TenantServiceDeleteResponse]) -> TenantServiceDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class TenantServiceSync(Protocol): - def create(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def get(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def delete(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def leave(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def add_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def remove_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update_member(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_accept(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_delete(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invites_list(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def invite_get(self, request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def leave(self, request: TenantServiceLeaveRequest, ctx: RequestContext[TenantServiceLeaveRequest, TenantServiceLeaveResponse]) -> TenantServiceLeaveResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def add_member(self, request: TenantServiceAddMemberRequest, ctx: RequestContext[TenantServiceAddMemberRequest, TenantServiceAddMemberResponse]) -> TenantServiceAddMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def remove_member(self, request: TenantServiceRemoveMemberRequest, ctx: RequestContext[TenantServiceRemoveMemberRequest, TenantServiceRemoveMemberResponse]) -> TenantServiceRemoveMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def update_member(self, request: TenantServiceUpdateMemberRequest, ctx: RequestContext[TenantServiceUpdateMemberRequest, TenantServiceUpdateMemberResponse]) -> TenantServiceUpdateMemberResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite(self, request: TenantServiceInviteRequest, ctx: RequestContext[TenantServiceInviteRequest, TenantServiceInviteResponse]) -> TenantServiceInviteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_accept(self, request: TenantServiceInviteAcceptRequest, ctx: RequestContext[TenantServiceInviteAcceptRequest, TenantServiceInviteAcceptResponse]) -> TenantServiceInviteAcceptResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_delete(self, request: TenantServiceInviteDeleteRequest, ctx: RequestContext[TenantServiceInviteDeleteRequest, TenantServiceInviteDeleteResponse]) -> TenantServiceInviteDeleteResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invites_list(self, request: TenantServiceInvitesListRequest, ctx: RequestContext[TenantServiceInvitesListRequest, TenantServiceInvitesListResponse]) -> TenantServiceInvitesListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def invite_get(self, request: TenantServiceInviteGetRequest, ctx: RequestContext[TenantServiceInviteGetRequest, TenantServiceInviteGetResponse]) -> TenantServiceInviteGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TenantServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TenantServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TenantServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.TenantService/Create": EndpointSync.unary( method=MethodInfo( name="Create", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -553,8 +585,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="List", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -563,8 +595,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Get", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse, + input=TenantServiceGetRequest, + output=TenantServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -573,8 +605,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Update", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse, + input=TenantServiceUpdateRequest, + output=TenantServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -583,8 +615,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Delete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse, + input=TenantServiceDeleteRequest, + output=TenantServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.delete, @@ -593,8 +625,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Leave", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse, + input=TenantServiceLeaveRequest, + output=TenantServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.leave, @@ -603,8 +635,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.add_member, @@ -613,8 +645,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.remove_member, @@ -623,8 +655,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse, + input=TenantServiceUpdateMemberRequest, + output=TenantServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update_member, @@ -633,8 +665,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Invite", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse, + input=TenantServiceInviteRequest, + output=TenantServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite, @@ -643,8 +675,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse, + input=TenantServiceInviteAcceptRequest, + output=TenantServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_accept, @@ -653,8 +685,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse, + input=TenantServiceInviteDeleteRequest, + output=TenantServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_delete, @@ -663,8 +695,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse, + input=TenantServiceInvitesListRequest, + output=TenantServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invites_list, @@ -673,8 +705,8 @@ def __init__(self, service: TenantServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse, + input=TenantServiceInviteGetRequest, + output=TenantServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.invite_get, @@ -695,282 +727,267 @@ def path(self) -> str: class TenantServiceClientSync(ConnectClientSync): def create( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, + request: TenantServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse: + ) -> TenantServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceCreateResponse, + input=TenantServiceCreateRequest, + output=TenantServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, + request: TenantServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse: + ) -> TenantServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceListResponse, + input=TenantServiceListRequest, + output=TenantServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def get( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, + request: TenantServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse: + ) -> TenantServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceGetResponse, + input=TenantServiceGetRequest, + output=TenantServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, + request: TenantServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse: + ) -> TenantServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateResponse, + input=TenantServiceUpdateRequest, + output=TenantServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def delete( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, + request: TenantServiceDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse: + ) -> TenantServiceDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Delete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceDeleteResponse, + input=TenantServiceDeleteRequest, + output=TenantServiceDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def leave( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, + request: TenantServiceLeaveRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse: + ) -> TenantServiceLeaveResponse: return self.execute_unary( request=request, method=MethodInfo( name="Leave", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceLeaveResponse, + input=TenantServiceLeaveRequest, + output=TenantServiceLeaveResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def add_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, + request: TenantServiceAddMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse: + ) -> TenantServiceAddMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="AddMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceAddMemberResponse, + input=TenantServiceAddMemberRequest, + output=TenantServiceAddMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def remove_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, + request: TenantServiceRemoveMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse: + ) -> TenantServiceRemoveMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="RemoveMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceRemoveMemberResponse, + input=TenantServiceRemoveMemberRequest, + output=TenantServiceRemoveMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update_member( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, + request: TenantServiceUpdateMemberRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse: + ) -> TenantServiceUpdateMemberResponse: return self.execute_unary( request=request, method=MethodInfo( name="UpdateMember", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceUpdateMemberResponse, + input=TenantServiceUpdateMemberRequest, + output=TenantServiceUpdateMemberResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, + request: TenantServiceInviteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse: + ) -> TenantServiceInviteResponse: return self.execute_unary( request=request, method=MethodInfo( name="Invite", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteResponse, + input=TenantServiceInviteRequest, + output=TenantServiceInviteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_accept( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, + request: TenantServiceInviteAcceptRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse: + ) -> TenantServiceInviteAcceptResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteAccept", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteAcceptResponse, + input=TenantServiceInviteAcceptRequest, + output=TenantServiceInviteAcceptResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_delete( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, + request: TenantServiceInviteDeleteRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse: + ) -> TenantServiceInviteDeleteResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteDelete", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteDeleteResponse, + input=TenantServiceInviteDeleteRequest, + output=TenantServiceInviteDeleteResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invites_list( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, + request: TenantServiceInvitesListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse: + ) -> TenantServiceInvitesListResponse: return self.execute_unary( request=request, method=MethodInfo( name="InvitesList", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInvitesListResponse, + input=TenantServiceInvitesListRequest, + output=TenantServiceInvitesListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def invite_get( self, - request: metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, + request: TenantServiceInviteGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse: + ) -> TenantServiceInviteGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="InviteGet", service_name="metalstack.api.v2.TenantService", - input=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetRequest, - output=metalstack_dot_api_dot_v2_dot_tenant__pb2.TenantServiceInviteGetResponse, + input=TenantServiceInviteGetRequest, + output=TenantServiceInviteGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/tenant_pb.py b/python/metalstack/api/v2/tenant_pb.py new file mode 100644 index 00000000..afef2e92 --- /dev/null +++ b/python/metalstack/api/v2/tenant_pb.py @@ -0,0 +1,1395 @@ +# Generated from metalstack/api/v2/tenant.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + from .common_pb import Labels, Meta, Paging, TenantRole, UpdateLabels, UpdateMeta + + +_TenantFields: TypeAlias = Literal["login", "meta", "name", "email", "description", "avatar_url", "created_by"] + +class Tenant(Message[_TenantFields]): + """ + Tenant is a customer of the platform + + ```proto + message metalstack.api.v2.Tenant + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + meta: + Meta for this tenant + + ```proto + optional metalstack.api.v2.Meta meta = 2; + ``` + name: + Name of the tenant + + ```proto + string name = 3; + ``` + email: + Email of the tenant + + ```proto + string email = 4; + ``` + description: + Description of this tenant + + ```proto + string description = 5; + ``` + avatar_url: + AvatarUrl of the tenant + + ```proto + string avatar_url = 6; + ``` + created_by: + CreatedBy stores who created this tenant + + ```proto + string created_by = 7; + ``` + """ + + __slots__ = ("login", "meta", "name", "email", "description", "avatar_url", "created_by") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + meta: Meta | None = None, + name: str = "", + email: str = "", + description: str = "", + avatar_url: str = "", + created_by: str = "", + ) -> None: + pass + + login: str + meta: Meta | None + name: str + email: str + description: str + avatar_url: str + created_by: str + +_TenantMemberFields: TypeAlias = Literal["id", "role", "projects", "created_at", "meta"] + +class TenantMember(Message[_TenantMemberFields]): + """ + TenantMember defines a user that participates in a tenant + + ```proto + message metalstack.api.v2.TenantMember + ``` + + Attributes: + id: + Id is the user id of the member + + ```proto + string id = 1; + ``` + role: + Role is the role of the member + + ```proto + metalstack.api.v2.TenantRole role = 2; + ``` + projects: + Projects in which a user is a direct member + + ```proto + repeated string projects = 3; + ``` + created_at: + CreatedAt the date when the member was added to the tenant + + ```proto + optional google.protobuf.Timestamp created_at = 4; + ``` + meta: + Meta for this tenant member + + ```proto + optional metalstack.api.v2.Meta meta = 5; + ``` + """ + + __slots__ = ("id", "role", "projects", "created_at", "meta") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + role: TenantRole | None = None, + projects: list[str] | None = None, + created_at: Timestamp | None = None, + meta: Meta | None = None, + ) -> None: + pass + + id: str + role: TenantRole + projects: list[str] + created_at: Timestamp | None + meta: Meta | None + +_TenantInviteFields: TypeAlias = Literal["secret", "target_tenant", "role", "joined", "target_tenant_name", "tenant", "tenant_name", "expires_at", "joined_at"] + +class TenantInvite(Message[_TenantInviteFields]): + """ + TenantInvite defines invite to tenant + + ```proto + message metalstack.api.v2.TenantInvite + ``` + + Attributes: + secret: + Secret is the secret part of the invite, typically part of the url + + ```proto + string secret = 1; + ``` + target_tenant: + TargetTenant is the tenant id for which this invite was created + + ```proto + string target_tenant = 2; + ``` + role: + Role is the role in this tenant the user will get after accepting the invitation + + ```proto + metalstack.api.v2.TenantRole role = 3; + ``` + joined: + Joined is false as long as a user has not accepted the invite + + ```proto + bool joined = 4; + ``` + target_tenant_name: + TargetTenantName is the tenant name for which this invite was created + + ```proto + string target_tenant_name = 5; + ``` + tenant: + Tenant is the login of the tenant inviting another user to join this tenant + + ```proto + string tenant = 6; + ``` + tenant_name: + TenantName is the name of the tenant inviting another user to join this tenant + + ```proto + string tenant_name = 7; + ``` + expires_at: + ExpiresAt the date when this invite expires + + ```proto + optional google.protobuf.Timestamp expires_at = 8; + ``` + joined_at: + JoinedAt the date when the member accepted this invite + + ```proto + optional google.protobuf.Timestamp joined_at = 9; + ``` + """ + + __slots__ = ("secret", "target_tenant", "role", "joined", "target_tenant_name", "tenant", "tenant_name", "expires_at", "joined_at") + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + target_tenant: str = "", + role: TenantRole | None = None, + joined: bool = False, + target_tenant_name: str = "", + tenant: str = "", + tenant_name: str = "", + expires_at: Timestamp | None = None, + joined_at: Timestamp | None = None, + ) -> None: + pass + + secret: str + target_tenant: str + role: TenantRole + joined: bool + target_tenant_name: str + tenant: str + tenant_name: str + expires_at: Timestamp | None + joined_at: Timestamp | None + +_TenantServiceListRequestFields: TypeAlias = Literal["query"] + +class TenantServiceListRequest(Message[_TenantServiceListRequestFields]): + """ + TenantServiceListRequest is the request payload of the tenant list request + + ```proto + message metalstack.api.v2.TenantServiceListRequest + ``` + + Attributes: + query: + Query for tenants + + ```proto + optional metalstack.api.v2.TenantQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: TenantQuery | None = None, + ) -> None: + pass + + query: TenantQuery | None + +_TenantQueryFields: TypeAlias = Literal["login", "name", "labels", "paging"] + +class TenantQuery(Message[_TenantQueryFields]): + """ + TenantQuery is used to search tenants + + ```proto + message metalstack.api.v2.TenantQuery + ``` + + Attributes: + login: + Id filters tenants by login + + ```proto + optional string login = 1; + ``` + name: + Name filters tenants by name + + ```proto + optional string name = 2; + ``` + labels: + Labels lists only projects containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 3; + ``` + paging: + Paging details for the list request + + ```proto + optional metalstack.api.v2.Paging paging = 4; + ``` + """ + + __slots__ = ("login", "name", "labels", "paging") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str | None = None, + name: str | None = None, + labels: Labels | None = None, + paging: Paging | None = None, + ) -> None: + pass + + login: str + name: str + labels: Labels | None + paging: Paging | None + +_TenantServiceGetRequestFields: TypeAlias = Literal["login"] + +class TenantServiceGetRequest(Message[_TenantServiceGetRequestFields]): + """ + TenantServiceGetRequest is the request payload of the tenant get request + + ```proto + message metalstack.api.v2.TenantServiceGetRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + """ + + __slots__ = ("login",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + ) -> None: + pass + + login: str + +_TenantServiceCreateRequestFields: TypeAlias = Literal["name", "description", "email", "avatar_url", "labels"] + +class TenantServiceCreateRequest(Message[_TenantServiceCreateRequestFields]): + """ + TenantServiceCreateRequest is the request payload of the tenant create request + + ```proto + message metalstack.api.v2.TenantServiceCreateRequest + ``` + + Attributes: + name: + Name of this tenant + + ```proto + string name = 1; + ``` + description: + Description of this tenant + + ```proto + optional string description = 2; + ``` + email: + Email of the tenant, if not set will be inherited from the creator + + ```proto + optional string email = 3; + ``` + avatar_url: + AvatarUrl of the tenant + + ```proto + optional string avatar_url = 4; + ``` + labels: + Labels on the tenant + + ```proto + optional metalstack.api.v2.Labels labels = 5; + ``` + """ + + __slots__ = ("name", "description", "email", "avatar_url", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str = "", + description: str | None = None, + email: str | None = None, + avatar_url: str | None = None, + labels: Labels | None = None, + ) -> None: + pass + + name: str + description: str + email: str + avatar_url: str + labels: Labels | None + +_TenantServiceUpdateRequestFields: TypeAlias = Literal["login", "update_meta", "name", "email", "description", "avatar_url", "labels"] + +class TenantServiceUpdateRequest(Message[_TenantServiceUpdateRequestFields]): + """ + TenantServiceUpdateRequest is the request payload of the tenant update request + + ```proto + message metalstack.api.v2.TenantServiceUpdateRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + name: + Name of the tenant + + ```proto + optional string name = 3; + ``` + email: + Email of the tenant + + ```proto + optional string email = 4; + ``` + description: + Description of this tenant + + ```proto + optional string description = 5; + ``` + avatar_url: + AvatarUrl of the tenant + + ```proto + optional string avatar_url = 6; + ``` + labels: + Labels on the tenant + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 7; + ``` + """ + + __slots__ = ("login", "update_meta", "name", "email", "description", "avatar_url", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + update_meta: UpdateMeta | None = None, + name: str | None = None, + email: str | None = None, + description: str | None = None, + avatar_url: str | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + login: str + update_meta: UpdateMeta | None + name: str + email: str + description: str + avatar_url: str + labels: UpdateLabels | None + +_TenantServiceDeleteRequestFields: TypeAlias = Literal["login"] + +class TenantServiceDeleteRequest(Message[_TenantServiceDeleteRequestFields]): + """ + TenantServiceDeleteRequest is the request payload of the tenant delete request + + ```proto + message metalstack.api.v2.TenantServiceDeleteRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + """ + + __slots__ = ("login",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + ) -> None: + pass + + login: str + +_TenantServiceGetResponseFields: TypeAlias = Literal["tenant", "tenant_members"] + +class TenantServiceGetResponse(Message[_TenantServiceGetResponseFields]): + """ + TenantServiceGetResponse is the response payload of the tenant get request + + ```proto + message metalstack.api.v2.TenantServiceGetResponse + ``` + + Attributes: + tenant: + Tenant is the tenant + + ```proto + optional metalstack.api.v2.Tenant tenant = 1; + ``` + tenant_members: + TenantMembers of this tenant + + ```proto + repeated metalstack.api.v2.TenantMember tenant_members = 2; + ``` + """ + + __slots__ = ("tenant", "tenant_members") + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: Tenant | None = None, + tenant_members: list[TenantMember] | None = None, + ) -> None: + pass + + tenant: Tenant | None + tenant_members: list[TenantMember] + +_TenantServiceListResponseFields: TypeAlias = Literal["tenants"] + +class TenantServiceListResponse(Message[_TenantServiceListResponseFields]): + """ + TenantServiceListResponse is the response payload of the tenant list request + + ```proto + message metalstack.api.v2.TenantServiceListResponse + ``` + + Attributes: + tenants: + Tenants is the list of tenants + + ```proto + repeated metalstack.api.v2.Tenant tenants = 1; + ``` + """ + + __slots__ = ("tenants",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenants: list[Tenant] | None = None, + ) -> None: + pass + + tenants: list[Tenant] + +_TenantServiceCreateResponseFields: TypeAlias = Literal["tenant"] + +class TenantServiceCreateResponse(Message[_TenantServiceCreateResponseFields]): + """ + TenantServiceCreateResponse is the response payload of the tenant create request + + ```proto + message metalstack.api.v2.TenantServiceCreateResponse + ``` + + Attributes: + tenant: + Tenant is the tenant + + ```proto + optional metalstack.api.v2.Tenant tenant = 1; + ``` + """ + + __slots__ = ("tenant",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: Tenant | None = None, + ) -> None: + pass + + tenant: Tenant | None + +_TenantServiceUpdateResponseFields: TypeAlias = Literal["tenant"] + +class TenantServiceUpdateResponse(Message[_TenantServiceUpdateResponseFields]): + """ + TenantServiceUpdateResponse is the response payload of the tenant update request + + ```proto + message metalstack.api.v2.TenantServiceUpdateResponse + ``` + + Attributes: + tenant: + Tenant is the tenant + + ```proto + optional metalstack.api.v2.Tenant tenant = 1; + ``` + """ + + __slots__ = ("tenant",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: Tenant | None = None, + ) -> None: + pass + + tenant: Tenant | None + +_TenantServiceDeleteResponseFields: TypeAlias = Literal["tenant"] + +class TenantServiceDeleteResponse(Message[_TenantServiceDeleteResponseFields]): + """ + TenantServiceDeleteResponse is the response payload of the tenant delete request + + ```proto + message metalstack.api.v2.TenantServiceDeleteResponse + ``` + + Attributes: + tenant: + Tenant is the tenant + + ```proto + optional metalstack.api.v2.Tenant tenant = 1; + ``` + """ + + __slots__ = ("tenant",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: Tenant | None = None, + ) -> None: + pass + + tenant: Tenant | None + +_TenantServiceInviteRequestFields: TypeAlias = Literal["login", "role"] + +class TenantServiceInviteRequest(Message[_TenantServiceInviteRequestFields]): + """ + TenantServiceInviteRequest is used to invite a member to a tenant + + ```proto + message metalstack.api.v2.TenantServiceInviteRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + role: + Role of this user in this tenant + + ```proto + metalstack.api.v2.TenantRole role = 2; + ``` + """ + + __slots__ = ("login", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + role: TenantRole | None = None, + ) -> None: + pass + + login: str + role: TenantRole + +_TenantServiceInviteResponseFields: TypeAlias = Literal["invite"] + +class TenantServiceInviteResponse(Message[_TenantServiceInviteResponseFields]): + """ + TenantServiceInviteRequest is the response payload to a invite member request + + ```proto + message metalstack.api.v2.TenantServiceInviteResponse + ``` + + Attributes: + invite: + Invite contains a secret which can be sent to a potential user + can be appended to the invitation endpoint at our cloud console like + console.metalstack.cloud/invite/ + + ```proto + optional metalstack.api.v2.TenantInvite invite = 1; + ``` + """ + + __slots__ = ("invite",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invite: TenantInvite | None = None, + ) -> None: + pass + + invite: TenantInvite | None + +_TenantServiceInvitesListRequestFields: TypeAlias = Literal["login"] + +class TenantServiceInvitesListRequest(Message[_TenantServiceInvitesListRequestFields]): + """ + TenantServiceInvitesListRequest is the request payload to a list invites request + + ```proto + message metalstack.api.v2.TenantServiceInvitesListRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + """ + + __slots__ = ("login",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + ) -> None: + pass + + login: str + +_TenantServiceInvitesListResponseFields: TypeAlias = Literal["invites"] + +class TenantServiceInvitesListResponse(Message[_TenantServiceInvitesListResponseFields]): + """ + TenantServiceInvitesListResponse is the response payload to a list invites request + + ```proto + message metalstack.api.v2.TenantServiceInvitesListResponse + ``` + + Attributes: + invites: + Invites that have not yet accepted the invitation to this tenant + + ```proto + repeated metalstack.api.v2.TenantInvite invites = 1; + ``` + """ + + __slots__ = ("invites",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invites: list[TenantInvite] | None = None, + ) -> None: + pass + + invites: list[TenantInvite] + +_TenantServiceInviteGetRequestFields: TypeAlias = Literal["secret"] + +class TenantServiceInviteGetRequest(Message[_TenantServiceInviteGetRequestFields]): + """ + TenantServiceInviteGetRequest is the request payload to get a invite + + ```proto + message metalstack.api.v2.TenantServiceInviteGetRequest + ``` + + Attributes: + secret: + Secret of the invite to get + + ```proto + string secret = 1; + ``` + """ + + __slots__ = ("secret",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + ) -> None: + pass + + secret: str + +_TenantServiceInviteGetResponseFields: TypeAlias = Literal["invite"] + +class TenantServiceInviteGetResponse(Message[_TenantServiceInviteGetResponseFields]): + """ + TenantServiceInviteGetResponse is the response payload to a get invite request + + ```proto + message metalstack.api.v2.TenantServiceInviteGetResponse + ``` + + Attributes: + invite: + Invite is the invite + + ```proto + optional metalstack.api.v2.TenantInvite invite = 1; + ``` + """ + + __slots__ = ("invite",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + invite: TenantInvite | None = None, + ) -> None: + pass + + invite: TenantInvite | None + +_TenantServiceRemoveMemberRequestFields: TypeAlias = Literal["login", "member"] + +class TenantServiceRemoveMemberRequest(Message[_TenantServiceRemoveMemberRequestFields]): + """ + TenantServiceRemoveMemberRequest is used to remove a member from a tenant + + ```proto + message metalstack.api.v2.TenantServiceRemoveMemberRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + member: + Member is the id of the member to remove from this tenant + + ```proto + string member = 2; + ``` + """ + + __slots__ = ("login", "member") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + member: str = "", + ) -> None: + pass + + login: str + member: str + +_TenantServiceLeaveRequestFields: TypeAlias = Literal["login"] + +class TenantServiceLeaveRequest(Message[_TenantServiceLeaveRequestFields]): + """ + TenantServiceLeaveTenantRequest is used to leave a tenant + + ```proto + message metalstack.api.v2.TenantServiceLeaveRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + """ + + __slots__ = ("login",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + ) -> None: + pass + + login: str + +_TenantServiceLeaveResponseFields: TypeAlias = NoReturn + +class TenantServiceLeaveResponse(Message[_TenantServiceLeaveResponseFields]): + """ + TenantServiceLeaveTenantResponse is the response payload to a leave tenant request + + ```proto + message metalstack.api.v2.TenantServiceLeaveResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TenantServiceRemoveMemberResponseFields: TypeAlias = Literal["tenant_member"] + +class TenantServiceRemoveMemberResponse(Message[_TenantServiceRemoveMemberResponseFields]): + """ + TenantServiceRemoveMemberResponse is the response payload to a remove member request + + ```proto + message metalstack.api.v2.TenantServiceRemoveMemberResponse + ``` + + Attributes: + tenant_member: + TenantMember is the removed tenant member + + ```proto + optional metalstack.api.v2.TenantMember tenant_member = 1; + ``` + """ + + __slots__ = ("tenant_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant_member: TenantMember | None = None, + ) -> None: + pass + + tenant_member: TenantMember | None + +_TenantServiceInviteAcceptRequestFields: TypeAlias = Literal["secret"] + +class TenantServiceInviteAcceptRequest(Message[_TenantServiceInviteAcceptRequestFields]): + """ + TenantServiceInviteAcceptRequest is the request payload to a accept invite request + + ```proto + message metalstack.api.v2.TenantServiceInviteAcceptRequest + ``` + + Attributes: + secret: + Secret is the invitation secret part of the invitation url + + ```proto + string secret = 1; + ``` + """ + + __slots__ = ("secret",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + secret: str = "", + ) -> None: + pass + + secret: str + +_TenantServiceInviteAcceptResponseFields: TypeAlias = Literal["tenant", "tenant_name"] + +class TenantServiceInviteAcceptResponse(Message[_TenantServiceInviteAcceptResponseFields]): + """ + TenantServiceInviteAcceptResponse is the response payload to a accept invite request + + ```proto + message metalstack.api.v2.TenantServiceInviteAcceptResponse + ``` + + Attributes: + tenant: + Tenant ID of the joined tenant + + ```proto + string tenant = 1; + ``` + tenant_name: + TenantName of the joined tenant + + ```proto + string tenant_name = 2; + ``` + """ + + __slots__ = ("tenant", "tenant_name") + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant: str = "", + tenant_name: str = "", + ) -> None: + pass + + tenant: str + tenant_name: str + +_TenantServiceInviteDeleteRequestFields: TypeAlias = Literal["login", "secret"] + +class TenantServiceInviteDeleteRequest(Message[_TenantServiceInviteDeleteRequestFields]): + """ + TenantServiceInviteDeleteRequest is the request payload to a delete invite + + ```proto + message metalstack.api.v2.TenantServiceInviteDeleteRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + secret: + Secret of the invite to delete + + ```proto + string secret = 2; + ``` + """ + + __slots__ = ("login", "secret") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + secret: str = "", + ) -> None: + pass + + login: str + secret: str + +_TenantServiceInviteDeleteResponseFields: TypeAlias = NoReturn + +class TenantServiceInviteDeleteResponse(Message[_TenantServiceInviteDeleteResponseFields]): + """ + TenantServiceInviteDeleteResponse is the response payload of a delete invite request + + ```proto + message metalstack.api.v2.TenantServiceInviteDeleteResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TenantServiceAddMemberRequestFields: TypeAlias = Literal["login", "member", "role"] + +class TenantServiceAddMemberRequest(Message[_TenantServiceAddMemberRequestFields]): + """ + TenantServiceAddMemberRequest is the request payload for adding a member to a tenant + + ```proto + message metalstack.api.v2.TenantServiceAddMemberRequest + ``` + + Attributes: + login: + Login of the tenant to which the member will be added + + ```proto + string login = 1; + ``` + member: + Login of the member to add + + ```proto + string member = 2; + ``` + role: + Role to assign to the new member + + ```proto + metalstack.api.v2.TenantRole role = 3; + ``` + """ + + __slots__ = ("login", "member", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + member: str = "", + role: TenantRole | None = None, + ) -> None: + pass + + login: str + member: str + role: TenantRole + +_TenantServiceAddMemberResponseFields: TypeAlias = Literal["tenant_member"] + +class TenantServiceAddMemberResponse(Message[_TenantServiceAddMemberResponseFields]): + """ + TenantServiceAddMemberResponse is the response payload for the add member request + + ```proto + message metalstack.api.v2.TenantServiceAddMemberResponse + ``` + + Attributes: + tenant_member: + TenantMember is the added tenant member + + ```proto + optional metalstack.api.v2.TenantMember tenant_member = 1; + ``` + """ + + __slots__ = ("tenant_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant_member: TenantMember | None = None, + ) -> None: + pass + + tenant_member: TenantMember | None + +_TenantServiceUpdateMemberRequestFields: TypeAlias = Literal["login", "member", "role"] + +class TenantServiceUpdateMemberRequest(Message[_TenantServiceUpdateMemberRequestFields]): + """ + TenantServiceUpdateMemberRequest is used to update a member from a tenant + + ```proto + message metalstack.api.v2.TenantServiceUpdateMemberRequest + ``` + + Attributes: + login: + Login of the tenant + + ```proto + string login = 1; + ``` + member: + Member is the id of the member to update in this tenant + + ```proto + string member = 2; + ``` + role: + Role of this user in this tenant + + ```proto + metalstack.api.v2.TenantRole role = 3; + ``` + """ + + __slots__ = ("login", "member", "role") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + member: str = "", + role: TenantRole | None = None, + ) -> None: + pass + + login: str + member: str + role: TenantRole + +_TenantServiceUpdateMemberResponseFields: TypeAlias = Literal["tenant_member"] + +class TenantServiceUpdateMemberResponse(Message[_TenantServiceUpdateMemberResponseFields]): + """ + TenantServiceUpdateMemberResponse is the response payload to a update member request + + ```proto + message metalstack.api.v2.TenantServiceUpdateMemberResponse + ``` + + Attributes: + tenant_member: + TenantMember is the updated membership + + ```proto + optional metalstack.api.v2.TenantMember tenant_member = 1; + ``` + """ + + __slots__ = ("tenant_member",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tenant_member: TenantMember | None = None, + ) -> None: + pass + + tenant_member: TenantMember | None + + +_DESC = file_desc( + b'\n\x1emetalstack/api/v2/tenant.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\x92\x02\n\x06Tenant\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12+\n\x04meta\x18\x02 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1d\n\x05email\x18\x04 \x01(\tR\x05emailB\x07\xbaH\x04r\x02`\x01\x12-\n\x0bdescription\x18\x05 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12*\n\navatar_url\x18\x06 \x01(\tR\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12\x1d\n\ncreated_by\x18\x07 \x01(\tR\tcreatedBy"\xec\x01\n\x0cTenantMember\x12\x1b\n\x02id\x18\x01 \x01(\tR\x02idB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12;\n\x04role\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x1a\n\x08projects\x18\x03 \x03(\tR\x08projects\x129\n\ncreated_at\x18\x04 \x01(\x0b2\x1a.google.protobuf.TimestampR\tcreatedAt\x12+\n\x04meta\x18\x05 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta"\xfb\x02\n\x0cTenantInvite\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\x12#\n\rtarget_tenant\x18\x02 \x01(\tR\x0ctargetTenant\x12;\n\x04role\x18\x03 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12\x16\n\x06joined\x18\x04 \x01(\x08R\x06joined\x12,\n\x12target_tenant_name\x18\x05 \x01(\tR\x10targetTenantName\x12\x16\n\x06tenant\x18\x06 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x07 \x01(\tR\ntenantName\x129\n\nexpires_at\x18\x08 \x01(\x0b2\x1a.google.protobuf.TimestampR\texpiresAt\x127\n\tjoined_at\x18\t \x01(\x0b2\x1a.google.protobuf.TimestampR\x08joinedAt"P\n\x18TenantServiceListRequest\x124\n\x05query\x18\x01 \x01(\x0b2\x1e.metalstack.api.v2.TenantQueryR\x05query"\xe4\x01\n\x0bTenantQuery\x12&\n\x05login\x18\x01 \x01(\tH\x00R\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tH\x01R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x03 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x02R\x06labels\x88\x01\x01\x121\n\x06paging\x18\x04 \x01(\x0b2\x19.metalstack.api.v2.PagingR\x06pagingB\x08\n\x06_loginB\x07\n\x05_nameB\t\n\x07_labels"/\n\x17TenantServiceGetRequest\x12\x14\n\x05login\x18\x01 \x01(\tR\x05login"\xa2\x02\n\x1aTenantServiceCreateRequest\x12\x1f\n\x04name\x18\x01 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x122\n\x0bdescription\x18\x02 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12"\n\x05email\x18\x03 \x01(\tH\x01R\x05emailB\x07\xbaH\x04r\x02`\x01\x88\x01\x01\x12/\n\navatar_url\x18\x04 \x01(\tH\x02R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x121\n\x06labels\x18\x05 \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labelsB\x0e\n\x0c_descriptionB\x08\n\x06_emailB\r\n\x0b_avatar_url"\xb1\x03\n\x1aTenantServiceUpdateRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x01\x12$\n\x04name\x18\x03 \x01(\tH\x00R\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12"\n\x05email\x18\x04 \x01(\tH\x01R\x05emailB\x07\xbaH\x04r\x02`\x01\x88\x01\x01\x122\n\x0bdescription\x18\x05 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12/\n\navatar_url\x18\x06 \x01(\tH\x03R\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsH\x04R\x06labels\x88\x01\x01B\x07\n\x05_nameB\x08\n\x06_emailB\x0e\n\x0c_descriptionB\r\n\x0b_avatar_urlB\t\n\x07_labels"?\n\x1aTenantServiceDeleteRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01"\x95\x01\n\x18TenantServiceGetResponse\x121\n\x06tenant\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.TenantR\x06tenant\x12F\n\x0etenant_members\x18\x02 \x03(\x0b2\x1f.metalstack.api.v2.TenantMemberR\rtenantMembers"P\n\x19TenantServiceListResponse\x123\n\x07tenants\x18\x01 \x03(\x0b2\x19.metalstack.api.v2.TenantR\x07tenants"P\n\x1bTenantServiceCreateResponse\x121\n\x06tenant\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.TenantR\x06tenant"P\n\x1bTenantServiceUpdateResponse\x121\n\x06tenant\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.TenantR\x06tenant"P\n\x1bTenantServiceDeleteResponse\x121\n\x06tenant\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.TenantR\x06tenant"|\n\x1aTenantServiceInviteRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12;\n\x04role\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"V\n\x1bTenantServiceInviteResponse\x127\n\x06invite\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantInviteR\x06invite"D\n\x1fTenantServiceInvitesListRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01"]\n TenantServiceInvitesListResponse\x129\n\x07invites\x18\x01 \x03(\x0b2\x1f.metalstack.api.v2.TenantInviteR\x07invites"7\n\x1dTenantServiceInviteGetRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret"Y\n\x1eTenantServiceInviteGetResponse\x127\n\x06invite\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantInviteR\x06invite"]\n TenantServiceRemoveMemberRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member">\n\x19TenantServiceLeaveRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01"\x1c\n\x1aTenantServiceLeaveResponse"i\n!TenantServiceRemoveMemberResponse\x12D\n\rtenant_member\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember":\n TenantServiceInviteAcceptRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret"\\\n!TenantServiceInviteAcceptResponse\x12\x16\n\x06tenant\x18\x01 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x02 \x01(\tR\ntenantName"]\n TenantServiceInviteDeleteRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret"#\n!TenantServiceInviteDeleteResponse"\xa4\x01\n\x1dTenantServiceAddMemberRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12#\n\x06member\x18\x02 \x01(\tR\x06memberB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12;\n\x04role\x18\x03 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"f\n\x1eTenantServiceAddMemberResponse\x12D\n\rtenant_member\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember"\xa7\x01\n TenantServiceUpdateMemberRequest\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12#\n\x06member\x18\x02 \x01(\tR\x06memberB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12;\n\x04role\x18\x03 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x04roleB\x08\xbaH\x05\x82\x01\x02\x10\x01"i\n!TenantServiceUpdateMemberResponse\x12D\n\rtenant_member\x18\x01 \x01(\x0b2\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember2\xc5\r\n\rTenantService\x12q\n\x06Create\x12-.metalstack.api.v2.TenantServiceCreateRequest\x1a..metalstack.api.v2.TenantServiceCreateResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12k\n\x04List\x12+.metalstack.api.v2.TenantServiceListRequest\x1a,.metalstack.api.v2.TenantServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12l\n\x03Get\x12*.metalstack.api.v2.TenantServiceGetRequest\x1a+.metalstack.api.v2.TenantServiceGetResponse"\x0c\xc2\xf3\x18\x04\x01\x02\x03\x04\xe0\xf3\x18\x02\x12s\n\x06Update\x12-.metalstack.api.v2.TenantServiceUpdateRequest\x1a..metalstack.api.v2.TenantServiceUpdateResponse"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12s\n\x06Delete\x12-.metalstack.api.v2.TenantServiceDeleteRequest\x1a..metalstack.api.v2.TenantServiceDeleteResponse"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12o\n\x05Leave\x12,.metalstack.api.v2.TenantServiceLeaveRequest\x1a-.metalstack.api.v2.TenantServiceLeaveResponse"\t\xc2\xf3\x18\x01\x03\xe0\xf3\x18\x01\x12|\n\tAddMember\x120.metalstack.api.v2.TenantServiceAddMemberRequest\x1a1.metalstack.api.v2.TenantServiceAddMemberResponse"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x84\x01\n\x0cRemoveMember\x123.metalstack.api.v2.TenantServiceRemoveMemberRequest\x1a4.metalstack.api.v2.TenantServiceRemoveMemberResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x84\x01\n\x0cUpdateMember\x123.metalstack.api.v2.TenantServiceUpdateMemberRequest\x1a4.metalstack.api.v2.TenantServiceUpdateMemberResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06Invite\x12-.metalstack.api.v2.TenantServiceInviteRequest\x1a..metalstack.api.v2.TenantServiceInviteResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x0cInviteAccept\x123.metalstack.api.v2.TenantServiceInviteAcceptRequest\x1a4.metalstack.api.v2.TenantServiceInviteAcceptResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12\x84\x01\n\x0cInviteDelete\x123.metalstack.api.v2.TenantServiceInviteDeleteRequest\x1a4.metalstack.api.v2.TenantServiceInviteDeleteResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x81\x01\n\x0bInvitesList\x122.metalstack.api.v2.TenantServiceInvitesListRequest\x1a3.metalstack.api.v2.TenantServiceInvitesListResponse"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12z\n\tInviteGet\x120.metalstack.api.v2.TenantServiceInviteGetRequest\x1a1.metalstack.api.v2.TenantServiceInviteGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02B\xc1\x01\n\x15com.metalstack.api.v2B\x0bTenantProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Tenant": Tenant, + "TenantMember": TenantMember, + "TenantInvite": TenantInvite, + "TenantServiceListRequest": TenantServiceListRequest, + "TenantQuery": TenantQuery, + "TenantServiceGetRequest": TenantServiceGetRequest, + "TenantServiceCreateRequest": TenantServiceCreateRequest, + "TenantServiceUpdateRequest": TenantServiceUpdateRequest, + "TenantServiceDeleteRequest": TenantServiceDeleteRequest, + "TenantServiceGetResponse": TenantServiceGetResponse, + "TenantServiceListResponse": TenantServiceListResponse, + "TenantServiceCreateResponse": TenantServiceCreateResponse, + "TenantServiceUpdateResponse": TenantServiceUpdateResponse, + "TenantServiceDeleteResponse": TenantServiceDeleteResponse, + "TenantServiceInviteRequest": TenantServiceInviteRequest, + "TenantServiceInviteResponse": TenantServiceInviteResponse, + "TenantServiceInvitesListRequest": TenantServiceInvitesListRequest, + "TenantServiceInvitesListResponse": TenantServiceInvitesListResponse, + "TenantServiceInviteGetRequest": TenantServiceInviteGetRequest, + "TenantServiceInviteGetResponse": TenantServiceInviteGetResponse, + "TenantServiceRemoveMemberRequest": TenantServiceRemoveMemberRequest, + "TenantServiceLeaveRequest": TenantServiceLeaveRequest, + "TenantServiceLeaveResponse": TenantServiceLeaveResponse, + "TenantServiceRemoveMemberResponse": TenantServiceRemoveMemberResponse, + "TenantServiceInviteAcceptRequest": TenantServiceInviteAcceptRequest, + "TenantServiceInviteAcceptResponse": TenantServiceInviteAcceptResponse, + "TenantServiceInviteDeleteRequest": TenantServiceInviteDeleteRequest, + "TenantServiceInviteDeleteResponse": TenantServiceInviteDeleteResponse, + "TenantServiceAddMemberRequest": TenantServiceAddMemberRequest, + "TenantServiceAddMemberResponse": TenantServiceAddMemberResponse, + "TenantServiceUpdateMemberRequest": TenantServiceUpdateMemberRequest, + "TenantServiceUpdateMemberResponse": TenantServiceUpdateMemberResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/tenant.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/tenant_pb2.py b/python/metalstack/api/v2/tenant_pb2.py deleted file mode 100644 index 9e78b44d..00000000 --- a/python/metalstack/api/v2/tenant_pb2.py +++ /dev/null @@ -1,199 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/tenant.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/tenant.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/tenant.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\x92\x02\n\x06Tenant\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12\x1f\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x1d\n\x05\x65mail\x18\x04 \x01(\tB\x07\xbaH\x04r\x02`\x01R\x05\x65mail\x12-\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12*\n\navatar_url\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\tavatarUrl\x12\x1d\n\ncreated_by\x18\x07 \x01(\tR\tcreatedBy\"\xec\x01\n\x0cTenantMember\x12\x1b\n\x02id\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x02id\x12;\n\x04role\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\x12\x1a\n\x08projects\x18\x03 \x03(\tR\x08projects\x12\x39\n\ncreated_at\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAt\x12+\n\x04meta\x18\x05 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\"\xfb\x02\n\x0cTenantInvite\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\x12#\n\rtarget_tenant\x18\x02 \x01(\tR\x0ctargetTenant\x12;\n\x04role\x18\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\x12\x16\n\x06joined\x18\x04 \x01(\x08R\x06joined\x12,\n\x12target_tenant_name\x18\x05 \x01(\tR\x10targetTenantName\x12\x16\n\x06tenant\x18\x06 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x07 \x01(\tR\ntenantName\x12\x39\n\nexpires_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAt\x12\x37\n\tjoined_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08joinedAt\"P\n\x18TenantServiceListRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.TenantQueryR\x05query\"\xe4\x01\n\x0bTenantQuery\x12&\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01H\x00R\x05login\x88\x01\x01\x12$\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x04name\x88\x01\x01\x12\x36\n\x06labels\x18\x03 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x02R\x06labels\x88\x01\x01\x12\x31\n\x06paging\x18\x04 \x01(\x0b\x32\x19.metalstack.api.v2.PagingR\x06pagingB\x08\n\x06_loginB\x07\n\x05_nameB\t\n\x07_labels\"/\n\x17TenantServiceGetRequest\x12\x14\n\x05login\x18\x01 \x01(\tR\x05login\"\xa2\x02\n\x1aTenantServiceCreateRequest\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x32\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\"\n\x05\x65mail\x18\x03 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x01R\x05\x65mail\x88\x01\x01\x12/\n\navatar_url\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x02R\tavatarUrl\x88\x01\x01\x12\x31\n\x06labels\x18\x05 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labelsB\x0e\n\x0c_descriptionB\x08\n\x06_emailB\r\n\x0b_avatar_url\"\xb1\x03\n\x1aTenantServiceUpdateRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12$\n\x04name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04name\x88\x01\x01\x12\"\n\x05\x65mail\x18\x04 \x01(\tB\x07\xbaH\x04r\x02`\x01H\x01R\x05\x65mail\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12/\n\navatar_url\x18\x06 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01H\x03R\tavatarUrl\x88\x01\x01\x12<\n\x06labels\x18\x07 \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsH\x04R\x06labels\x88\x01\x01\x42\x07\n\x05_nameB\x08\n\x06_emailB\x0e\n\x0c_descriptionB\r\n\x0b_avatar_urlB\t\n\x07_labels\"?\n\x1aTenantServiceDeleteRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\"\x95\x01\n\x18TenantServiceGetResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\x12\x46\n\x0etenant_members\x18\x02 \x03(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\rtenantMembers\"P\n\x19TenantServiceListResponse\x12\x33\n\x07tenants\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.TenantR\x07tenants\"P\n\x1bTenantServiceCreateResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\"P\n\x1bTenantServiceUpdateResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\"P\n\x1bTenantServiceDeleteResponse\x12\x31\n\x06tenant\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\x06tenant\"|\n\x1aTenantServiceInviteRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12;\n\x04role\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"V\n\x1bTenantServiceInviteResponse\x12\x37\n\x06invite\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantInviteR\x06invite\"D\n\x1fTenantServiceInvitesListRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\"]\n TenantServiceInvitesListResponse\x12\x39\n\x07invites\x18\x01 \x03(\x0b\x32\x1f.metalstack.api.v2.TenantInviteR\x07invites\"7\n\x1dTenantServiceInviteGetRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\"Y\n\x1eTenantServiceInviteGetResponse\x12\x37\n\x06invite\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantInviteR\x06invite\"]\n TenantServiceRemoveMemberRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12\x16\n\x06member\x18\x02 \x01(\tR\x06member\">\n\x19TenantServiceLeaveRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\"\x1c\n\x1aTenantServiceLeaveResponse\"i\n!TenantServiceRemoveMemberResponse\x12\x44\n\rtenant_member\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember\":\n TenantServiceInviteAcceptRequest\x12\x16\n\x06secret\x18\x01 \x01(\tR\x06secret\"\\\n!TenantServiceInviteAcceptResponse\x12\x16\n\x06tenant\x18\x01 \x01(\tR\x06tenant\x12\x1f\n\x0btenant_name\x18\x02 \x01(\tR\ntenantName\"]\n TenantServiceInviteDeleteRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"#\n!TenantServiceInviteDeleteResponse\"\xa4\x01\n\x1dTenantServiceAddMemberRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12#\n\x06member\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06member\x12;\n\x04role\x18\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"f\n\x1eTenantServiceAddMemberResponse\x12\x44\n\rtenant_member\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember\"\xa7\x01\n TenantServiceUpdateMemberRequest\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12#\n\x06member\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x06member\x12;\n\x04role\x18\x03 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04role\"i\n!TenantServiceUpdateMemberResponse\x12\x44\n\rtenant_member\x18\x01 \x01(\x0b\x32\x1f.metalstack.api.v2.TenantMemberR\x0ctenantMember2\xc5\r\n\rTenantService\x12q\n\x06\x43reate\x12-.metalstack.api.v2.TenantServiceCreateRequest\x1a..metalstack.api.v2.TenantServiceCreateResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12k\n\x04List\x12+.metalstack.api.v2.TenantServiceListRequest\x1a,.metalstack.api.v2.TenantServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x12l\n\x03Get\x12*.metalstack.api.v2.TenantServiceGetRequest\x1a+.metalstack.api.v2.TenantServiceGetResponse\"\x0c\xc2\xf3\x18\x04\x01\x02\x03\x04\xe0\xf3\x18\x02\x12s\n\x06Update\x12-.metalstack.api.v2.TenantServiceUpdateRequest\x1a..metalstack.api.v2.TenantServiceUpdateResponse\"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12s\n\x06\x44\x65lete\x12-.metalstack.api.v2.TenantServiceDeleteRequest\x1a..metalstack.api.v2.TenantServiceDeleteResponse\"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12o\n\x05Leave\x12,.metalstack.api.v2.TenantServiceLeaveRequest\x1a-.metalstack.api.v2.TenantServiceLeaveResponse\"\t\xc2\xf3\x18\x01\x03\xe0\xf3\x18\x01\x12|\n\tAddMember\x12\x30.metalstack.api.v2.TenantServiceAddMemberRequest\x1a\x31.metalstack.api.v2.TenantServiceAddMemberResponse\"\n\xc2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x01\x12\x84\x01\n\x0cRemoveMember\x12\x33.metalstack.api.v2.TenantServiceRemoveMemberRequest\x1a\x34.metalstack.api.v2.TenantServiceRemoveMemberResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x84\x01\n\x0cUpdateMember\x12\x33.metalstack.api.v2.TenantServiceUpdateMemberRequest\x1a\x34.metalstack.api.v2.TenantServiceUpdateMemberResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12r\n\x06Invite\x12-.metalstack.api.v2.TenantServiceInviteRequest\x1a..metalstack.api.v2.TenantServiceInviteResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x83\x01\n\x0cInviteAccept\x12\x33.metalstack.api.v2.TenantServiceInviteAcceptRequest\x1a\x34.metalstack.api.v2.TenantServiceInviteAcceptResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12\x84\x01\n\x0cInviteDelete\x12\x33.metalstack.api.v2.TenantServiceInviteDeleteRequest\x1a\x34.metalstack.api.v2.TenantServiceInviteDeleteResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x01\x12\x81\x01\n\x0bInvitesList\x12\x32.metalstack.api.v2.TenantServiceInvitesListRequest\x1a\x33.metalstack.api.v2.TenantServiceInvitesListResponse\"\t\xc2\xf3\x18\x01\x01\xe0\xf3\x18\x02\x12z\n\tInviteGet\x12\x30.metalstack.api.v2.TenantServiceInviteGetRequest\x1a\x31.metalstack.api.v2.TenantServiceInviteGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x02\x42\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0bTenantProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.tenant_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013TenantProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_TENANT'].fields_by_name['login']._loaded_options = None - _globals['_TENANT'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANT'].fields_by_name['name']._loaded_options = None - _globals['_TENANT'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_TENANT'].fields_by_name['email']._loaded_options = None - _globals['_TENANT'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_TENANT'].fields_by_name['description']._loaded_options = None - _globals['_TENANT'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TENANT'].fields_by_name['avatar_url']._loaded_options = None - _globals['_TENANT'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_TENANTMEMBER'].fields_by_name['id']._loaded_options = None - _globals['_TENANTMEMBER'].fields_by_name['id']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTMEMBER'].fields_by_name['role']._loaded_options = None - _globals['_TENANTMEMBER'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTINVITE'].fields_by_name['role']._loaded_options = None - _globals['_TENANTINVITE'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTQUERY'].fields_by_name['login']._loaded_options = None - _globals['_TENANTQUERY'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTQUERY'].fields_by_name['name']._loaded_options = None - _globals['_TENANTQUERY'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._loaded_options = None - _globals['_TENANTSERVICECREATEREQUEST'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['name']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['email']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['avatar_url']._loaded_options = None - _globals['_TENANTSERVICEUPDATEREQUEST'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_TENANTSERVICEDELETEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEDELETEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEINVITEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEINVITEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEINVITEREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_TENANTSERVICEINVITEREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTSERVICEINVITESLISTREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEINVITESLISTREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICELEAVEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICELEAVEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEINVITEDELETEREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEINVITEDELETEREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['member']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_TENANTSERVICEADDMEMBERREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['login']._loaded_options = None - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['member']._loaded_options = None - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['member']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['role']._loaded_options = None - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST'].fields_by_name['role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TENANTSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Create']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_TENANTSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Get']._serialized_options = b'\302\363\030\004\001\002\003\004\340\363\030\002' - _globals['_TENANTSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Update']._serialized_options = b'\302\363\030\002\001\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['Delete']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Delete']._serialized_options = b'\302\363\030\002\001\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['Leave']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Leave']._serialized_options = b'\302\363\030\001\003\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['AddMember']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['AddMember']._serialized_options = b'\302\363\030\002\001\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['RemoveMember']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['RemoveMember']._serialized_options = b'\302\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['UpdateMember']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['UpdateMember']._serialized_options = b'\302\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['Invite']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['Invite']._serialized_options = b'\302\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['InviteAccept']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['InviteAccept']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['InviteDelete']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['InviteDelete']._serialized_options = b'\302\363\030\001\001\340\363\030\001' - _globals['_TENANTSERVICE'].methods_by_name['InvitesList']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['InvitesList']._serialized_options = b'\302\363\030\001\001\340\363\030\002' - _globals['_TENANTSERVICE'].methods_by_name['InviteGet']._loaded_options = None - _globals['_TENANTSERVICE'].methods_by_name['InviteGet']._serialized_options = b'\330\363\030\002\340\363\030\002' - _globals['_TENANT']._serialized_start=190 - _globals['_TENANT']._serialized_end=464 - _globals['_TENANTMEMBER']._serialized_start=467 - _globals['_TENANTMEMBER']._serialized_end=703 - _globals['_TENANTINVITE']._serialized_start=706 - _globals['_TENANTINVITE']._serialized_end=1085 - _globals['_TENANTSERVICELISTREQUEST']._serialized_start=1087 - _globals['_TENANTSERVICELISTREQUEST']._serialized_end=1167 - _globals['_TENANTQUERY']._serialized_start=1170 - _globals['_TENANTQUERY']._serialized_end=1398 - _globals['_TENANTSERVICEGETREQUEST']._serialized_start=1400 - _globals['_TENANTSERVICEGETREQUEST']._serialized_end=1447 - _globals['_TENANTSERVICECREATEREQUEST']._serialized_start=1450 - _globals['_TENANTSERVICECREATEREQUEST']._serialized_end=1740 - _globals['_TENANTSERVICEUPDATEREQUEST']._serialized_start=1743 - _globals['_TENANTSERVICEUPDATEREQUEST']._serialized_end=2176 - _globals['_TENANTSERVICEDELETEREQUEST']._serialized_start=2178 - _globals['_TENANTSERVICEDELETEREQUEST']._serialized_end=2241 - _globals['_TENANTSERVICEGETRESPONSE']._serialized_start=2244 - _globals['_TENANTSERVICEGETRESPONSE']._serialized_end=2393 - _globals['_TENANTSERVICELISTRESPONSE']._serialized_start=2395 - _globals['_TENANTSERVICELISTRESPONSE']._serialized_end=2475 - _globals['_TENANTSERVICECREATERESPONSE']._serialized_start=2477 - _globals['_TENANTSERVICECREATERESPONSE']._serialized_end=2557 - _globals['_TENANTSERVICEUPDATERESPONSE']._serialized_start=2559 - _globals['_TENANTSERVICEUPDATERESPONSE']._serialized_end=2639 - _globals['_TENANTSERVICEDELETERESPONSE']._serialized_start=2641 - _globals['_TENANTSERVICEDELETERESPONSE']._serialized_end=2721 - _globals['_TENANTSERVICEINVITEREQUEST']._serialized_start=2723 - _globals['_TENANTSERVICEINVITEREQUEST']._serialized_end=2847 - _globals['_TENANTSERVICEINVITERESPONSE']._serialized_start=2849 - _globals['_TENANTSERVICEINVITERESPONSE']._serialized_end=2935 - _globals['_TENANTSERVICEINVITESLISTREQUEST']._serialized_start=2937 - _globals['_TENANTSERVICEINVITESLISTREQUEST']._serialized_end=3005 - _globals['_TENANTSERVICEINVITESLISTRESPONSE']._serialized_start=3007 - _globals['_TENANTSERVICEINVITESLISTRESPONSE']._serialized_end=3100 - _globals['_TENANTSERVICEINVITEGETREQUEST']._serialized_start=3102 - _globals['_TENANTSERVICEINVITEGETREQUEST']._serialized_end=3157 - _globals['_TENANTSERVICEINVITEGETRESPONSE']._serialized_start=3159 - _globals['_TENANTSERVICEINVITEGETRESPONSE']._serialized_end=3248 - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST']._serialized_start=3250 - _globals['_TENANTSERVICEREMOVEMEMBERREQUEST']._serialized_end=3343 - _globals['_TENANTSERVICELEAVEREQUEST']._serialized_start=3345 - _globals['_TENANTSERVICELEAVEREQUEST']._serialized_end=3407 - _globals['_TENANTSERVICELEAVERESPONSE']._serialized_start=3409 - _globals['_TENANTSERVICELEAVERESPONSE']._serialized_end=3437 - _globals['_TENANTSERVICEREMOVEMEMBERRESPONSE']._serialized_start=3439 - _globals['_TENANTSERVICEREMOVEMEMBERRESPONSE']._serialized_end=3544 - _globals['_TENANTSERVICEINVITEACCEPTREQUEST']._serialized_start=3546 - _globals['_TENANTSERVICEINVITEACCEPTREQUEST']._serialized_end=3604 - _globals['_TENANTSERVICEINVITEACCEPTRESPONSE']._serialized_start=3606 - _globals['_TENANTSERVICEINVITEACCEPTRESPONSE']._serialized_end=3698 - _globals['_TENANTSERVICEINVITEDELETEREQUEST']._serialized_start=3700 - _globals['_TENANTSERVICEINVITEDELETEREQUEST']._serialized_end=3793 - _globals['_TENANTSERVICEINVITEDELETERESPONSE']._serialized_start=3795 - _globals['_TENANTSERVICEINVITEDELETERESPONSE']._serialized_end=3830 - _globals['_TENANTSERVICEADDMEMBERREQUEST']._serialized_start=3833 - _globals['_TENANTSERVICEADDMEMBERREQUEST']._serialized_end=3997 - _globals['_TENANTSERVICEADDMEMBERRESPONSE']._serialized_start=3999 - _globals['_TENANTSERVICEADDMEMBERRESPONSE']._serialized_end=4101 - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST']._serialized_start=4104 - _globals['_TENANTSERVICEUPDATEMEMBERREQUEST']._serialized_end=4271 - _globals['_TENANTSERVICEUPDATEMEMBERRESPONSE']._serialized_start=4273 - _globals['_TENANTSERVICEUPDATEMEMBERRESPONSE']._serialized_end=4378 - _globals['_TENANTSERVICE']._serialized_start=4381 - _globals['_TENANTSERVICE']._serialized_end=6114 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/tenant_pb2.pyi b/python/metalstack/api/v2/tenant_pb2.pyi deleted file mode 100644 index 4f008c9e..00000000 --- a/python/metalstack/api/v2/tenant_pb2.pyi +++ /dev/null @@ -1,281 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Tenant(_message.Message): - __slots__ = ("login", "meta", "name", "email", "description", "avatar_url", "created_by") - LOGIN_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - CREATED_BY_FIELD_NUMBER: _ClassVar[int] - login: str - meta: _common_pb2.Meta - name: str - email: str - description: str - avatar_url: str - created_by: str - def __init__(self, login: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., name: _Optional[str] = ..., email: _Optional[str] = ..., description: _Optional[str] = ..., avatar_url: _Optional[str] = ..., created_by: _Optional[str] = ...) -> None: ... - -class TenantMember(_message.Message): - __slots__ = ("id", "role", "projects", "created_at", "meta") - ID_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - PROJECTS_FIELD_NUMBER: _ClassVar[int] - CREATED_AT_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - id: str - role: _common_pb2.TenantRole - projects: _containers.RepeatedScalarFieldContainer[str] - created_at: _timestamp_pb2.Timestamp - meta: _common_pb2.Meta - def __init__(self, id: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ..., projects: _Optional[_Iterable[str]] = ..., created_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ...) -> None: ... - -class TenantInvite(_message.Message): - __slots__ = ("secret", "target_tenant", "role", "joined", "target_tenant_name", "tenant", "tenant_name", "expires_at", "joined_at") - SECRET_FIELD_NUMBER: _ClassVar[int] - TARGET_TENANT_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - JOINED_FIELD_NUMBER: _ClassVar[int] - TARGET_TENANT_NAME_FIELD_NUMBER: _ClassVar[int] - TENANT_FIELD_NUMBER: _ClassVar[int] - TENANT_NAME_FIELD_NUMBER: _ClassVar[int] - EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] - JOINED_AT_FIELD_NUMBER: _ClassVar[int] - secret: str - target_tenant: str - role: _common_pb2.TenantRole - joined: bool - target_tenant_name: str - tenant: str - tenant_name: str - expires_at: _timestamp_pb2.Timestamp - joined_at: _timestamp_pb2.Timestamp - def __init__(self, secret: _Optional[str] = ..., target_tenant: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ..., joined: _Optional[bool] = ..., target_tenant_name: _Optional[str] = ..., tenant: _Optional[str] = ..., tenant_name: _Optional[str] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., joined_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ... - -class TenantServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: TenantQuery - def __init__(self, query: _Optional[_Union[TenantQuery, _Mapping]] = ...) -> None: ... - -class TenantQuery(_message.Message): - __slots__ = ("login", "name", "labels", "paging") - LOGIN_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - PAGING_FIELD_NUMBER: _ClassVar[int] - login: str - name: str - labels: _common_pb2.Labels - paging: _common_pb2.Paging - def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., paging: _Optional[_Union[_common_pb2.Paging, _Mapping]] = ...) -> None: ... - -class TenantServiceGetRequest(_message.Message): - __slots__ = ("login",) - LOGIN_FIELD_NUMBER: _ClassVar[int] - login: str - def __init__(self, login: _Optional[str] = ...) -> None: ... - -class TenantServiceCreateRequest(_message.Message): - __slots__ = ("name", "description", "email", "avatar_url", "labels") - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - name: str - description: str - email: str - avatar_url: str - labels: _common_pb2.Labels - def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., email: _Optional[str] = ..., avatar_url: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class TenantServiceUpdateRequest(_message.Message): - __slots__ = ("login", "update_meta", "name", "email", "description", "avatar_url", "labels") - LOGIN_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - login: str - update_meta: _common_pb2.UpdateMeta - name: str - email: str - description: str - avatar_url: str - labels: _common_pb2.UpdateLabels - def __init__(self, login: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., name: _Optional[str] = ..., email: _Optional[str] = ..., description: _Optional[str] = ..., avatar_url: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class TenantServiceDeleteRequest(_message.Message): - __slots__ = ("login",) - LOGIN_FIELD_NUMBER: _ClassVar[int] - login: str - def __init__(self, login: _Optional[str] = ...) -> None: ... - -class TenantServiceGetResponse(_message.Message): - __slots__ = ("tenant", "tenant_members") - TENANT_FIELD_NUMBER: _ClassVar[int] - TENANT_MEMBERS_FIELD_NUMBER: _ClassVar[int] - tenant: Tenant - tenant_members: _containers.RepeatedCompositeFieldContainer[TenantMember] - def __init__(self, tenant: _Optional[_Union[Tenant, _Mapping]] = ..., tenant_members: _Optional[_Iterable[_Union[TenantMember, _Mapping]]] = ...) -> None: ... - -class TenantServiceListResponse(_message.Message): - __slots__ = ("tenants",) - TENANTS_FIELD_NUMBER: _ClassVar[int] - tenants: _containers.RepeatedCompositeFieldContainer[Tenant] - def __init__(self, tenants: _Optional[_Iterable[_Union[Tenant, _Mapping]]] = ...) -> None: ... - -class TenantServiceCreateResponse(_message.Message): - __slots__ = ("tenant",) - TENANT_FIELD_NUMBER: _ClassVar[int] - tenant: Tenant - def __init__(self, tenant: _Optional[_Union[Tenant, _Mapping]] = ...) -> None: ... - -class TenantServiceUpdateResponse(_message.Message): - __slots__ = ("tenant",) - TENANT_FIELD_NUMBER: _ClassVar[int] - tenant: Tenant - def __init__(self, tenant: _Optional[_Union[Tenant, _Mapping]] = ...) -> None: ... - -class TenantServiceDeleteResponse(_message.Message): - __slots__ = ("tenant",) - TENANT_FIELD_NUMBER: _ClassVar[int] - tenant: Tenant - def __init__(self, tenant: _Optional[_Union[Tenant, _Mapping]] = ...) -> None: ... - -class TenantServiceInviteRequest(_message.Message): - __slots__ = ("login", "role") - LOGIN_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - login: str - role: _common_pb2.TenantRole - def __init__(self, login: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - -class TenantServiceInviteResponse(_message.Message): - __slots__ = ("invite",) - INVITE_FIELD_NUMBER: _ClassVar[int] - invite: TenantInvite - def __init__(self, invite: _Optional[_Union[TenantInvite, _Mapping]] = ...) -> None: ... - -class TenantServiceInvitesListRequest(_message.Message): - __slots__ = ("login",) - LOGIN_FIELD_NUMBER: _ClassVar[int] - login: str - def __init__(self, login: _Optional[str] = ...) -> None: ... - -class TenantServiceInvitesListResponse(_message.Message): - __slots__ = ("invites",) - INVITES_FIELD_NUMBER: _ClassVar[int] - invites: _containers.RepeatedCompositeFieldContainer[TenantInvite] - def __init__(self, invites: _Optional[_Iterable[_Union[TenantInvite, _Mapping]]] = ...) -> None: ... - -class TenantServiceInviteGetRequest(_message.Message): - __slots__ = ("secret",) - SECRET_FIELD_NUMBER: _ClassVar[int] - secret: str - def __init__(self, secret: _Optional[str] = ...) -> None: ... - -class TenantServiceInviteGetResponse(_message.Message): - __slots__ = ("invite",) - INVITE_FIELD_NUMBER: _ClassVar[int] - invite: TenantInvite - def __init__(self, invite: _Optional[_Union[TenantInvite, _Mapping]] = ...) -> None: ... - -class TenantServiceRemoveMemberRequest(_message.Message): - __slots__ = ("login", "member") - LOGIN_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - login: str - member: str - def __init__(self, login: _Optional[str] = ..., member: _Optional[str] = ...) -> None: ... - -class TenantServiceLeaveRequest(_message.Message): - __slots__ = ("login",) - LOGIN_FIELD_NUMBER: _ClassVar[int] - login: str - def __init__(self, login: _Optional[str] = ...) -> None: ... - -class TenantServiceLeaveResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TenantServiceRemoveMemberResponse(_message.Message): - __slots__ = ("tenant_member",) - TENANT_MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant_member: TenantMember - def __init__(self, tenant_member: _Optional[_Union[TenantMember, _Mapping]] = ...) -> None: ... - -class TenantServiceInviteAcceptRequest(_message.Message): - __slots__ = ("secret",) - SECRET_FIELD_NUMBER: _ClassVar[int] - secret: str - def __init__(self, secret: _Optional[str] = ...) -> None: ... - -class TenantServiceInviteAcceptResponse(_message.Message): - __slots__ = ("tenant", "tenant_name") - TENANT_FIELD_NUMBER: _ClassVar[int] - TENANT_NAME_FIELD_NUMBER: _ClassVar[int] - tenant: str - tenant_name: str - def __init__(self, tenant: _Optional[str] = ..., tenant_name: _Optional[str] = ...) -> None: ... - -class TenantServiceInviteDeleteRequest(_message.Message): - __slots__ = ("login", "secret") - LOGIN_FIELD_NUMBER: _ClassVar[int] - SECRET_FIELD_NUMBER: _ClassVar[int] - login: str - secret: str - def __init__(self, login: _Optional[str] = ..., secret: _Optional[str] = ...) -> None: ... - -class TenantServiceInviteDeleteResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TenantServiceAddMemberRequest(_message.Message): - __slots__ = ("login", "member", "role") - LOGIN_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - login: str - member: str - role: _common_pb2.TenantRole - def __init__(self, login: _Optional[str] = ..., member: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - -class TenantServiceAddMemberResponse(_message.Message): - __slots__ = ("tenant_member",) - TENANT_MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant_member: TenantMember - def __init__(self, tenant_member: _Optional[_Union[TenantMember, _Mapping]] = ...) -> None: ... - -class TenantServiceUpdateMemberRequest(_message.Message): - __slots__ = ("login", "member", "role") - LOGIN_FIELD_NUMBER: _ClassVar[int] - MEMBER_FIELD_NUMBER: _ClassVar[int] - ROLE_FIELD_NUMBER: _ClassVar[int] - login: str - member: str - role: _common_pb2.TenantRole - def __init__(self, login: _Optional[str] = ..., member: _Optional[str] = ..., role: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - -class TenantServiceUpdateMemberResponse(_message.Message): - __slots__ = ("tenant_member",) - TENANT_MEMBER_FIELD_NUMBER: _ClassVar[int] - tenant_member: TenantMember - def __init__(self, tenant_member: _Optional[_Union[TenantMember, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/token_connect.py b/python/metalstack/api/v2/token_connect.py index bb4bdbd0..6815b1e7 100644 --- a/python/metalstack/api/v2/token_connect.py +++ b/python/metalstack/api/v2/token_connect.py @@ -1,44 +1,60 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/token.proto +# Generated from metalstack/api/v2/token.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.token_pb2 as metalstack_dot_api_dot_v2_dot_token__pb2 + +from .token_pb import TokenServiceCreateRequest, TokenServiceCreateResponse, TokenServiceGetRequest, TokenServiceGetResponse, TokenServiceListRequest, TokenServiceListResponse, TokenServiceRefreshRequest, TokenServiceRefreshResponse, TokenServiceRevokeRequest, TokenServiceRevokeResponse, TokenServiceUpdateRequest, TokenServiceUpdateResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class TokenService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: TokenServiceGetRequest, ctx: RequestContext[TokenServiceGetRequest, TokenServiceGetResponse]) -> TokenServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def create(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def create(self, request: TokenServiceCreateRequest, ctx: RequestContext[TokenServiceCreateRequest, TokenServiceCreateResponse]) -> TokenServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def update(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update(self, request: TokenServiceUpdateRequest, ctx: RequestContext[TokenServiceUpdateRequest, TokenServiceUpdateResponse]) -> TokenServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def list(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def list(self, request: TokenServiceListRequest, ctx: RequestContext[TokenServiceListRequest, TokenServiceListResponse]) -> TokenServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def revoke(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def revoke(self, request: TokenServiceRevokeRequest, ctx: RequestContext[TokenServiceRevokeRequest, TokenServiceRevokeResponse]) -> TokenServiceRevokeResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def refresh(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def refresh(self, request: TokenServiceRefreshRequest, ctx: RequestContext[TokenServiceRefreshRequest, TokenServiceRefreshResponse]) -> TokenServiceRefreshResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TokenServiceASGIApplication(ConnectASGIApplication[TokenService]): - def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TokenService | AsyncGenerator[TokenService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -46,8 +62,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Get", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse, + input=TokenServiceGetRequest, + output=TokenServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -56,8 +72,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Create", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.create, @@ -66,8 +82,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Update", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse, + input=TokenServiceUpdateRequest, + output=TokenServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.update, @@ -76,8 +92,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="List", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.list, @@ -86,8 +102,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Revoke", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.revoke, @@ -96,8 +112,8 @@ def __init__(self, service: TokenService | AsyncGenerator[TokenService], *, inte method=MethodInfo( name="Refresh", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse, + input=TokenServiceRefreshRequest, + output=TokenServiceRefreshResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.refresh, @@ -118,18 +134,18 @@ def path(self) -> str: class TokenServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, + request: TokenServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse: + ) -> TokenServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse, + input=TokenServiceGetRequest, + output=TokenServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -138,18 +154,18 @@ async def get( async def create( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, + request: TokenServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse: + ) -> TokenServiceCreateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -158,18 +174,18 @@ async def create( async def update( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, + request: TokenServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse: + ) -> TokenServiceUpdateResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse, + input=TokenServiceUpdateRequest, + output=TokenServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -178,18 +194,18 @@ async def update( async def list( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, + request: TokenServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse: + ) -> TokenServiceListResponse: return await self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -198,18 +214,18 @@ async def list( async def revoke( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, + request: TokenServiceRevokeRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: + ) -> TokenServiceRevokeResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Revoke", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -218,53 +234,61 @@ async def revoke( async def refresh( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, + request: TokenServiceRefreshRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse: + ) -> TokenServiceRefreshResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Refresh", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse, + input=TokenServiceRefreshRequest, + output=TokenServiceRefreshResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class TokenServiceSync(Protocol): + def get(self, request: TokenServiceGetRequest, ctx: RequestContext[TokenServiceGetRequest, TokenServiceGetResponse]) -> TokenServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def create(self, request: TokenServiceCreateRequest, ctx: RequestContext[TokenServiceCreateRequest, TokenServiceCreateResponse]) -> TokenServiceCreateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def update(self, request: TokenServiceUpdateRequest, ctx: RequestContext[TokenServiceUpdateRequest, TokenServiceUpdateResponse]) -> TokenServiceUpdateResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def list(self, request: TokenServiceListRequest, ctx: RequestContext[TokenServiceListRequest, TokenServiceListResponse]) -> TokenServiceListResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def revoke(self, request: TokenServiceRevokeRequest, ctx: RequestContext[TokenServiceRevokeRequest, TokenServiceRevokeResponse]) -> TokenServiceRevokeResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class TokenServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def create(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def update(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def list(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def revoke(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def refresh(self, request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def refresh(self, request: TokenServiceRefreshRequest, ctx: RequestContext[TokenServiceRefreshRequest, TokenServiceRefreshResponse]) -> TokenServiceRefreshResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class TokenServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: TokenServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: TokenServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.TokenService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse, + input=TokenServiceGetRequest, + output=TokenServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -273,8 +297,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Create", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.create, @@ -283,8 +307,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Update", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse, + input=TokenServiceUpdateRequest, + output=TokenServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.update, @@ -293,8 +317,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="List", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.list, @@ -303,8 +327,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Revoke", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.revoke, @@ -313,8 +337,8 @@ def __init__(self, service: TokenServiceSync, interceptors: Iterable[Interceptor method=MethodInfo( name="Refresh", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse, + input=TokenServiceRefreshRequest, + output=TokenServiceRefreshResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.refresh, @@ -335,122 +359,115 @@ def path(self) -> str: class TokenServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, + request: TokenServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse: + ) -> TokenServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceGetResponse, + input=TokenServiceGetRequest, + output=TokenServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def create( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, + request: TokenServiceCreateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse: + ) -> TokenServiceCreateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Create", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceCreateResponse, + input=TokenServiceCreateRequest, + output=TokenServiceCreateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def update( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, + request: TokenServiceUpdateRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse: + ) -> TokenServiceUpdateResponse: return self.execute_unary( request=request, method=MethodInfo( name="Update", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceUpdateResponse, + input=TokenServiceUpdateRequest, + output=TokenServiceUpdateResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def list( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, + request: TokenServiceListRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse: + ) -> TokenServiceListResponse: return self.execute_unary( request=request, method=MethodInfo( name="List", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceListResponse, + input=TokenServiceListRequest, + output=TokenServiceListResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def revoke( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, + request: TokenServiceRevokeRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse: + ) -> TokenServiceRevokeResponse: return self.execute_unary( request=request, method=MethodInfo( name="Revoke", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRevokeResponse, + input=TokenServiceRevokeRequest, + output=TokenServiceRevokeResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def refresh( self, - request: metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, + request: TokenServiceRefreshRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse: + ) -> TokenServiceRefreshResponse: return self.execute_unary( request=request, method=MethodInfo( name="Refresh", service_name="metalstack.api.v2.TokenService", - input=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshRequest, - output=metalstack_dot_api_dot_v2_dot_token__pb2.TokenServiceRefreshResponse, + input=TokenServiceRefreshRequest, + output=TokenServiceRefreshResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/token_pb.py b/python/metalstack/api/v2/token_pb.py new file mode 100644 index 00000000..41213346 --- /dev/null +++ b/python/metalstack/api/v2/token_pb.py @@ -0,0 +1,858 @@ +# Generated from metalstack/api/v2/token.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Enum, Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from .common_pb import AdminRole, InfraRole, Labels, MachineRole, Meta, ProjectRole, TenantRole, UpdateLabels, UpdateMeta + + +_TokenFields: TypeAlias = Literal["uuid", "user", "meta", "description", "permissions", "expires", "issued_at", "token_type", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles"] + +class Token(Message[_TokenFields]): + """ + Token generates a jwt authentication token to access the api + + There are two different types of tokens, api- and user- tokens + + A user token is used to authenticate end user requests for example from a cli. + The configured roles in a user token are expanded in the api server + based on the memberships in other projects and tenants based on the role granted there. + User tokens will never contain permissions. + Permissions are always derived from the tenant and project roles and memberships. + + The api token should be used to authenticate services. + In contrast to a user token, the api token permissions and roles apply as configured during the token create process. + + Message level validation, can be developed using https://protovalidate.com/playground + + ```proto + message metalstack.api.v2.Token + ``` + + Attributes: + uuid: + Uuid of the jwt token, used to reference it by revoke + + ```proto + string uuid = 1; + ``` + user: + User who created this token + + ```proto + string user = 2; + ``` + meta: + Meta for this token + + ```proto + optional metalstack.api.v2.Meta meta = 3; + ``` + description: + Description is a user given description of this token. + + ```proto + string description = 4; + ``` + permissions: + Permissions is a list of service methods this token can be used for + + ```proto + repeated metalstack.api.v2.MethodPermission permissions = 5; + ``` + expires: + Expires gives the date in the future after which this token can not be used anymore + + ```proto + optional google.protobuf.Timestamp expires = 6; + ``` + issued_at: + IssuedAt gives the date when this token was created + + ```proto + optional google.protobuf.Timestamp issued_at = 7; + ``` + token_type: + TokenType describes the type of this token + + ```proto + metalstack.api.v2.TokenType token_type = 8; + ``` + project_roles: + ProjectRoles associates a project id with the corresponding role of the token owner + + ```proto + map project_roles = 9; + ``` + tenant_roles: + TenantRoles associates a tenant id with the corresponding role of the token owner + + ```proto + map tenant_roles = 10; + ``` + admin_role: + AdminRole defines the admin role of the token owner + + ```proto + optional metalstack.api.v2.AdminRole admin_role = 11; + ``` + infra_role: + InfraRole defines the infrastructure role of the token owner + + ```proto + optional metalstack.api.v2.InfraRole infra_role = 12; + ``` + machine_roles: + MachineRoles associates a machine uuid with the corresponding role of the token owner + TODO: decide if we need this map from machine.uuid->role, we could instead use the subject in the token instead + + ```proto + map machine_roles = 13; + ``` + """ + + __slots__ = ("uuid", "user", "meta", "description", "permissions", "expires", "issued_at", "token_type", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + user: str = "", + meta: Meta | None = None, + description: str = "", + permissions: list[MethodPermission] | None = None, + expires: Timestamp | None = None, + issued_at: Timestamp | None = None, + token_type: TokenType | None = None, + project_roles: dict[str, ProjectRole] | None = None, + tenant_roles: dict[str, TenantRole] | None = None, + admin_role: AdminRole | None = None, + infra_role: InfraRole | None = None, + machine_roles: dict[str, MachineRole] | None = None, + ) -> None: + pass + + uuid: str + user: str + meta: Meta | None + description: str + permissions: list[MethodPermission] + expires: Timestamp | None + issued_at: Timestamp | None + token_type: TokenType + project_roles: dict[str, ProjectRole] + tenant_roles: dict[str, TenantRole] + admin_role: AdminRole + infra_role: InfraRole + machine_roles: dict[str, MachineRole] + +_TokenServiceCreateRequestFields: TypeAlias = Literal["description", "permissions", "expires", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels"] + +class TokenServiceCreateRequest(Message[_TokenServiceCreateRequestFields]): + """ + TokenServiceCreateRequest is the request payload to create a token + + ```proto + message metalstack.api.v2.TokenServiceCreateRequest + ``` + + Attributes: + description: + Description of the token + + ```proto + string description = 1; + ``` + permissions: + Permissions is a list of service methods this token can be used for + + ```proto + repeated metalstack.api.v2.MethodPermission permissions = 2; + ``` + expires: + Expires gives the duration since now, after which this token can not be used anymore + + ```proto + optional google.protobuf.Duration expires = 3; + ``` + project_roles: + ProjectRoles associates a project id with the corresponding role of the token owner + + ```proto + map project_roles = 4; + ``` + tenant_roles: + TenantRoles associates a tenant id with the corresponding role of the token owner + + ```proto + map tenant_roles = 5; + ``` + admin_role: + AdminRole defines the admin role of the token owner + + ```proto + optional metalstack.api.v2.AdminRole admin_role = 6; + ``` + infra_role: + InfraRole defines the infrastructure role of the token owner + + ```proto + optional metalstack.api.v2.InfraRole infra_role = 7; + ``` + machine_roles: + MachineRoles associates a machine uuid with the corresponding role of the token owner + + ```proto + map machine_roles = 8; + ``` + labels: + Labels on this token + + ```proto + optional metalstack.api.v2.Labels labels = 9; + ``` + """ + + __slots__ = ("description", "permissions", "expires", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + description: str = "", + permissions: list[MethodPermission] | None = None, + expires: Duration | None = None, + project_roles: dict[str, ProjectRole] | None = None, + tenant_roles: dict[str, TenantRole] | None = None, + admin_role: AdminRole | None = None, + infra_role: InfraRole | None = None, + machine_roles: dict[str, MachineRole] | None = None, + labels: Labels | None = None, + ) -> None: + pass + + description: str + permissions: list[MethodPermission] + expires: Duration | None + project_roles: dict[str, ProjectRole] + tenant_roles: dict[str, TenantRole] + admin_role: AdminRole + infra_role: InfraRole + machine_roles: dict[str, MachineRole] + labels: Labels | None + +_MethodPermissionFields: TypeAlias = Literal["subject", "methods"] + +class MethodPermission(Message[_MethodPermissionFields]): + """ + MethodPermission is a mapping from a subject/project to a service method + + ```proto + message metalstack.api.v2.MethodPermission + ``` + + Attributes: + subject: + Subject maybe either the project or the tenant + for which the methods should be allowed + + asterisk (*) can be specified to match any subject + empty string ("") can be specified for requests that do not require a subject, e.g. partition list + otherwise either a projectid or a tenant login should be specified + + ```proto + string subject = 1; + ``` + methods: + Methods which should be accessible + + ```proto + repeated string methods = 2; + ``` + """ + + __slots__ = ("subject", "methods") + + if TYPE_CHECKING: + + def __init__( + self, + *, + subject: str = "", + methods: list[str] | None = None, + ) -> None: + pass + + subject: str + methods: list[str] + +_TokenServiceCreateResponseFields: TypeAlias = Literal["token", "secret"] + +class TokenServiceCreateResponse(Message[_TokenServiceCreateResponseFields]): + """ + TokenServiceCreateResponse is the response payload of a token create request + + ```proto + message metalstack.api.v2.TokenServiceCreateResponse + ``` + + Attributes: + token: + Token which was created + + ```proto + optional metalstack.api.v2.Token token = 1; + ``` + secret: + Secret is the body of the JWT token, should be used in API requests as bearer token + + ```proto + string secret = 2; + ``` + """ + + __slots__ = ("token", "secret") + + if TYPE_CHECKING: + + def __init__( + self, + *, + token: Token | None = None, + secret: str = "", + ) -> None: + pass + + token: Token | None + secret: str + +_TokenServiceListRequestFields: TypeAlias = Literal["query"] + +class TokenServiceListRequest(Message[_TokenServiceListRequestFields]): + """ + TokenServiceListRequest is the request payload to list tokens + + ```proto + message metalstack.api.v2.TokenServiceListRequest + ``` + + Attributes: + query: + Query for tokens + + ```proto + optional metalstack.api.v2.TokenQuery query = 1; + ``` + """ + + __slots__ = ("query",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + query: TokenQuery | None = None, + ) -> None: + pass + + query: TokenQuery | None + +_TokenServiceListResponseFields: TypeAlias = Literal["tokens"] + +class TokenServiceListResponse(Message[_TokenServiceListResponseFields]): + """ + TokenServiceListResponse is the response payload of a token list request + + ```proto + message metalstack.api.v2.TokenServiceListResponse + ``` + + Attributes: + tokens: + Tokens is a list of tokens without the secrets + + ```proto + repeated metalstack.api.v2.Token tokens = 1; + ``` + """ + + __slots__ = ("tokens",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + tokens: list[Token] | None = None, + ) -> None: + pass + + tokens: list[Token] + +_TokenServiceRevokeRequestFields: TypeAlias = Literal["uuid"] + +class TokenServiceRevokeRequest(Message[_TokenServiceRevokeRequestFields]): + """ + TokenServiceRevokeRequest is the request payload of a token revoke request + + ```proto + message metalstack.api.v2.TokenServiceRevokeRequest + ``` + + Attributes: + uuid: + Uuid of the token to revoke + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_TokenServiceRevokeResponseFields: TypeAlias = NoReturn + +class TokenServiceRevokeResponse(Message[_TokenServiceRevokeResponseFields]): + """ + TokenServiceRevokeResponse is the response payload of a token revoke request + + ```proto + message metalstack.api.v2.TokenServiceRevokeResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TokenServiceUpdateRequestFields: TypeAlias = Literal["uuid", "update_meta", "description", "permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels"] + +class TokenServiceUpdateRequest(Message[_TokenServiceUpdateRequestFields]): + """ + TokenServiceUpdateRequest is the request payload of a token update request + + ```proto + message metalstack.api.v2.TokenServiceUpdateRequest + ``` + + Attributes: + uuid: + Uuid of the token to update + + ```proto + string uuid = 1; + ``` + update_meta: + UpdateMeta contains the timestamp and strategy to be used in this update request + TokenUpdate is not guarded with optlock in the backend + + ```proto + optional metalstack.api.v2.UpdateMeta update_meta = 2; + ``` + description: + Description is a user given description of this token. + + ```proto + optional string description = 3; + ``` + permissions: + Permissions is a list of service methods this token can be used for + + ```proto + repeated metalstack.api.v2.MethodPermission permissions = 4; + ``` + project_roles: + ProjectRoles associates a project id with the corresponding role of the token owner + + ```proto + map project_roles = 5; + ``` + tenant_roles: + TenantRoles associates a tenant id with the corresponding role of the token owner + + ```proto + map tenant_roles = 6; + ``` + admin_role: + AdminRole defines the admin role of the token owner + + ```proto + optional metalstack.api.v2.AdminRole admin_role = 7; + ``` + infra_role: + InfraRole defines the infrastructure role of the token owner + + ```proto + optional metalstack.api.v2.InfraRole infra_role = 8; + ``` + machine_roles: + MachineRoles associates a machine uuid with the corresponding role of the token owner + + ```proto + map machine_roles = 9; + ``` + labels: + Labels on this token + + ```proto + optional metalstack.api.v2.UpdateLabels labels = 10; + ``` + """ + + __slots__ = ("uuid", "update_meta", "description", "permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + update_meta: UpdateMeta | None = None, + description: str | None = None, + permissions: list[MethodPermission] | None = None, + project_roles: dict[str, ProjectRole] | None = None, + tenant_roles: dict[str, TenantRole] | None = None, + admin_role: AdminRole | None = None, + infra_role: InfraRole | None = None, + machine_roles: dict[str, MachineRole] | None = None, + labels: UpdateLabels | None = None, + ) -> None: + pass + + uuid: str + update_meta: UpdateMeta | None + description: str + permissions: list[MethodPermission] + project_roles: dict[str, ProjectRole] + tenant_roles: dict[str, TenantRole] + admin_role: AdminRole + infra_role: InfraRole + machine_roles: dict[str, MachineRole] + labels: UpdateLabels | None + +_TokenServiceUpdateResponseFields: TypeAlias = Literal["token"] + +class TokenServiceUpdateResponse(Message[_TokenServiceUpdateResponseFields]): + """ + TokenServiceUpdateResponse is the response payload of a token update request + + ```proto + message metalstack.api.v2.TokenServiceUpdateResponse + ``` + + Attributes: + token: + Token is the updated token + + ```proto + optional metalstack.api.v2.Token token = 1; + ``` + """ + + __slots__ = ("token",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + token: Token | None = None, + ) -> None: + pass + + token: Token | None + +_TokenServiceGetRequestFields: TypeAlias = Literal["uuid"] + +class TokenServiceGetRequest(Message[_TokenServiceGetRequestFields]): + """ + TokenServiceGetRequest is the request payload of a token get request + + ```proto + message metalstack.api.v2.TokenServiceGetRequest + ``` + + Attributes: + uuid: + Uuid of the token to get + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_TokenServiceGetResponseFields: TypeAlias = Literal["token"] + +class TokenServiceGetResponse(Message[_TokenServiceGetResponseFields]): + """ + TokenServiceGetResponse is the response payload of a token get request + + ```proto + message metalstack.api.v2.TokenServiceGetResponse + ``` + + Attributes: + token: + Token is the token + + ```proto + optional metalstack.api.v2.Token token = 1; + ``` + """ + + __slots__ = ("token",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + token: Token | None = None, + ) -> None: + pass + + token: Token | None + +_TokenServiceRefreshRequestFields: TypeAlias = NoReturn + +class TokenServiceRefreshRequest(Message[_TokenServiceRefreshRequestFields]): + """ + TokenServiceRefreshRequest is the request payload of a token refresh request + Permissions, Roles and Expiration duration and all other properties are inherited from the calling token. + The expiration duration will be calculated from the existing token (exp - iat) + + ```proto + message metalstack.api.v2.TokenServiceRefreshRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_TokenServiceRefreshResponseFields: TypeAlias = Literal["token", "secret"] + +class TokenServiceRefreshResponse(Message[_TokenServiceRefreshResponseFields]): + """ + TokenServiceRefreshResponse is the response payload of a token refresh request + + ```proto + message metalstack.api.v2.TokenServiceRefreshResponse + ``` + + Attributes: + token: + Token which was refreshed + + ```proto + optional metalstack.api.v2.Token token = 1; + ``` + secret: + Secret is the body of the JWT token, should be used in API requests as bearer token + + ```proto + string secret = 2; + ``` + """ + + __slots__ = ("token", "secret") + + if TYPE_CHECKING: + + def __init__( + self, + *, + token: Token | None = None, + secret: str = "", + ) -> None: + pass + + token: Token | None + secret: str + +_TokenQueryFields: TypeAlias = Literal["uuid", "user", "description", "labels", "token_type"] + +class TokenQuery(Message[_TokenQueryFields]): + """ + TokenQuery is used to search tokens + + ```proto + message metalstack.api.v2.TokenQuery + ``` + + Attributes: + uuid: + UUID of the token to get + + ```proto + optional string uuid = 1; + ``` + user: + Name of the token user to query + Only useful for admins. + + ```proto + optional string user = 2; + ``` + description: + Description of the token to query + + ```proto + optional string description = 3; + ``` + labels: + Labels lists only tokens containing the given labels + + ```proto + optional metalstack.api.v2.Labels labels = 4; + ``` + token_type: + Token type of the token to query + + ```proto + optional metalstack.api.v2.TokenType token_type = 5; + ``` + """ + + __slots__ = ("uuid", "user", "description", "labels", "token_type") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str | None = None, + user: str | None = None, + description: str | None = None, + labels: Labels | None = None, + token_type: TokenType | None = None, + ) -> None: + pass + + uuid: str + user: str + description: str + labels: Labels | None + token_type: TokenType + +class TokenType(Enum): + """ + TokenType specifies different use cases of tokens + + ```proto + enum metalstack.api.v2.TokenType + ``` + + Attributes: + UNSPECIFIED: + TOKEN_TYPE_UNSPECIFIED is not specified + + ```proto + TOKEN_TYPE_UNSPECIFIED = 0 + ``` + API: + TOKEN_TYPE_API is a token for api usage + + ```proto + TOKEN_TYPE_API = 1 + ``` + USER: + TOKEN_TYPE_USER is a token to access the api with cli, a web application or other user induced actions. + + ```proto + TOKEN_TYPE_USER = 2 + ``` + """ + + UNSPECIFIED = 0 + API = 1 + USER = 2 + + +_DESC = file_desc( + b'\n\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xc2\t\n\x05Token\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1f\n\x04user\x18\x02 \x01(\tR\x04userB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01\x12+\n\x04meta\x18\x03 \x01(\x0b2\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0bdescription\x18\x04 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12P\n\x0bpermissions\x18\x05 \x03(\x0b2#.metalstack.api.v2.MethodPermissionR\x0bpermissionsB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03\x124\n\x07expires\x18\x06 \x01(\x0b2\x1a.google.protobuf.TimestampR\x07expires\x127\n\tissued_at\x18\x07 \x01(\x0b2\x1a.google.protobuf.TimestampR\x08issuedAt\x12E\n\ntoken_type\x18\x08 \x01(\x0e2\x1c.metalstack.api.v2.TokenTypeR\ttokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12j\n\rproject_roles\x18\t \x03(\x0b2*.metalstack.api.v2.Token.ProjectRolesEntryR\x0cprojectRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12g\n\x0ctenant_roles\x18\n \x03(\x0b2).metalstack.api.v2.Token.TenantRolesEntryR\x0btenantRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12J\n\nadmin_role\x18\x0b \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleH\x00R\tadminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12J\n\ninfra_role\x18\x0c \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleH\x01R\tinfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12j\n\rmachine_roles\x18\r \x03(\x0b2*.metalstack.api.v2.Token.MachineRolesEntryR\x0cmachineRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x123\n\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01B\r\n\x0b_admin_roleB\r\n\x0b_infra_role"\xeb\x08\n\x19TokenServiceCreateRequest\x12-\n\x0bdescription\x18\x01 \x01(\tR\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12O\n\x0bpermissions\x18\x02 \x03(\x0b2#.metalstack.api.v2.MethodPermissionR\x0bpermissionsB\x08\xbaH\x05\x92\x01\x02\x10d\x12G\n\x07expires\x18\x03 \x01(\x0b2\x19.google.protobuf.DurationR\x07expiresB\x12\xbaH\x0f\xaa\x01\x0c\x1a\x05\x08\x81\xe7\x84\x0f2\x03\x08\xd8\x04\x12~\n\rproject_roles\x18\x04 \x03(\x0b2>.metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntryR\x0cprojectRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12{\n\x0ctenant_roles\x18\x05 \x03(\x0b2=.metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntryR\x0btenantRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12J\n\nadmin_role\x18\x06 \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleH\x00R\tadminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12J\n\ninfra_role\x18\x07 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleH\x01R\tinfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12~\n\rmachine_roles\x18\x08 \x03(\x0b2>.metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntryR\x0cmachineRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x121\n\x06labels\x18\t \x01(\x0b2\x19.metalstack.api.v2.LabelsR\x06labels\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x123\n\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01B\r\n\x0b_admin_roleB\r\n\x0b_infra_role"[\n\x10MethodPermission\x12"\n\x07subject\x18\x01 \x01(\tR\x07subjectB\x08\xbaH\x05r\x03\x18\x80\x02\x12#\n\x07methods\x18\x02 \x03(\tR\x07methodsB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret"N\n\x17TokenServiceListRequest\x123\n\x05query\x18\x01 \x01(\x0b2\x1d.metalstack.api.v2.TokenQueryR\x05query"L\n\x18TokenServiceListResponse\x120\n\x06tokens\x18\x01 \x03(\x0b2\x18.metalstack.api.v2.TokenR\x06tokens"9\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"\x1c\n\x1aTokenServiceRevokeResponse"\x99\t\n\x19TokenServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12F\n\x0bupdate_meta\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.UpdateMetaR\nupdateMetaB\x06\xbaH\x03\xc8\x01\x00\x122\n\x0bdescription\x18\x03 \x01(\tH\x00R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x12E\n\x0bpermissions\x18\x04 \x03(\x0b2#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12~\n\rproject_roles\x18\x05 \x03(\x0b2>.metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntryR\x0cprojectRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12{\n\x0ctenant_roles\x18\x06 \x03(\x0b2=.metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntryR\x0btenantRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x12J\n\nadmin_role\x18\x07 \x01(\x0e2\x1c.metalstack.api.v2.AdminRoleH\x01R\tadminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12J\n\ninfra_role\x18\x08 \x01(\x0e2\x1c.metalstack.api.v2.InfraRoleH\x02R\tinfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01\x12~\n\rmachine_roles\x18\t \x03(\x0b2>.metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntryR\x0cmachineRolesB\x19\xbaH\x16\x9a\x01\x13\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01*\x05\x82\x01\x02\x10\x01\x127\n\x06labels\x18\n \x01(\x0b2\x1f.metalstack.api.v2.UpdateLabelsR\x06labels\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x028\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x123\n\x05value\x18\x02 \x01(\x0e2\x1d.metalstack.api.v2.TenantRoleR\x05value:\x028\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x124\n\x05value\x18\x02 \x01(\x0e2\x1e.metalstack.api.v2.MachineRoleR\x05value:\x028\x01B\x0e\n\x0c_descriptionB\r\n\x0b_admin_roleB\r\n\x0b_infra_role"L\n\x1aTokenServiceUpdateResponse\x12.\n\x05token\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token"6\n\x16TokenServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"I\n\x17TokenServiceGetResponse\x12.\n\x05token\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token"\x1c\n\x1aTokenServiceRefreshRequest"e\n\x1bTokenServiceRefreshResponse\x12.\n\x05token\x18\x01 \x01(\x0b2\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret"\xc9\x02\n\nTokenQuery\x12!\n\x04uuid\x18\x01 \x01(\tH\x00R\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x88\x01\x01\x12$\n\x04user\x18\x02 \x01(\tH\x01R\x04userB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01\x88\x01\x01\x122\n\x0bdescription\x18\x03 \x01(\tH\x02R\x0bdescriptionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01\x126\n\x06labels\x18\x04 \x01(\x0b2\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01\x12J\n\ntoken_type\x18\x05 \x01(\x0e2\x1c.metalstack.api.v2.TokenTypeH\x04R\ttokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x88\x01\x01B\x07\n\x05_uuidB\x07\n\x05_userB\x0e\n\x0c_descriptionB\t\n\x07_labelsB\r\n\x0b_token_type*P\n\tTokenType\x12\x1a\n\x16TOKEN_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTOKEN_TYPE_API\x10\x01\x12\x13\n\x0fTOKEN_TYPE_USER\x10\x022\xa8\x05\n\x0cTokenService\x12f\n\x03Get\x12).metalstack.api.v2.TokenServiceGetRequest\x1a*.metalstack.api.v2.TokenServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06Create\x12,.metalstack.api.v2.TokenServiceCreateRequest\x1a-.metalstack.api.v2.TokenServiceCreateResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06Update\x12,.metalstack.api.v2.TokenServiceUpdateRequest\x1a-.metalstack.api.v2.TokenServiceUpdateResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12i\n\x04List\x12*.metalstack.api.v2.TokenServiceListRequest\x1a+.metalstack.api.v2.TokenServiceListResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06Revoke\x12,.metalstack.api.v2.TokenServiceRevokeRequest\x1a-.metalstack.api.v2.TokenServiceRevokeResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12r\n\x07Refresh\x12-.metalstack.api.v2.TokenServiceRefreshRequest\x1a..metalstack.api.v2.TokenServiceRefreshResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01B\xc0\x01\n\x15com.metalstack.api.v2B\nTokenProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Token": Token, + "TokenServiceCreateRequest": TokenServiceCreateRequest, + "MethodPermission": MethodPermission, + "TokenServiceCreateResponse": TokenServiceCreateResponse, + "TokenServiceListRequest": TokenServiceListRequest, + "TokenServiceListResponse": TokenServiceListResponse, + "TokenServiceRevokeRequest": TokenServiceRevokeRequest, + "TokenServiceRevokeResponse": TokenServiceRevokeResponse, + "TokenServiceUpdateRequest": TokenServiceUpdateRequest, + "TokenServiceUpdateResponse": TokenServiceUpdateResponse, + "TokenServiceGetRequest": TokenServiceGetRequest, + "TokenServiceGetResponse": TokenServiceGetResponse, + "TokenServiceRefreshRequest": TokenServiceRefreshRequest, + "TokenServiceRefreshResponse": TokenServiceRefreshResponse, + "TokenQuery": TokenQuery, + "TokenType": TokenType, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/token.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/token_pb2.py b/python/metalstack/api/v2/token_pb2.py deleted file mode 100644 index c9ac7b3a..00000000 --- a/python/metalstack/api/v2/token_pb2.py +++ /dev/null @@ -1,190 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/token.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/token.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/api/v2/token.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xc2\t\n\x05Token\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1f\n\x04user\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01R\x04user\x12+\n\x04meta\x18\x03 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12P\n\x0bpermissions\x18\x05 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x0bpermissions\x12\x34\n\x07\x65xpires\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x65xpires\x12\x37\n\tissued_at\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08issuedAt\x12\x45\n\ntoken_type\x18\x08 \x01(\x0e\x32\x1c.metalstack.api.v2.TokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\ttokenType\x12j\n\rproject_roles\x18\t \x03(\x0b\x32*.metalstack.api.v2.Token.ProjectRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01R\x0cprojectRoles\x12g\n\x0ctenant_roles\x18\n \x03(\x0b\x32).metalstack.api.v2.Token.TenantRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01R\x0btenantRoles\x12J\n\nadmin_role\x18\x0b \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x12J\n\ninfra_role\x18\x0c \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tinfraRole\x88\x01\x01\x12j\n\rmachine_roles\x18\r \x03(\x0b\x32*.metalstack.api.v2.Token.MachineRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01R\x0cmachineRoles\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_roleB\r\n\x0b_infra_role\"\xeb\x08\n\x19TokenServiceCreateRequest\x12-\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12O\n\x0bpermissions\x18\x02 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionB\x08\xbaH\x05\x92\x01\x02\x10\x64R\x0bpermissions\x12G\n\x07\x65xpires\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x12\xbaH\x0f\xaa\x01\x0c\x1a\x05\x08\x81\xe7\x84\x0f\x32\x03\x08\xd8\x04R\x07\x65xpires\x12~\n\rproject_roles\x18\x04 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceCreateRequest.ProjectRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01R\x0cprojectRoles\x12{\n\x0ctenant_roles\x18\x05 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceCreateRequest.TenantRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01R\x0btenantRoles\x12J\n\nadmin_role\x18\x06 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\tadminRole\x88\x01\x01\x12J\n\ninfra_role\x18\x07 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tinfraRole\x88\x01\x01\x12~\n\rmachine_roles\x18\x08 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceCreateRequest.MachineRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01R\x0cmachineRoles\x12\x31\n\x06labels\x18\t \x01(\x0b\x32\x19.metalstack.api.v2.LabelsR\x06labels\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x42\r\n\x0b_admin_roleB\r\n\x0b_infra_role\"[\n\x10MethodPermission\x12\"\n\x07subject\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\x18\x80\x02R\x07subject\x12#\n\x07methods\x18\x02 \x03(\tB\t\xbaH\x06\x92\x01\x03\x10\xf4\x03R\x07methods\"d\n\x1aTokenServiceCreateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"N\n\x17TokenServiceListRequest\x12\x33\n\x05query\x18\x01 \x01(\x0b\x32\x1d.metalstack.api.v2.TokenQueryR\x05query\"L\n\x18TokenServiceListResponse\x12\x30\n\x06tokens\x18\x01 \x03(\x0b\x32\x18.metalstack.api.v2.TokenR\x06tokens\"9\n\x19TokenServiceRevokeRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x1c\n\x1aTokenServiceRevokeResponse\"\x99\t\n\x19TokenServiceUpdateRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x00R\nupdateMeta\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12\x45\n\x0bpermissions\x18\x04 \x03(\x0b\x32#.metalstack.api.v2.MethodPermissionR\x0bpermissions\x12~\n\rproject_roles\x18\x05 \x03(\x0b\x32>.metalstack.api.v2.TokenServiceUpdateRequest.ProjectRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xc8\x95\xb8\xb1\x02\x01R\x0cprojectRoles\x12{\n\x0ctenant_roles\x18\x06 \x03(\x0b\x32=.metalstack.api.v2.TokenServiceUpdateRequest.TenantRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd0\x95\xb8\xb1\x02\x01R\x0btenantRoles\x12J\n\nadmin_role\x18\x07 \x01(\x0e\x32\x1c.metalstack.api.v2.AdminRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\tadminRole\x88\x01\x01\x12J\n\ninfra_role\x18\x08 \x01(\x0e\x32\x1c.metalstack.api.v2.InfraRoleB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x02R\tinfraRole\x88\x01\x01\x12~\n\rmachine_roles\x18\t \x03(\x0b\x32>.metalstack.api.v2.TokenServiceUpdateRequest.MachineRolesEntryB\x19\xbaH\x16\x9a\x01\x13*\x05\x82\x01\x02\x10\x01\xc0\x95\xb8\xb1\x02\x01\xd8\x95\xb8\xb1\x02\x01R\x0cmachineRoles\x12\x37\n\x06labels\x18\n \x01(\x0b\x32\x1f.metalstack.api.v2.UpdateLabelsR\x06labels\x1a_\n\x11ProjectRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.ProjectRoleR\x05value:\x02\x38\x01\x1a]\n\x10TenantRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x33\n\x05value\x18\x02 \x01(\x0e\x32\x1d.metalstack.api.v2.TenantRoleR\x05value:\x02\x38\x01\x1a_\n\x11MachineRolesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x34\n\x05value\x18\x02 \x01(\x0e\x32\x1e.metalstack.api.v2.MachineRoleR\x05value:\x02\x38\x01\x42\x0e\n\x0c_descriptionB\r\n\x0b_admin_roleB\r\n\x0b_infra_role\"L\n\x1aTokenServiceUpdateResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"6\n\x16TokenServiceGetRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"I\n\x17TokenServiceGetResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\"\x1c\n\x1aTokenServiceRefreshRequest\"e\n\x1bTokenServiceRefreshResponse\x12.\n\x05token\x18\x01 \x01(\x0b\x32\x18.metalstack.api.v2.TokenR\x05token\x12\x16\n\x06secret\x18\x02 \x01(\tR\x06secret\"\xc9\x02\n\nTokenQuery\x12!\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01H\x00R\x04uuid\x88\x01\x01\x12$\n\x04user\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xf8\xb3\xae\xb1\x02\x01H\x01R\x04user\x88\x01\x01\x12\x32\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x02R\x0b\x64\x65scription\x88\x01\x01\x12\x36\n\x06labels\x18\x04 \x01(\x0b\x32\x19.metalstack.api.v2.LabelsH\x03R\x06labels\x88\x01\x01\x12J\n\ntoken_type\x18\x05 \x01(\x0e\x32\x1c.metalstack.api.v2.TokenTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x04R\ttokenType\x88\x01\x01\x42\x07\n\x05_uuidB\x07\n\x05_userB\x0e\n\x0c_descriptionB\t\n\x07_labelsB\r\n\x0b_token_type*P\n\tTokenType\x12\x1a\n\x16TOKEN_TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0eTOKEN_TYPE_API\x10\x01\x12\x13\n\x0fTOKEN_TYPE_USER\x10\x02\x32\xa8\x05\n\x0cTokenService\x12\x66\n\x03Get\x12).metalstack.api.v2.TokenServiceGetRequest\x1a*.metalstack.api.v2.TokenServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06\x43reate\x12,.metalstack.api.v2.TokenServiceCreateRequest\x1a-.metalstack.api.v2.TokenServiceCreateResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06Update\x12,.metalstack.api.v2.TokenServiceUpdateRequest\x1a-.metalstack.api.v2.TokenServiceUpdateResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12i\n\x04List\x12*.metalstack.api.v2.TokenServiceListRequest\x1a+.metalstack.api.v2.TokenServiceListResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12o\n\x06Revoke\x12,.metalstack.api.v2.TokenServiceRevokeRequest\x1a-.metalstack.api.v2.TokenServiceRevokeResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x12r\n\x07Refresh\x12-.metalstack.api.v2.TokenServiceRefreshRequest\x1a..metalstack.api.v2.TokenServiceRefreshResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x42\xc0\x01\n\x15\x63om.metalstack.api.v2B\nTokenProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.token_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\nTokenProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_TOKEN_PROJECTROLESENTRY']._loaded_options = None - _globals['_TOKEN_PROJECTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKEN_TENANTROLESENTRY']._loaded_options = None - _globals['_TOKEN_TENANTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKEN_MACHINEROLESENTRY']._loaded_options = None - _globals['_TOKEN_MACHINEROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKEN'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKEN'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKEN'].fields_by_name['user']._loaded_options = None - _globals['_TOKEN'].fields_by_name['user']._serialized_options = b'\272H\010r\006\370\263\256\261\002\001' - _globals['_TOKEN'].fields_by_name['description']._loaded_options = None - _globals['_TOKEN'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TOKEN'].fields_by_name['permissions']._loaded_options = None - _globals['_TOKEN'].fields_by_name['permissions']._serialized_options = b'\272H\006\222\001\003\020\364\003' - _globals['_TOKEN'].fields_by_name['token_type']._loaded_options = None - _globals['_TOKEN'].fields_by_name['token_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKEN'].fields_by_name['project_roles']._loaded_options = None - _globals['_TOKEN'].fields_by_name['project_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\310\225\270\261\002\001' - _globals['_TOKEN'].fields_by_name['tenant_roles']._loaded_options = None - _globals['_TOKEN'].fields_by_name['tenant_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\320\225\270\261\002\001' - _globals['_TOKEN'].fields_by_name['admin_role']._loaded_options = None - _globals['_TOKEN'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKEN'].fields_by_name['infra_role']._loaded_options = None - _globals['_TOKEN'].fields_by_name['infra_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKEN'].fields_by_name['machine_roles']._loaded_options = None - _globals['_TOKEN'].fields_by_name['machine_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\330\225\270\261\002\001' - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['permissions']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['permissions']._serialized_options = b'\272H\005\222\001\002\020d' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['expires']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['expires']._serialized_options = b'\272H\017\252\001\014\032\005\010\201\347\204\0172\003\010\330\004' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['project_roles']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['project_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\310\225\270\261\002\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['tenant_roles']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['tenant_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\320\225\270\261\002\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['admin_role']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['infra_role']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['infra_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['machine_roles']._loaded_options = None - _globals['_TOKENSERVICECREATEREQUEST'].fields_by_name['machine_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\330\225\270\261\002\001' - _globals['_METHODPERMISSION'].fields_by_name['subject']._loaded_options = None - _globals['_METHODPERMISSION'].fields_by_name['subject']._serialized_options = b'\272H\005r\003\030\200\002' - _globals['_METHODPERMISSION'].fields_by_name['methods']._loaded_options = None - _globals['_METHODPERMISSION'].fields_by_name['methods']._serialized_options = b'\272H\006\222\001\003\020\364\003' - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKENSERVICEREVOKEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_options = b'8\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['update_meta']._serialized_options = b'\272H\003\310\001\000' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['description']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['project_roles']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['project_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\310\225\270\261\002\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['tenant_roles']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['tenant_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\320\225\270\261\002\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['admin_role']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['admin_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['infra_role']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['infra_role']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['machine_roles']._loaded_options = None - _globals['_TOKENSERVICEUPDATEREQUEST'].fields_by_name['machine_roles']._serialized_options = b'\272H\026\232\001\023*\005\202\001\002\020\001\300\225\270\261\002\001\330\225\270\261\002\001' - _globals['_TOKENSERVICEGETREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKENSERVICEGETREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKENQUERY'].fields_by_name['uuid']._loaded_options = None - _globals['_TOKENQUERY'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_TOKENQUERY'].fields_by_name['user']._loaded_options = None - _globals['_TOKENQUERY'].fields_by_name['user']._serialized_options = b'\272H\010r\006\370\263\256\261\002\001' - _globals['_TOKENQUERY'].fields_by_name['description']._loaded_options = None - _globals['_TOKENQUERY'].fields_by_name['description']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_TOKENQUERY'].fields_by_name['token_type']._loaded_options = None - _globals['_TOKENQUERY'].fields_by_name['token_type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_TOKENSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Create']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Create']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Update']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Update']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['List']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['List']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Revoke']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Revoke']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENSERVICE'].methods_by_name['Refresh']._loaded_options = None - _globals['_TOKENSERVICE'].methods_by_name['Refresh']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_TOKENTYPE']._serialized_start=4871 - _globals['_TOKENTYPE']._serialized_end=4951 - _globals['_TOKEN']._serialized_start=221 - _globals['_TOKEN']._serialized_end=1439 - _globals['_TOKEN_PROJECTROLESENTRY']._serialized_start=1122 - _globals['_TOKEN_PROJECTROLESENTRY']._serialized_end=1217 - _globals['_TOKEN_TENANTROLESENTRY']._serialized_start=1219 - _globals['_TOKEN_TENANTROLESENTRY']._serialized_end=1312 - _globals['_TOKEN_MACHINEROLESENTRY']._serialized_start=1314 - _globals['_TOKEN_MACHINEROLESENTRY']._serialized_end=1409 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_start=1442 - _globals['_TOKENSERVICECREATEREQUEST']._serialized_end=2573 - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_start=1122 - _globals['_TOKENSERVICECREATEREQUEST_PROJECTROLESENTRY']._serialized_end=1217 - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_start=1219 - _globals['_TOKENSERVICECREATEREQUEST_TENANTROLESENTRY']._serialized_end=1312 - _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_start=1314 - _globals['_TOKENSERVICECREATEREQUEST_MACHINEROLESENTRY']._serialized_end=1409 - _globals['_METHODPERMISSION']._serialized_start=2575 - _globals['_METHODPERMISSION']._serialized_end=2666 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_start=2668 - _globals['_TOKENSERVICECREATERESPONSE']._serialized_end=2768 - _globals['_TOKENSERVICELISTREQUEST']._serialized_start=2770 - _globals['_TOKENSERVICELISTREQUEST']._serialized_end=2848 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_start=2850 - _globals['_TOKENSERVICELISTRESPONSE']._serialized_end=2926 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_start=2928 - _globals['_TOKENSERVICEREVOKEREQUEST']._serialized_end=2985 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_start=2987 - _globals['_TOKENSERVICEREVOKERESPONSE']._serialized_end=3015 - _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_start=3018 - _globals['_TOKENSERVICEUPDATEREQUEST']._serialized_end=4195 - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_start=1122 - _globals['_TOKENSERVICEUPDATEREQUEST_PROJECTROLESENTRY']._serialized_end=1217 - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_start=1219 - _globals['_TOKENSERVICEUPDATEREQUEST_TENANTROLESENTRY']._serialized_end=1312 - _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_start=1314 - _globals['_TOKENSERVICEUPDATEREQUEST_MACHINEROLESENTRY']._serialized_end=1409 - _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_start=4197 - _globals['_TOKENSERVICEUPDATERESPONSE']._serialized_end=4273 - _globals['_TOKENSERVICEGETREQUEST']._serialized_start=4275 - _globals['_TOKENSERVICEGETREQUEST']._serialized_end=4329 - _globals['_TOKENSERVICEGETRESPONSE']._serialized_start=4331 - _globals['_TOKENSERVICEGETRESPONSE']._serialized_end=4404 - _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_start=4406 - _globals['_TOKENSERVICEREFRESHREQUEST']._serialized_end=4434 - _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_start=4436 - _globals['_TOKENSERVICEREFRESHRESPONSE']._serialized_end=4537 - _globals['_TOKENQUERY']._serialized_start=4540 - _globals['_TOKENQUERY']._serialized_end=4869 - _globals['_TOKENSERVICE']._serialized_start=4954 - _globals['_TOKENSERVICE']._serialized_end=5634 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/token_pb2.pyi b/python/metalstack/api/v2/token_pb2.pyi deleted file mode 100644 index 40ad85d6..00000000 --- a/python/metalstack/api/v2/token_pb2.pyi +++ /dev/null @@ -1,245 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class TokenType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOKEN_TYPE_UNSPECIFIED: _ClassVar[TokenType] - TOKEN_TYPE_API: _ClassVar[TokenType] - TOKEN_TYPE_USER: _ClassVar[TokenType] -TOKEN_TYPE_UNSPECIFIED: TokenType -TOKEN_TYPE_API: TokenType -TOKEN_TYPE_USER: TokenType - -class Token(_message.Message): - __slots__ = ("uuid", "user", "meta", "description", "permissions", "expires", "issued_at", "token_type", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles") - class ProjectRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.ProjectRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - class TenantRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.TenantRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - class MachineRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.MachineRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... - UUID_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - META_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PERMISSIONS_FIELD_NUMBER: _ClassVar[int] - EXPIRES_FIELD_NUMBER: _ClassVar[int] - ISSUED_AT_FIELD_NUMBER: _ClassVar[int] - TOKEN_TYPE_FIELD_NUMBER: _ClassVar[int] - PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] - TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] - ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] - INFRA_ROLE_FIELD_NUMBER: _ClassVar[int] - MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] - uuid: str - user: str - meta: _common_pb2.Meta - description: str - permissions: _containers.RepeatedCompositeFieldContainer[MethodPermission] - expires: _timestamp_pb2.Timestamp - issued_at: _timestamp_pb2.Timestamp - token_type: TokenType - project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] - tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] - admin_role: _common_pb2.AdminRole - infra_role: _common_pb2.InfraRole - machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] - def __init__(self, uuid: _Optional[str] = ..., user: _Optional[str] = ..., meta: _Optional[_Union[_common_pb2.Meta, _Mapping]] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., issued_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., token_type: _Optional[_Union[TokenType, str]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ..., infra_role: _Optional[_Union[_common_pb2.InfraRole, str]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ...) -> None: ... - -class TokenServiceCreateRequest(_message.Message): - __slots__ = ("description", "permissions", "expires", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels") - class ProjectRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.ProjectRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - class TenantRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.TenantRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - class MachineRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.MachineRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PERMISSIONS_FIELD_NUMBER: _ClassVar[int] - EXPIRES_FIELD_NUMBER: _ClassVar[int] - PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] - TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] - ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] - INFRA_ROLE_FIELD_NUMBER: _ClassVar[int] - MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - description: str - permissions: _containers.RepeatedCompositeFieldContainer[MethodPermission] - expires: _duration_pb2.Duration - project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] - tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] - admin_role: _common_pb2.AdminRole - infra_role: _common_pb2.InfraRole - machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] - labels: _common_pb2.Labels - def __init__(self, description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., expires: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ..., infra_role: _Optional[_Union[_common_pb2.InfraRole, str]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ...) -> None: ... - -class MethodPermission(_message.Message): - __slots__ = ("subject", "methods") - SUBJECT_FIELD_NUMBER: _ClassVar[int] - METHODS_FIELD_NUMBER: _ClassVar[int] - subject: str - methods: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, subject: _Optional[str] = ..., methods: _Optional[_Iterable[str]] = ...) -> None: ... - -class TokenServiceCreateResponse(_message.Message): - __slots__ = ("token", "secret") - TOKEN_FIELD_NUMBER: _ClassVar[int] - SECRET_FIELD_NUMBER: _ClassVar[int] - token: Token - secret: str - def __init__(self, token: _Optional[_Union[Token, _Mapping]] = ..., secret: _Optional[str] = ...) -> None: ... - -class TokenServiceListRequest(_message.Message): - __slots__ = ("query",) - QUERY_FIELD_NUMBER: _ClassVar[int] - query: TokenQuery - def __init__(self, query: _Optional[_Union[TokenQuery, _Mapping]] = ...) -> None: ... - -class TokenServiceListResponse(_message.Message): - __slots__ = ("tokens",) - TOKENS_FIELD_NUMBER: _ClassVar[int] - tokens: _containers.RepeatedCompositeFieldContainer[Token] - def __init__(self, tokens: _Optional[_Iterable[_Union[Token, _Mapping]]] = ...) -> None: ... - -class TokenServiceRevokeRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class TokenServiceRevokeResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TokenServiceUpdateRequest(_message.Message): - __slots__ = ("uuid", "update_meta", "description", "permissions", "project_roles", "tenant_roles", "admin_role", "infra_role", "machine_roles", "labels") - class ProjectRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.ProjectRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.ProjectRole, str]] = ...) -> None: ... - class TenantRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.TenantRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.TenantRole, str]] = ...) -> None: ... - class MachineRolesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _common_pb2.MachineRole - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_common_pb2.MachineRole, str]] = ...) -> None: ... - UUID_FIELD_NUMBER: _ClassVar[int] - UPDATE_META_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - PERMISSIONS_FIELD_NUMBER: _ClassVar[int] - PROJECT_ROLES_FIELD_NUMBER: _ClassVar[int] - TENANT_ROLES_FIELD_NUMBER: _ClassVar[int] - ADMIN_ROLE_FIELD_NUMBER: _ClassVar[int] - INFRA_ROLE_FIELD_NUMBER: _ClassVar[int] - MACHINE_ROLES_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - uuid: str - update_meta: _common_pb2.UpdateMeta - description: str - permissions: _containers.RepeatedCompositeFieldContainer[MethodPermission] - project_roles: _containers.ScalarMap[str, _common_pb2.ProjectRole] - tenant_roles: _containers.ScalarMap[str, _common_pb2.TenantRole] - admin_role: _common_pb2.AdminRole - infra_role: _common_pb2.InfraRole - machine_roles: _containers.ScalarMap[str, _common_pb2.MachineRole] - labels: _common_pb2.UpdateLabels - def __init__(self, uuid: _Optional[str] = ..., update_meta: _Optional[_Union[_common_pb2.UpdateMeta, _Mapping]] = ..., description: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[MethodPermission, _Mapping]]] = ..., project_roles: _Optional[_Mapping[str, _common_pb2.ProjectRole]] = ..., tenant_roles: _Optional[_Mapping[str, _common_pb2.TenantRole]] = ..., admin_role: _Optional[_Union[_common_pb2.AdminRole, str]] = ..., infra_role: _Optional[_Union[_common_pb2.InfraRole, str]] = ..., machine_roles: _Optional[_Mapping[str, _common_pb2.MachineRole]] = ..., labels: _Optional[_Union[_common_pb2.UpdateLabels, _Mapping]] = ...) -> None: ... - -class TokenServiceUpdateResponse(_message.Message): - __slots__ = ("token",) - TOKEN_FIELD_NUMBER: _ClassVar[int] - token: Token - def __init__(self, token: _Optional[_Union[Token, _Mapping]] = ...) -> None: ... - -class TokenServiceGetRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class TokenServiceGetResponse(_message.Message): - __slots__ = ("token",) - TOKEN_FIELD_NUMBER: _ClassVar[int] - token: Token - def __init__(self, token: _Optional[_Union[Token, _Mapping]] = ...) -> None: ... - -class TokenServiceRefreshRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class TokenServiceRefreshResponse(_message.Message): - __slots__ = ("token", "secret") - TOKEN_FIELD_NUMBER: _ClassVar[int] - SECRET_FIELD_NUMBER: _ClassVar[int] - token: Token - secret: str - def __init__(self, token: _Optional[_Union[Token, _Mapping]] = ..., secret: _Optional[str] = ...) -> None: ... - -class TokenQuery(_message.Message): - __slots__ = ("uuid", "user", "description", "labels", "token_type") - UUID_FIELD_NUMBER: _ClassVar[int] - USER_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - LABELS_FIELD_NUMBER: _ClassVar[int] - TOKEN_TYPE_FIELD_NUMBER: _ClassVar[int] - uuid: str - user: str - description: str - labels: _common_pb2.Labels - token_type: TokenType - def __init__(self, uuid: _Optional[str] = ..., user: _Optional[str] = ..., description: _Optional[str] = ..., labels: _Optional[_Union[_common_pb2.Labels, _Mapping]] = ..., token_type: _Optional[_Union[TokenType, str]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/user_connect.py b/python/metalstack/api/v2/user_connect.py index de4c204a..cb26f8ae 100644 --- a/python/metalstack/api/v2/user_connect.py +++ b/python/metalstack/api/v2/user_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/user.proto +# Generated from metalstack/api/v2/user.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.user_pb2 as metalstack_dot_api_dot_v2_dot_user__pb2 + +from .user_pb import UserServiceGetRequest, UserServiceGetResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class UserService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: UserServiceGetRequest, ctx: RequestContext[UserServiceGetRequest, UserServiceGetResponse]) -> UserServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class UserServiceASGIApplication(ConnectASGIApplication[UserService]): - def __init__(self, service: UserService | AsyncGenerator[UserService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: UserService | AsyncGenerator[UserService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: UserService | AsyncGenerator[UserService], *, interc method=MethodInfo( name="Get", service_name="metalstack.api.v2.UserService", - input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse, + input=UserServiceGetRequest, + output=UserServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -53,43 +69,46 @@ def path(self) -> str: class UserServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, + request: UserServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse: + ) -> UserServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.UserService", - input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse, + input=UserServiceGetRequest, + output=UserServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class UserServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: UserServiceGetRequest, ctx: RequestContext[UserServiceGetRequest, UserServiceGetResponse]) -> UserServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class UserServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: UserServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: UserServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.UserService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.UserService", - input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse, + input=UserServiceGetRequest, + output=UserServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -110,22 +129,20 @@ def path(self) -> str: class UserServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, + request: UserServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse: + ) -> UserServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.UserService", - input=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_user__pb2.UserServiceGetResponse, + input=UserServiceGetRequest, + output=UserServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/user_pb.py b/python/metalstack/api/v2/user_pb.py new file mode 100644 index 00000000..2711c5f0 --- /dev/null +++ b/python/metalstack/api/v2/user_pb.py @@ -0,0 +1,176 @@ +# Generated from metalstack/api/v2/user.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb, project_pb, tenant_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from .project_pb import Project + from .tenant_pb import Tenant + + +_UserFields: TypeAlias = Literal["login", "name", "email", "avatar_url", "tenants", "projects", "default_tenant"] + +class User(Message[_UserFields]): + """ + User represents an end user of the platform. + + ```proto + message metalstack.api.v2.User + ``` + + Attributes: + login: + Login is the login at the provider + + ```proto + string login = 1; + ``` + name: + Name of the user + + ```proto + string name = 2; + ``` + email: + Email of the user + + ```proto + string email = 3; + ``` + avatar_url: + AvatarUrl of the user + + ```proto + string avatar_url = 4; + ``` + tenants: + Tenants the user belongs to + + ```proto + repeated metalstack.api.v2.Tenant tenants = 5; + ``` + projects: + Projects the user belongs to + + ```proto + repeated metalstack.api.v2.Project projects = 6; + ``` + default_tenant: + DefaultTenant the default tenant that this user belongs to + + ```proto + optional metalstack.api.v2.Tenant default_tenant = 7; + ``` + """ + + __slots__ = ("login", "name", "email", "avatar_url", "tenants", "projects", "default_tenant") + + if TYPE_CHECKING: + + def __init__( + self, + *, + login: str = "", + name: str = "", + email: str = "", + avatar_url: str = "", + tenants: list[Tenant] | None = None, + projects: list[Project] | None = None, + default_tenant: Tenant | None = None, + ) -> None: + pass + + login: str + name: str + email: str + avatar_url: str + tenants: list[Tenant] + projects: list[Project] + default_tenant: Tenant | None + +_UserServiceGetRequestFields: TypeAlias = NoReturn + +class UserServiceGetRequest(Message[_UserServiceGetRequestFields]): + """ + UserServiceGetRequest is the request payload for getting the user. + + ```proto + message metalstack.api.v2.UserServiceGetRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_UserServiceGetResponseFields: TypeAlias = Literal["user"] + +class UserServiceGetResponse(Message[_UserServiceGetResponseFields]): + """ + UserServiceGetResponse is the response payload for getting the user. + + ```proto + message metalstack.api.v2.UserServiceGetResponse + ``` + + Attributes: + user: + User contains the authenticated user + + ```proto + optional metalstack.api.v2.User user = 1; + ``` + """ + + __slots__ = ("user",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + user: User | None = None, + ) -> None: + pass + + user: User | None + + +_DESC = file_desc( + b'\n\x1cmetalstack/api/v2/user.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/project.proto\x1a\x1emetalstack/api/v2/tenant.proto"\xc4\x02\n\x04User\x12!\n\x05login\x18\x01 \x01(\tR\x05loginB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01\x12\x1f\n\x04name\x18\x02 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12\x1d\n\x05email\x18\x03 \x01(\tR\x05emailB\x07\xbaH\x04r\x02`\x01\x12*\n\navatar_url\x18\x04 \x01(\tR\tavatarUrlB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x123\n\x07tenants\x18\x05 \x03(\x0b2\x19.metalstack.api.v2.TenantR\x07tenants\x126\n\x08projects\x18\x06 \x03(\x0b2\x1a.metalstack.api.v2.ProjectR\x08projects\x12@\n\x0edefault_tenant\x18\x07 \x01(\x0b2\x19.metalstack.api.v2.TenantR\rdefaultTenant"\x17\n\x15UserServiceGetRequest"E\n\x16UserServiceGetResponse\x12+\n\x04user\x18\x01 \x01(\x0b2\x17.metalstack.api.v2.UserR\x04user2s\n\x0bUserService\x12d\n\x03Get\x12(.metalstack.api.v2.UserServiceGetRequest\x1a).metalstack.api.v2.UserServiceGetResponse"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01B\xbf\x01\n\x15com.metalstack.api.v2B\tUserProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + project_pb.desc(), + tenant_pb.desc(), + ], + { + "User": User, + "UserServiceGetRequest": UserServiceGetRequest, + "UserServiceGetResponse": UserServiceGetResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/user.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/user_pb2.py b/python/metalstack/api/v2/user_pb2.py deleted file mode 100644 index 708e34da..00000000 --- a/python/metalstack/api/v2/user_pb2.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/user.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/user.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import project_pb2 as metalstack_dot_api_dot_v2_dot_project__pb2 -from metalstack.api.v2 import tenant_pb2 as metalstack_dot_api_dot_v2_dot_tenant__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cmetalstack/api/v2/user.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/project.proto\x1a\x1emetalstack/api/v2/tenant.proto\"\xc4\x02\n\x04User\x12!\n\x05login\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\x90\xb4\xae\xb1\x02\x01R\x05login\x12\x1f\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12\x1d\n\x05\x65mail\x18\x03 \x01(\tB\x07\xbaH\x04r\x02`\x01R\x05\x65mail\x12*\n\navatar_url\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\tavatarUrl\x12\x33\n\x07tenants\x18\x05 \x03(\x0b\x32\x19.metalstack.api.v2.TenantR\x07tenants\x12\x36\n\x08projects\x18\x06 \x03(\x0b\x32\x1a.metalstack.api.v2.ProjectR\x08projects\x12@\n\x0e\x64\x65\x66\x61ult_tenant\x18\x07 \x01(\x0b\x32\x19.metalstack.api.v2.TenantR\rdefaultTenant\"\x17\n\x15UserServiceGetRequest\"E\n\x16UserServiceGetResponse\x12+\n\x04user\x18\x01 \x01(\x0b\x32\x17.metalstack.api.v2.UserR\x04user2s\n\x0bUserService\x12\x64\n\x03Get\x12(.metalstack.api.v2.UserServiceGetRequest\x1a).metalstack.api.v2.UserServiceGetResponse\"\x08\xd8\xf3\x18\x02\xe0\xf3\x18\x01\x42\xbf\x01\n\x15\x63om.metalstack.api.v2B\tUserProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.user_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\tUserProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_USER'].fields_by_name['login']._loaded_options = None - _globals['_USER'].fields_by_name['login']._serialized_options = b'\272H\010r\006\220\264\256\261\002\001' - _globals['_USER'].fields_by_name['name']._loaded_options = None - _globals['_USER'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_USER'].fields_by_name['email']._loaded_options = None - _globals['_USER'].fields_by_name['email']._serialized_options = b'\272H\004r\002`\001' - _globals['_USER'].fields_by_name['avatar_url']._loaded_options = None - _globals['_USER'].fields_by_name['avatar_url']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_USERSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_USERSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\002\340\363\030\001' - _globals['_USER']._serialized_start=220 - _globals['_USER']._serialized_end=544 - _globals['_USERSERVICEGETREQUEST']._serialized_start=546 - _globals['_USERSERVICEGETREQUEST']._serialized_end=569 - _globals['_USERSERVICEGETRESPONSE']._serialized_start=571 - _globals['_USERSERVICEGETRESPONSE']._serialized_end=640 - _globals['_USERSERVICE']._serialized_start=642 - _globals['_USERSERVICE']._serialized_end=757 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/user_pb2.pyi b/python/metalstack/api/v2/user_pb2.pyi deleted file mode 100644 index 37ce7921..00000000 --- a/python/metalstack/api/v2/user_pb2.pyi +++ /dev/null @@ -1,40 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import project_pb2 as _project_pb2 -from metalstack.api.v2 import tenant_pb2 as _tenant_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class User(_message.Message): - __slots__ = ("login", "name", "email", "avatar_url", "tenants", "projects", "default_tenant") - LOGIN_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - EMAIL_FIELD_NUMBER: _ClassVar[int] - AVATAR_URL_FIELD_NUMBER: _ClassVar[int] - TENANTS_FIELD_NUMBER: _ClassVar[int] - PROJECTS_FIELD_NUMBER: _ClassVar[int] - DEFAULT_TENANT_FIELD_NUMBER: _ClassVar[int] - login: str - name: str - email: str - avatar_url: str - tenants: _containers.RepeatedCompositeFieldContainer[_tenant_pb2.Tenant] - projects: _containers.RepeatedCompositeFieldContainer[_project_pb2.Project] - default_tenant: _tenant_pb2.Tenant - def __init__(self, login: _Optional[str] = ..., name: _Optional[str] = ..., email: _Optional[str] = ..., avatar_url: _Optional[str] = ..., tenants: _Optional[_Iterable[_Union[_tenant_pb2.Tenant, _Mapping]]] = ..., projects: _Optional[_Iterable[_Union[_project_pb2.Project, _Mapping]]] = ..., default_tenant: _Optional[_Union[_tenant_pb2.Tenant, _Mapping]] = ...) -> None: ... - -class UserServiceGetRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class UserServiceGetResponse(_message.Message): - __slots__ = ("user",) - USER_FIELD_NUMBER: _ClassVar[int] - user: User - def __init__(self, user: _Optional[_Union[User, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/version_connect.py b/python/metalstack/api/v2/version_connect.py index 08d1350f..fdeefca0 100644 --- a/python/metalstack/api/v2/version_connect.py +++ b/python/metalstack/api/v2/version_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/api/v2/version.proto +# Generated from metalstack/api/v2/version.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.api.v2.version_pb2 as metalstack_dot_api_dot_v2_dot_version__pb2 + +from .version_pb import VersionServiceGetRequest, VersionServiceGetResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class VersionService(Protocol): - async def get(self, request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: VersionServiceGetRequest, ctx: RequestContext[VersionServiceGetRequest, VersionServiceGetResponse]) -> VersionServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class VersionServiceASGIApplication(ConnectASGIApplication[VersionService]): - def __init__(self, service: VersionService | AsyncGenerator[VersionService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: VersionService | AsyncGenerator[VersionService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: VersionService | AsyncGenerator[VersionService], *, method=MethodInfo( name="Get", service_name="metalstack.api.v2.VersionService", - input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse, + input=VersionServiceGetRequest, + output=VersionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -53,43 +69,46 @@ def path(self) -> str: class VersionServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, + request: VersionServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse: + ) -> VersionServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.VersionService", - input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse, + input=VersionServiceGetRequest, + output=VersionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class VersionServiceSync(Protocol): - def get(self, request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, ctx: RequestContext) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def get(self, request: VersionServiceGetRequest, ctx: RequestContext[VersionServiceGetRequest, VersionServiceGetResponse]) -> VersionServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class VersionServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: VersionServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: VersionServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.api.v2.VersionService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.api.v2.VersionService", - input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse, + input=VersionServiceGetRequest, + output=VersionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -110,22 +129,20 @@ def path(self) -> str: class VersionServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, + request: VersionServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse: + ) -> VersionServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.api.v2.VersionService", - input=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetRequest, - output=metalstack_dot_api_dot_v2_dot_version__pb2.VersionServiceGetResponse, + input=VersionServiceGetRequest, + output=VersionServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/api/v2/version_pb.py b/python/metalstack/api/v2/version_pb.py new file mode 100644 index 00000000..b3c97057 --- /dev/null +++ b/python/metalstack/api/v2/version_pb.py @@ -0,0 +1,147 @@ +# Generated from metalstack/api/v2/version.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from . import common_pb, predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + +_VersionFields: TypeAlias = Literal["version", "revision", "git_sha1", "build_date"] + +class Version(Message[_VersionFields]): + """ + Version represents the version of the application. + + ```proto + message metalstack.api.v2.Version + ``` + + Attributes: + version: + Version of the application + + ```proto + string version = 1; + ``` + revision: + Revision of the application + + ```proto + string revision = 2; + ``` + git_sha1: + GitSHA1 of the application + + ```proto + string git_sha1 = 3; + ``` + build_date: + BuildDate of the application + + ```proto + string build_date = 4; + ``` + """ + + __slots__ = ("version", "revision", "git_sha1", "build_date") + + if TYPE_CHECKING: + + def __init__( + self, + *, + version: str = "", + revision: str = "", + git_sha1: str = "", + build_date: str = "", + ) -> None: + pass + + version: str + revision: str + git_sha1: str + build_date: str + +_VersionServiceGetRequestFields: TypeAlias = NoReturn + +class VersionServiceGetRequest(Message[_VersionServiceGetRequestFields]): + """ + VersionServiceGetRequest is the request payload for getting the version. + + ```proto + message metalstack.api.v2.VersionServiceGetRequest + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_VersionServiceGetResponseFields: TypeAlias = Literal["version"] + +class VersionServiceGetResponse(Message[_VersionServiceGetResponseFields]): + """ + VersionServiceGetResponse is the response payload for getting the version. + + ```proto + message metalstack.api.v2.VersionServiceGetResponse + ``` + + Attributes: + version: + Version contains the version of the application + + ```proto + optional metalstack.api.v2.Version version = 1; + ``` + """ + + __slots__ = ("version",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + version: Version | None = None, + ) -> None: + pass + + version: Version | None + + +_DESC = file_desc( + b'\n\x1fmetalstack/api/v2/version.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xad\x01\n\x07Version\x12%\n\x07version\x18\x01 \x01(\tR\x07versionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12\'\n\x08revision\x18\x02 \x01(\tR\x08revisionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12&\n\x08git_sha1\x18\x03 \x01(\tR\x07gitSha1B\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12*\n\nbuild_date\x18\x04 \x01(\tR\tbuildDateB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01"\x1a\n\x18VersionServiceGetRequest"Q\n\x19VersionServiceGetResponse\x124\n\x07version\x18\x01 \x01(\x0b2\x1a.metalstack.api.v2.VersionR\x07version2|\n\x0eVersionService\x12j\n\x03Get\x12+.metalstack.api.v2.VersionServiceGetRequest\x1a,.metalstack.api.v2.VersionServiceGetResponse"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x02B\xc2\x01\n\x15com.metalstack.api.v2B\x0cVersionProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "Version": Version, + "VersionServiceGetRequest": VersionServiceGetRequest, + "VersionServiceGetResponse": VersionServiceGetResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/version.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/version_pb2.py b/python/metalstack/api/v2/version_pb2.py deleted file mode 100644 index 0500208b..00000000 --- a/python/metalstack/api/v2/version_pb2.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/version.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/version.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/api/v2/version.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xad\x01\n\x07Version\x12%\n\x07version\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x07version\x12\'\n\x08revision\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x08revision\x12&\n\x08git_sha1\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x07gitSha1\x12*\n\nbuild_date\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\tbuildDate\"\x1a\n\x18VersionServiceGetRequest\"Q\n\x19VersionServiceGetResponse\x12\x34\n\x07version\x18\x01 \x01(\x0b\x32\x1a.metalstack.api.v2.VersionR\x07version2|\n\x0eVersionService\x12j\n\x03Get\x12+.metalstack.api.v2.VersionServiceGetRequest\x1a,.metalstack.api.v2.VersionServiceGetResponse\"\x08\xd8\xf3\x18\x01\xe0\xf3\x18\x02\x42\xc2\x01\n\x15\x63om.metalstack.api.v2B\x0cVersionProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.version_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\014VersionProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_VERSION'].fields_by_name['version']._loaded_options = None - _globals['_VERSION'].fields_by_name['version']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_VERSION'].fields_by_name['revision']._loaded_options = None - _globals['_VERSION'].fields_by_name['revision']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_VERSION'].fields_by_name['git_sha1']._loaded_options = None - _globals['_VERSION'].fields_by_name['git_sha1']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_VERSION'].fields_by_name['build_date']._loaded_options = None - _globals['_VERSION'].fields_by_name['build_date']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_VERSIONSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_VERSIONSERVICE'].methods_by_name['Get']._serialized_options = b'\330\363\030\001\340\363\030\002' - _globals['_VERSION']._serialized_start=158 - _globals['_VERSION']._serialized_end=331 - _globals['_VERSIONSERVICEGETREQUEST']._serialized_start=333 - _globals['_VERSIONSERVICEGETREQUEST']._serialized_end=359 - _globals['_VERSIONSERVICEGETRESPONSE']._serialized_start=361 - _globals['_VERSIONSERVICEGETRESPONSE']._serialized_end=442 - _globals['_VERSIONSERVICE']._serialized_start=444 - _globals['_VERSIONSERVICE']._serialized_end=568 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/version_pb2.pyi b/python/metalstack/api/v2/version_pb2.pyi deleted file mode 100644 index db01d137..00000000 --- a/python/metalstack/api/v2/version_pb2.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class Version(_message.Message): - __slots__ = ("version", "revision", "git_sha1", "build_date") - VERSION_FIELD_NUMBER: _ClassVar[int] - REVISION_FIELD_NUMBER: _ClassVar[int] - GIT_SHA1_FIELD_NUMBER: _ClassVar[int] - BUILD_DATE_FIELD_NUMBER: _ClassVar[int] - version: str - revision: str - git_sha1: str - build_date: str - def __init__(self, version: _Optional[str] = ..., revision: _Optional[str] = ..., git_sha1: _Optional[str] = ..., build_date: _Optional[str] = ...) -> None: ... - -class VersionServiceGetRequest(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class VersionServiceGetResponse(_message.Message): - __slots__ = ("version",) - VERSION_FIELD_NUMBER: _ClassVar[int] - version: Version - def __init__(self, version: _Optional[_Union[Version, _Mapping]] = ...) -> None: ... diff --git a/python/metalstack/api/v2/vpn_pb.py b/python/metalstack/api/v2/vpn_pb.py new file mode 100644 index 00000000..b325e656 --- /dev/null +++ b/python/metalstack/api/v2/vpn_pb.py @@ -0,0 +1,111 @@ +# Generated from metalstack/api/v2/vpn.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import timestamp_pb + +from . import predefined_rules_pb +from ....buf.validate import validate_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Timestamp + + +_VPNNodeFields: TypeAlias = Literal["id", "name", "project", "ip_addresses", "last_seen", "online"] + +class VPNNode(Message[_VPNNodeFields]): + """ + VPNNode represents a machine connected to the VPN. + + ```proto + message metalstack.api.v2.VPNNode + ``` + + Attributes: + id: + ID of this node + + ```proto + uint64 id = 1; + ``` + name: + Name of this node + + ```proto + string name = 2; + ``` + project: + Project of this node, maps to a project + + ```proto + string project = 3; + ``` + ip_addresses: + IPAddresses of this node in the VPN + + ```proto + repeated string ip_addresses = 4; + ``` + last_seen: + LastSeen timestamp when this node reached out to the control plane + + ```proto + optional google.protobuf.Timestamp last_seen = 5; + ``` + online: + Online indicates if this node is online + + ```proto + bool online = 6; + ``` + """ + + __slots__ = ("id", "name", "project", "ip_addresses", "last_seen", "online") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: int = 0, + name: str = "", + project: str = "", + ip_addresses: list[str] | None = None, + last_seen: Timestamp | None = None, + online: bool = False, + ) -> None: + pass + + id: int + name: str + project: str + ip_addresses: list[str] + last_seen: Timestamp | None + online: bool + + +_DESC = file_desc( + b'\n\x1bmetalstack/api/v2/vpn.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a(metalstack/api/v2/predefined_rules.proto"\xe3\x01\n\x07VPNNode\x12\x0e\n\x02id\x18\x01 \x01(\x04R\x02id\x12\x1f\n\x04name\x18\x02 \x01(\tR\x04nameB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12%\n\x07project\x18\x03 \x01(\tR\x07projectB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12/\n\x0cip_addresses\x18\x04 \x03(\tR\x0bipAddressesB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01\x127\n\tlast_seen\x18\x05 \x01(\x0b2\x1a.google.protobuf.TimestampR\x08lastSeen\x12\x16\n\x06online\x18\x06 \x01(\x08R\x06onlineB\xbe\x01\n\x15com.metalstack.api.v2B\x08VpnProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3', + [ + validate_pb.desc(), + timestamp_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "VPNNode": VPNNode, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/api/v2/vpn.proto`.""" + return _DESC diff --git a/python/metalstack/api/v2/vpn_pb2.py b/python/metalstack/api/v2/vpn_pb2.py deleted file mode 100644 index 36a5f8d0..00000000 --- a/python/metalstack/api/v2/vpn_pb2.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/api/v2/vpn.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/api/v2/vpn.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bmetalstack/api/v2/vpn.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xe3\x01\n\x07VPNNode\x12\x0e\n\x02id\x18\x01 \x01(\x04R\x02id\x12\x1f\n\x04name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12%\n\x07project\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07project\x12/\n\x0cip_addresses\x18\x04 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xc0\xa4\xb3\xb1\x02\x01R\x0bipAddresses\x12\x37\n\tlast_seen\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08lastSeen\x12\x16\n\x06online\x18\x06 \x01(\x08R\x06onlineB\xbe\x01\n\x15\x63om.metalstack.api.v2B\x08VpnProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.vpn_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\010VpnProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2' - _globals['_VPNNODE'].fields_by_name['name']._loaded_options = None - _globals['_VPNNODE'].fields_by_name['name']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_VPNNODE'].fields_by_name['project']._loaded_options = None - _globals['_VPNNODE'].fields_by_name['project']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_VPNNODE'].fields_by_name['ip_addresses']._loaded_options = None - _globals['_VPNNODE'].fields_by_name['ip_addresses']._serialized_options = b'\272H\t\222\001\006\300\244\263\261\002\001' - _globals['_VPNNODE']._serialized_start=155 - _globals['_VPNNODE']._serialized_end=382 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/api/v2/vpn_pb2.pyi b/python/metalstack/api/v2/vpn_pb2.pyi deleted file mode 100644 index 0c6d9198..00000000 --- a/python/metalstack/api/v2/vpn_pb2.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class VPNNode(_message.Message): - __slots__ = ("id", "name", "project", "ip_addresses", "last_seen", "online") - ID_FIELD_NUMBER: _ClassVar[int] - NAME_FIELD_NUMBER: _ClassVar[int] - PROJECT_FIELD_NUMBER: _ClassVar[int] - IP_ADDRESSES_FIELD_NUMBER: _ClassVar[int] - LAST_SEEN_FIELD_NUMBER: _ClassVar[int] - ONLINE_FIELD_NUMBER: _ClassVar[int] - id: int - name: str - project: str - ip_addresses: _containers.RepeatedScalarFieldContainer[str] - last_seen: _timestamp_pb2.Timestamp - online: bool - def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., project: _Optional[str] = ..., ip_addresses: _Optional[_Iterable[str]] = ..., last_seen: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., online: _Optional[bool] = ...) -> None: ... diff --git a/python/metalstack/client/tests/conftest.py b/python/metalstack/client/tests/conftest.py index 8cf48df9..e449eae1 100644 --- a/python/metalstack/client/tests/conftest.py +++ b/python/metalstack/client/tests/conftest.py @@ -6,8 +6,8 @@ from connectrpc.request import RequestContext from pyqwest.testing import WSGITransport -from metalstack.api.v2 import ip_pb2 -from metalstack.api.v2 import version_pb2 +from metalstack.api.v2 import ip_pb +from metalstack.api.v2 import version_pb from metalstack.api.v2.ip_connect import ( IPServiceWSGIApplication, ) @@ -15,8 +15,8 @@ VersionServiceWSGIApplication, ) from metalstack.client.client import Client -from metalstack.infra.v2 import bmc_pb2 -from metalstack.infra.v2 import component_pb2 as infra_component_pb2 +from metalstack.infra.v2 import bmc_pb +from metalstack.infra.v2 import component_pb as infra_component_pb from metalstack.infra.v2.bmc_connect import ( BMCServiceWSGIApplication, ) @@ -30,10 +30,10 @@ def __init__(self, version: str = "1.0"): self._version = version def get( - self, request: version_pb2.VersionServiceGetRequest, ctx: RequestContext - ) -> version_pb2.VersionServiceGetResponse: - return version_pb2.VersionServiceGetResponse( - version=version_pb2.Version(version=self._version) + self, request: version_pb.VersionServiceGetRequest, ctx: RequestContext + ) -> version_pb.VersionServiceGetResponse: + return version_pb.VersionServiceGetResponse( + version=version_pb.Version(version=self._version) ) @@ -42,32 +42,32 @@ def __init__(self): self.received_auth: str | None = None def get( - self, request: ip_pb2.IPServiceGetRequest, ctx: RequestContext - ) -> ip_pb2.IPServiceGetResponse: + self, request: ip_pb.IPServiceGetRequest, ctx: RequestContext + ) -> ip_pb.IPServiceGetResponse: self.received_auth = ctx.request_headers().get("authorization") - return ip_pb2.IPServiceGetResponse( - ip=ip_pb2.IP(ip=request.ip, project=request.project) + return ip_pb.IPServiceGetResponse( + ip=ip_pb.IP(ip=request.ip, project=request.project) ) def create( - self, request: ip_pb2.IPServiceCreateRequest, ctx: RequestContext - ) -> ip_pb2.IPServiceCreateResponse: - return ip_pb2.IPServiceCreateResponse() + self, request: ip_pb.IPServiceCreateRequest, ctx: RequestContext + ) -> ip_pb.IPServiceCreateResponse: + return ip_pb.IPServiceCreateResponse() def update( - self, request: ip_pb2.IPServiceUpdateRequest, ctx: RequestContext - ) -> ip_pb2.IPServiceUpdateResponse: - return ip_pb2.IPServiceUpdateResponse() + self, request: ip_pb.IPServiceUpdateRequest, ctx: RequestContext + ) -> ip_pb.IPServiceUpdateResponse: + return ip_pb.IPServiceUpdateResponse() def list( - self, request: ip_pb2.IPServiceListRequest, ctx: RequestContext - ) -> ip_pb2.IPServiceListResponse: - return ip_pb2.IPServiceListResponse() + self, request: ip_pb.IPServiceListRequest, ctx: RequestContext + ) -> ip_pb.IPServiceListResponse: + return ip_pb.IPServiceListResponse() def delete( - self, request: ip_pb2.IPServiceDeleteRequest, ctx: RequestContext - ) -> ip_pb2.IPServiceDeleteResponse: - return ip_pb2.IPServiceDeleteResponse() + self, request: ip_pb.IPServiceDeleteRequest, ctx: RequestContext + ) -> ip_pb.IPServiceDeleteResponse: + return ip_pb.IPServiceDeleteResponse() class MockBMCService: @@ -75,34 +75,34 @@ def __init__(self): self.received_auth: str | None = None def update_b_m_c_info( - self, request: bmc_pb2.UpdateBMCInfoRequest, ctx: RequestContext - ) -> bmc_pb2.UpdateBMCInfoResponse: + self, request: bmc_pb.UpdateBMCInfoRequest, ctx: RequestContext + ) -> bmc_pb.UpdateBMCInfoResponse: self.received_auth = ctx.request_headers().get("authorization") - return bmc_pb2.UpdateBMCInfoResponse() + return bmc_pb.UpdateBMCInfoResponse() def wait_for_b_m_c_command( - self, request: bmc_pb2.WaitForBMCCommandRequest, ctx: RequestContext - ) -> Iterator[bmc_pb2.WaitForBMCCommandResponse]: + self, request: bmc_pb.WaitForBMCCommandRequest, ctx: RequestContext + ) -> Iterator[bmc_pb.WaitForBMCCommandResponse]: self.received_auth = ctx.request_headers().get("authorization") - yield bmc_pb2.WaitForBMCCommandResponse(uuid="test-uuid", command_id="cmd-1") + yield bmc_pb.WaitForBMCCommandResponse(uuid="test-uuid", command_id="cmd-1") def b_m_c_command_done( - self, request: bmc_pb2.BMCCommandDoneRequest, ctx: RequestContext - ) -> bmc_pb2.BMCCommandDoneResponse: - return bmc_pb2.BMCCommandDoneResponse() + self, request: bmc_pb.BMCCommandDoneRequest, ctx: RequestContext + ) -> bmc_pb.BMCCommandDoneResponse: + return bmc_pb.BMCCommandDoneResponse() class MockComponentService: def __init__(self): - self.pings: list[infra_component_pb2.ComponentServicePingRequest] = [] + self.pings: list[infra_component_pb.ComponentServicePingRequest] = [] def ping( self, - request: infra_component_pb2.ComponentServicePingRequest, + request: infra_component_pb.ComponentServicePingRequest, ctx: RequestContext, - ) -> infra_component_pb2.ComponentServicePingResponse: + ) -> infra_component_pb.ComponentServicePingResponse: self.pings.append( - infra_component_pb2.ComponentServicePingRequest( + infra_component_pb.ComponentServicePingRequest( type=request.type, identifier=request.identifier, started_at=request.started_at, @@ -110,7 +110,7 @@ def ping( version=request.version, ) ) - return infra_component_pb2.ComponentServicePingResponse() + return infra_component_pb.ComponentServicePingResponse() def _build_combined_wsgi_app(services: dict[str, Any]): diff --git a/python/metalstack/client/tests/test_client.py b/python/metalstack/client/tests/test_client.py index 57e3f8f2..2e5c8de4 100644 --- a/python/metalstack/client/tests/test_client.py +++ b/python/metalstack/client/tests/test_client.py @@ -8,8 +8,8 @@ import pytest from pyqwest.testing import WSGITransport -from metalstack.api.v2 import ip_pb2 -from metalstack.api.v2 import version_pb2 +from metalstack.api.v2 import ip_pb +from metalstack.api.v2 import version_pb from metalstack.api.v2.ip_connect import ( IPServiceClientSync, IPServiceWSGIApplication, @@ -19,12 +19,12 @@ VersionServiceWSGIApplication, ) from metalstack.client.client import Client -from metalstack.infra.v2 import bmc_pb2 +from metalstack.infra.v2 import bmc_pb from metalstack.infra.v2.bmc_connect import ( BMCServiceClientSync, BMCServiceWSGIApplication, ) -from metalstack.infra.v2 import component_pb2 as infra_component_pb2 +from metalstack.infra.v2 import component_pb as infra_component_pb from metalstack.infra.v2.component_connect import ( ComponentServiceClientSync, ComponentServiceWSGIApplication, @@ -53,7 +53,7 @@ def test_client_creates_service_groups(self, test_client): def test_client_apiv2_version_get(self, test_client, mock_version_service): """Version.Get returns the expected version through the Client wrapper.""" resp = test_client.apiv2().version().get( - request=version_pb2.VersionServiceGetRequest() + request=version_pb.VersionServiceGetRequest() ) assert resp is not None assert resp.version.version == "1.0" @@ -77,7 +77,7 @@ def test_client_apiv2_version_get_custom_version(self, mock_version_service): c._client = pyqwest.SyncClient(transport=transport) resp = c.apiv2().version().get( - request=version_pb2.VersionServiceGetRequest() + request=version_pb.VersionServiceGetRequest() ) assert resp.version.version == "2.5.3" @@ -92,7 +92,7 @@ def test_client_auth_header_unary(self, test_client, mock_bmc_service): """Unary call has Authorization header set.""" token = "test-bearer-token" resp = test_client.infrav2().bmc().update_b_m_c_info( - request=bmc_pb2.UpdateBMCInfoRequest(), + request=bmc_pb.UpdateBMCInfoRequest(), headers={"authorization": f"Bearer {token}"}, ) assert resp is not None @@ -102,7 +102,7 @@ def test_client_auth_header_streaming(self, test_client, mock_bmc_service): """Streaming call has Authorization header set.""" token = "test-stream-token" stream = test_client.infrav2().bmc().wait_for_b_m_c_command( - request=bmc_pb2.WaitForBMCCommandRequest(), + request=bmc_pb.WaitForBMCCommandRequest(), headers={"authorization": f"Bearer {token}"}, ) assert stream is not None @@ -114,7 +114,7 @@ def test_client_auth_header_ip_get(self, test_client, mock_ip_service): """IP Get call has Authorization header set.""" token = "ip-service-token" resp = test_client.apiv2().ip().get( - request=ip_pb2.IPServiceGetRequest(ip="10.0.0.1"), + request=ip_pb.IPServiceGetRequest(ip="10.0.0.1"), headers={"authorization": f"Bearer {token}"}, ) assert resp is not None diff --git a/python/metalstack/client/tests/test_interceptor.py b/python/metalstack/client/tests/test_interceptor.py index e381a36c..87445032 100644 --- a/python/metalstack/client/tests/test_interceptor.py +++ b/python/metalstack/client/tests/test_interceptor.py @@ -10,7 +10,7 @@ from connectrpc.request import RequestContext from pyqwest.testing import WSGITransport -from metalstack.api.v2 import ip_pb2 +from metalstack.api.v2 import ip_pb from metalstack.api.v2.ip_connect import ( IPServiceClientSync, IPServiceWSGIApplication, @@ -67,28 +67,28 @@ def test_interceptor_receives_request(self, mock_ip_service): from metalstack.infra.v2.bmc_connect import BMCServiceWSGIApplication from metalstack.infra.v2.component_connect import ComponentServiceWSGIApplication from metalstack.api.v2.version_connect import VersionServiceWSGIApplication - from metalstack.infra.v2 import bmc_pb2 - from metalstack.infra.v2 import component_pb2 as infra_component_pb2 + from metalstack.infra.v2 import bmc_pb + from metalstack.infra.v2 import component_pb as infra_component_pb class NoopBMC: def update_b_m_c_info(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import UpdateBMCInfoResponse + from metalstack.infra.v2.bmc_pb import UpdateBMCInfoResponse return UpdateBMCInfoResponse() def wait_for_b_m_c_command(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import WaitForBMCCommandResponse + from metalstack.infra.v2.bmc_pb import WaitForBMCCommandResponse yield WaitForBMCCommandResponse() def b_m_c_command_done(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import BMCCommandDoneResponse + from metalstack.infra.v2.bmc_pb import BMCCommandDoneResponse return BMCCommandDoneResponse() class NoopComponent: def ping(self, request, ctx): - from metalstack.infra.v2.component_pb2 import ComponentServicePingResponse + from metalstack.infra.v2.component_pb import ComponentServicePingResponse return ComponentServicePingResponse() class NoopVersion: def get(self, request, ctx): - from metalstack.api.v2.version_pb2 import VersionServiceGetResponse, Version + from metalstack.api.v2.version_pb import VersionServiceGetResponse, Version return VersionServiceGetResponse(version=Version(version="0.0")) services = { @@ -108,7 +108,7 @@ def get(self, request, ctx): ) resp = svc.get( - request=ip_pb2.IPServiceGetRequest(ip="1.2.3.4"), + request=ip_pb.IPServiceGetRequest(ip="1.2.3.4"), ) assert resp.ip.ip == "1.2.3.4" @@ -124,23 +124,23 @@ def test_auth_interceptor_injects_token(self): class NoopBMC: def update_b_m_c_info(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import UpdateBMCInfoResponse + from metalstack.infra.v2.bmc_pb import UpdateBMCInfoResponse return UpdateBMCInfoResponse() def wait_for_b_m_c_command(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import WaitForBMCCommandResponse + from metalstack.infra.v2.bmc_pb import WaitForBMCCommandResponse yield WaitForBMCCommandResponse() def b_m_c_command_done(self, request, ctx): - from metalstack.infra.v2.bmc_pb2 import BMCCommandDoneResponse + from metalstack.infra.v2.bmc_pb import BMCCommandDoneResponse return BMCCommandDoneResponse() class NoopComponent: def ping(self, request, ctx): - from metalstack.infra.v2.component_pb2 import ComponentServicePingResponse + from metalstack.infra.v2.component_pb import ComponentServicePingResponse return ComponentServicePingResponse() class NoopVersion: def get(self, request, ctx): - from metalstack.api.v2.version_pb2 import VersionServiceGetResponse, Version + from metalstack.api.v2.version_pb import VersionServiceGetResponse, Version return VersionServiceGetResponse(version=Version(version="0.0")) services = { @@ -157,7 +157,7 @@ def get(self, request, ctx): interceptors=[AuthInterceptor("my-secret-token")], ) - resp = svc.get(request=ip_pb2.IPServiceGetRequest(ip="1.2.3.4")) + resp = svc.get(request=ip_pb.IPServiceGetRequest(ip="1.2.3.4")) assert resp.ip.ip == "1.2.3.4" assert ips.received_auth == "Bearer my-secret-token" @@ -166,7 +166,7 @@ def test_interceptor_on_client_wrapper(self, test_client, mock_ip_service): """Client wrapper passes headers through to the underlying service.""" token = "wrapper-test-token" resp = test_client.apiv2().ip().get( - request=ip_pb2.IPServiceGetRequest(ip="5.6.7.8"), + request=ip_pb.IPServiceGetRequest(ip="5.6.7.8"), headers={"authorization": f"Bearer {token}"}, ) assert resp.ip.ip == "5.6.7.8" diff --git a/python/metalstack/client/tests/test_ping.py b/python/metalstack/client/tests/test_ping.py index 4985ede4..4514a5fd 100644 --- a/python/metalstack/client/tests/test_ping.py +++ b/python/metalstack/client/tests/test_ping.py @@ -10,11 +10,11 @@ from datetime import timedelta import pytest -from google.protobuf import duration_pb2, timestamp_pb2 +from google.protobuf import duration_pb, timestamp_pb -from metalstack.api.v2 import component_pb2 as api_component_pb2 -from metalstack.api.v2 import version_pb2 -from metalstack.infra.v2 import component_pb2 as infra_component_pb2 +from metalstack.api.v2 import component_pb as api_component_pb +from metalstack.api.v2 import version_pb +from metalstack.infra.v2 import component_pb as infra_component_pb class TestPing: @@ -26,13 +26,13 @@ class TestPing: def test_ping_request_fields(self, test_client, mock_component_service): """Ping request contains correct component type, identifier, started_at, interval, version.""" - started_at = timestamp_pb2.Timestamp(seconds=1000) - interval = duration_pb2.Duration(seconds=5) - version = version_pb2.Version(version="1.0.0", git_sha1="abc123") + started_at = timestamp_pb.Timestamp(seconds=1000) + interval = duration_pb.Duration(seconds=5) + version = version_pb.Version(version="1.0.0", git_sha1="abc123") resp = test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + request=infra_component_pb.ComponentServicePingRequest( + type=api_component_pb.COMPONENT_TYPE_METAL_CORE, identifier="server01", started_at=started_at, interval=interval, @@ -45,7 +45,7 @@ def test_ping_request_fields(self, test_client, mock_component_service): assert len(mock_component_service.pings) == 1 ping = mock_component_service.pings[0] - assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE + assert ping.type == api_component_pb.COMPONENT_TYPE_METAL_CORE assert ping.identifier == "server01" assert ping.started_at.seconds == 1000 assert ping.interval.seconds == 5 @@ -54,13 +54,13 @@ def test_ping_request_fields(self, test_client, mock_component_service): def test_ping_multiple_requests(self, test_client, mock_component_service): """Multiple ping calls are recorded correctly.""" - started_at = timestamp_pb2.Timestamp(seconds=2000) - interval = duration_pb2.Duration(seconds=10) + started_at = timestamp_pb.Timestamp(seconds=2000) + interval = duration_pb.Duration(seconds=10) for _ in range(3): test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + request=infra_component_pb.ComponentServicePingRequest( + type=api_component_pb.COMPONENT_TYPE_METAL_CORE, identifier="server02", started_at=started_at, interval=interval, @@ -71,21 +71,21 @@ def test_ping_multiple_requests(self, test_client, mock_component_service): assert len(mock_component_service.pings) == 3 for ping in mock_component_service.pings: assert ping.identifier == "server02" - assert ping.type == api_component_pb2.COMPONENT_TYPE_METAL_CORE + assert ping.type == api_component_pb.COMPONENT_TYPE_METAL_CORE assert ping.started_at.seconds == 2000 assert ping.interval.seconds == 10 def test_ping_background_simulation(self, test_client, mock_component_service): """Simulate background pinging from a thread, similar to Go's ticker goroutine.""" - started_at = timestamp_pb2.Timestamp(seconds=3000) - interval = duration_pb2.Duration(seconds=1) + started_at = timestamp_pb.Timestamp(seconds=3000) + interval = duration_pb.Duration(seconds=1) ping_count = 5 def do_pings(): for _ in range(ping_count): test_client.infrav2().component().ping( - request=infra_component_pb2.ComponentServicePingRequest( - type=api_component_pb2.COMPONENT_TYPE_METAL_CORE, + request=infra_component_pb.ComponentServicePingRequest( + type=api_component_pb.COMPONENT_TYPE_METAL_CORE, identifier="background-worker", started_at=started_at, interval=interval, diff --git a/python/metalstack/infra/__init__.py b/python/metalstack/infra/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/infra/__init__.py +++ b/python/metalstack/infra/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/infra/v2/__init__.py b/python/metalstack/infra/v2/__init__.py index e69de29b..9d48db4f 100644 --- a/python/metalstack/infra/v2/__init__.py +++ b/python/metalstack/infra/v2/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/python/metalstack/infra/v2/bmc_connect.py b/python/metalstack/infra/v2/bmc_connect.py index 71141f57..67143905 100644 --- a/python/metalstack/infra/v2/bmc_connect.py +++ b/python/metalstack/infra/v2/bmc_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/infra/v2/bmc.proto +# Generated from metalstack/infra/v2/bmc.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.infra.v2.bmc_pb2 as metalstack_dot_infra_dot_v2_dot_bmc__pb2 + +from .bmc_pb import BMCCommandDoneRequest, BMCCommandDoneResponse, UpdateBMCInfoRequest, UpdateBMCInfoResponse, WaitForBMCCommandRequest, WaitForBMCCommandResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class BMCService(Protocol): - async def update_b_m_c_info(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def update_bmc_info(self, request: UpdateBMCInfoRequest, ctx: RequestContext[UpdateBMCInfoRequest, UpdateBMCInfoResponse]) -> UpdateBMCInfoResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - def wait_for_b_m_c_command(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, ctx: RequestContext) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse]: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def wait_for_bmc_command(self, request: WaitForBMCCommandRequest, ctx: RequestContext[WaitForBMCCommandRequest, WaitForBMCCommandResponse]) -> AsyncIterator[WaitForBMCCommandResponse]: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def b_m_c_command_done(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def bmc_command_done(self, request: BMCCommandDoneRequest, ctx: RequestContext[BMCCommandDoneRequest, BMCCommandDoneResponse]) -> BMCCommandDoneResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class BMCServiceASGIApplication(ConnectASGIApplication[BMCService]): - def __init__(self, service: BMCService | AsyncGenerator[BMCService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: BMCService | AsyncGenerator[BMCService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,31 +53,31 @@ def __init__(self, service: BMCService | AsyncGenerator[BMCService], *, intercep method=MethodInfo( name="UpdateBMCInfo", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse, + input=UpdateBMCInfoRequest, + output=UpdateBMCInfoResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.update_b_m_c_info, + function=svc.update_bmc_info, ), "/metalstack.infra.v2.BMCService/WaitForBMCCommand": Endpoint.server_stream( method=MethodInfo( name="WaitForBMCCommand", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse, + input=WaitForBMCCommandRequest, + output=WaitForBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.wait_for_b_m_c_command, + function=svc.wait_for_bmc_command, ), "/metalstack.infra.v2.BMCService/BMCCommandDone": Endpoint.unary( method=MethodInfo( name="BMCCommandDone", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse, + input=BMCCommandDoneRequest, + output=BMCCommandDoneResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=svc.b_m_c_command_done, + function=svc.bmc_command_done, ), }, interceptors=interceptors, @@ -77,112 +93,117 @@ def path(self) -> str: class BMCServiceClient(ConnectClient): - async def update_b_m_c_info( + async def update_bmc_info( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, + request: UpdateBMCInfoRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse: + ) -> UpdateBMCInfoResponse: return await self.execute_unary( request=request, method=MethodInfo( name="UpdateBMCInfo", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse, + input=UpdateBMCInfoRequest, + output=UpdateBMCInfoResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def wait_for_b_m_c_command( + def wait_for_bmc_command( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, + request: WaitForBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse]: + ) -> AsyncIterator[WaitForBMCCommandResponse]: return self.execute_server_stream( request=request, method=MethodInfo( name="WaitForBMCCommand", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse, + input=WaitForBMCCommandRequest, + output=WaitForBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - async def b_m_c_command_done( + async def bmc_command_done( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, + request: BMCCommandDoneRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse: + ) -> BMCCommandDoneResponse: return await self.execute_unary( request=request, method=MethodInfo( name="BMCCommandDone", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse, + input=BMCCommandDoneRequest, + output=BMCCommandDoneResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class BMCServiceSync(Protocol): + def update_bmc_info(self, request: UpdateBMCInfoRequest, ctx: RequestContext[UpdateBMCInfoRequest, UpdateBMCInfoResponse]) -> UpdateBMCInfoResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def wait_for_bmc_command(self, request: WaitForBMCCommandRequest, ctx: RequestContext[WaitForBMCCommandRequest, WaitForBMCCommandResponse]) -> Iterator[WaitForBMCCommandResponse]: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class BMCServiceSync(Protocol): - def update_b_m_c_info(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def wait_for_b_m_c_command(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, ctx: RequestContext) -> Iterator[metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse]: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def b_m_c_command_done(self, request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def bmc_command_done(self, request: BMCCommandDoneRequest, ctx: RequestContext[BMCCommandDoneRequest, BMCCommandDoneResponse]) -> BMCCommandDoneResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class BMCServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: BMCServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: BMCServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.infra.v2.BMCService/UpdateBMCInfo": EndpointSync.unary( method=MethodInfo( name="UpdateBMCInfo", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse, + input=UpdateBMCInfoRequest, + output=UpdateBMCInfoResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.update_b_m_c_info, + function=service.update_bmc_info, ), "/metalstack.infra.v2.BMCService/WaitForBMCCommand": EndpointSync.server_stream( method=MethodInfo( name="WaitForBMCCommand", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse, + input=WaitForBMCCommandRequest, + output=WaitForBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.wait_for_b_m_c_command, + function=service.wait_for_bmc_command, ), "/metalstack.infra.v2.BMCService/BMCCommandDone": EndpointSync.unary( method=MethodInfo( name="BMCCommandDone", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse, + input=BMCCommandDoneRequest, + output=BMCCommandDoneResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), - function=service.b_m_c_command_done, + function=service.bmc_command_done, ), }, interceptors=interceptors, @@ -198,64 +219,60 @@ def path(self) -> str: class BMCServiceClientSync(ConnectClientSync): - def update_b_m_c_info( + def update_bmc_info( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, + request: UpdateBMCInfoRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse: + ) -> UpdateBMCInfoResponse: return self.execute_unary( request=request, method=MethodInfo( name="UpdateBMCInfo", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.UpdateBMCInfoResponse, + input=UpdateBMCInfoRequest, + output=UpdateBMCInfoResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def wait_for_b_m_c_command( + def wait_for_bmc_command( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, + request: WaitForBMCCommandRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> Iterator[metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse]: + ) -> Iterator[WaitForBMCCommandResponse]: return self.execute_server_stream( request=request, method=MethodInfo( name="WaitForBMCCommand", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.WaitForBMCCommandResponse, + input=WaitForBMCCommandRequest, + output=WaitForBMCCommandResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - def b_m_c_command_done( + def bmc_command_done( self, - request: metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, + request: BMCCommandDoneRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse: + ) -> BMCCommandDoneResponse: return self.execute_unary( request=request, method=MethodInfo( name="BMCCommandDone", service_name="metalstack.infra.v2.BMCService", - input=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneRequest, - output=metalstack_dot_infra_dot_v2_dot_bmc__pb2.BMCCommandDoneResponse, + input=BMCCommandDoneRequest, + output=BMCCommandDoneResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/infra/v2/bmc_pb.py b/python/metalstack/infra/v2/bmc_pb.py new file mode 100644 index 00000000..d3196f3e --- /dev/null +++ b/python/metalstack/infra/v2/bmc_pb.py @@ -0,0 +1,275 @@ +# Generated from metalstack/infra/v2/bmc.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, machine_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.machine_pb import MachineBMC, MachineBMCCommand, MachineBMCReport + + +_UpdateBMCInfoRequestFields: TypeAlias = Literal["partition", "bmc_reports"] + +class UpdateBMCInfoRequest(Message[_UpdateBMCInfoRequestFields]): + """ + UpdateBMCInfoRequest is the request payload for updating BMC information. + + ```proto + message metalstack.infra.v2.UpdateBMCInfoRequest + ``` + + Attributes: + partition: + Partition is the partition ID where metal-bmc wants to receive events + + ```proto + string partition = 1; + ``` + bmc_reports: + BmcReports maps the BMC report per machine UUID + + ```proto + map bmc_reports = 2; + ``` + """ + + __slots__ = ("partition", "bmc_reports") + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: str = "", + bmc_reports: dict[str, MachineBMCReport] | None = None, + ) -> None: + pass + + partition: str + bmc_reports: dict[str, MachineBMCReport] + +_UpdateBMCInfoResponseFields: TypeAlias = Literal["updated_machines", "created_machines"] + +class UpdateBMCInfoResponse(Message[_UpdateBMCInfoResponseFields]): + """ + UpdateBMCInfoResponse is the response payload for updating BMC information. + + ```proto + message metalstack.infra.v2.UpdateBMCInfoResponse + ``` + + Attributes: + updated_machines: + UpdatedMachines is a slice of machine UUIDs which were updated + + ```proto + repeated string updated_machines = 1; + ``` + created_machines: + CreatedMachines is a slice of machine UUIDs which were created + + ```proto + repeated string created_machines = 2; + ``` + """ + + __slots__ = ("updated_machines", "created_machines") + + if TYPE_CHECKING: + + def __init__( + self, + *, + updated_machines: list[str] | None = None, + created_machines: list[str] | None = None, + ) -> None: + pass + + updated_machines: list[str] + created_machines: list[str] + +_WaitForBMCCommandRequestFields: TypeAlias = Literal["partition"] + +class WaitForBMCCommandRequest(Message[_WaitForBMCCommandRequestFields]): + """ + WaitForBMCCommandRequest is the request payload for waiting for a BMC command. + + ```proto + message metalstack.infra.v2.WaitForBMCCommandRequest + ``` + + Attributes: + partition: + Partition is the partition ID where metal-bmc wants to receive BMC commands + + ```proto + string partition = 1; + ``` + """ + + __slots__ = ("partition",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + partition: str = "", + ) -> None: + pass + + partition: str + +_WaitForBMCCommandResponseFields: TypeAlias = Literal["uuid", "bmc_command", "machine_bmc", "command_id"] + +class WaitForBMCCommandResponse(Message[_WaitForBMCCommandResponseFields]): + """ + WaitForBMCCommandResponse is the response payload for waiting for a BMC command. + + ```proto + message metalstack.infra.v2.WaitForBMCCommandResponse + ``` + + Attributes: + uuid: + UUID of the machine to send the command to + + ```proto + string uuid = 1; + ``` + bmc_command: + BmcCommand to execute against the BMC of the machine + + ```proto + metalstack.api.v2.MachineBMCCommand bmc_command = 2; + ``` + machine_bmc: + MachineBmc contains connection details of the machine to issue the BMC command to + + ```proto + optional metalstack.api.v2.MachineBMC machine_bmc = 3; + ``` + command_id: + CommandId is a unique ID which must be sent back after execution + It is usually in the form: :machine-bmc-command: + + ```proto + string command_id = 4; + ``` + """ + + __slots__ = ("uuid", "bmc_command", "machine_bmc", "command_id") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + bmc_command: MachineBMCCommand | None = None, + machine_bmc: MachineBMC | None = None, + command_id: str = "", + ) -> None: + pass + + uuid: str + bmc_command: MachineBMCCommand + machine_bmc: MachineBMC | None + command_id: str + +_BMCCommandDoneRequestFields: TypeAlias = Literal["command_id", "error"] + +class BMCCommandDoneRequest(Message[_BMCCommandDoneRequestFields]): + """ + BMCCommandDoneRequest must be returned after command execution. + + ```proto + message metalstack.infra.v2.BMCCommandDoneRequest + ``` + + Attributes: + command_id: + CommandId is a unique ID which must be sent back after execution + It is usually in the form: :machine-bmc-command + + ```proto + string command_id = 1; + ``` + error: + Error of the command execution, nil if it was successful + + ```proto + optional string error = 2; + ``` + """ + + __slots__ = ("command_id", "error") + + if TYPE_CHECKING: + + def __init__( + self, + *, + command_id: str = "", + error: str | None = None, + ) -> None: + pass + + command_id: str + error: str + +_BMCCommandDoneResponseFields: TypeAlias = NoReturn + +class BMCCommandDoneResponse(Message[_BMCCommandDoneResponseFields]): + """ + BMCCommandDoneResponse is the response payload for BMC command completion. + + ```proto + message metalstack.infra.v2.BMCCommandDoneResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + + +_DESC = file_desc( + b'\n\x1dmetalstack/infra/v2/bmc.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto"\x90\x02\n\x14UpdateBMCInfoRequest\x12)\n\tpartition\x18\x01 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01\x12i\n\x0bbmc_reports\x18\x02 \x03(\x0b29.metalstack.infra.v2.UpdateBMCInfoRequest.BmcReportsEntryR\nbmcReportsB\r\xbaH\n\x9a\x01\x07"\x05r\x03\xb0\x01\x01\x1ab\n\x0fBmcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x129\n\x05value\x18\x02 \x01(\x0b2#.metalstack.api.v2.MachineBMCReportR\x05value:\x028\x01"m\n\x15UpdateBMCInfoResponse\x12)\n\x10updated_machines\x18\x01 \x03(\tR\x0fupdatedMachines\x12)\n\x10created_machines\x18\x02 \x03(\tR\x0fcreatedMachines"E\n\x18WaitForBMCCommandRequest\x12)\n\tpartition\x18\x01 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"\xdf\x01\n\x19WaitForBMCCommandResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12E\n\x0bbmc_command\x18\x02 \x01(\x0e2$.metalstack.api.v2.MachineBMCCommandR\nbmcCommand\x12>\n\x0bmachine_bmc\x18\x03 \x01(\x0b2\x1d.metalstack.api.v2.MachineBMCR\nmachineBmc\x12\x1d\n\ncommand_id\x18\x04 \x01(\tR\tcommandId"[\n\x15BMCCommandDoneRequest\x12\x1d\n\ncommand_id\x18\x01 \x01(\tR\tcommandId\x12\x19\n\x05error\x18\x02 \x01(\tH\x00R\x05error\x88\x01\x01B\x08\n\x06_error"\x18\n\x16BMCCommandDoneResponse2\xf6\x02\n\nBMCService\x12q\n\rUpdateBMCInfo\x12).metalstack.infra.v2.UpdateBMCInfoRequest\x1a*.metalstack.infra.v2.UpdateBMCInfoResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x7f\n\x11WaitForBMCCommand\x12-.metalstack.infra.v2.WaitForBMCCommandRequest\x1a..metalstack.infra.v2.WaitForBMCCommandResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x010\x01\x12t\n\x0eBMCCommandDone\x12*.metalstack.infra.v2.BMCCommandDoneRequest\x1a+.metalstack.infra.v2.BMCCommandDoneResponse"\t\xe0\xf3\x18\x01\xea\xf3\x18\x01\x01B\xcc\x01\n\x17com.metalstack.infra.v2B\x08BmcProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + machine_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "UpdateBMCInfoRequest": UpdateBMCInfoRequest, + "UpdateBMCInfoResponse": UpdateBMCInfoResponse, + "WaitForBMCCommandRequest": WaitForBMCCommandRequest, + "WaitForBMCCommandResponse": WaitForBMCCommandResponse, + "BMCCommandDoneRequest": BMCCommandDoneRequest, + "BMCCommandDoneResponse": BMCCommandDoneResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/infra/v2/bmc.proto`.""" + return _DESC diff --git a/python/metalstack/infra/v2/bmc_pb2.py b/python/metalstack/infra/v2/bmc_pb2.py deleted file mode 100644 index 6be5d38d..00000000 --- a/python/metalstack/infra/v2/bmc_pb2.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/infra/v2/bmc.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/infra/v2/bmc.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1dmetalstack/infra/v2/bmc.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\x90\x02\n\x14UpdateBMCInfoRequest\x12)\n\tpartition\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\x12i\n\x0b\x62mc_reports\x18\x02 \x03(\x0b\x32\x39.metalstack.infra.v2.UpdateBMCInfoRequest.BmcReportsEntryB\r\xbaH\n\x9a\x01\x07\"\x05r\x03\xb0\x01\x01R\nbmcReports\x1a\x62\n\x0f\x42mcReportsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32#.metalstack.api.v2.MachineBMCReportR\x05value:\x02\x38\x01\"m\n\x15UpdateBMCInfoResponse\x12)\n\x10updated_machines\x18\x01 \x03(\tR\x0fupdatedMachines\x12)\n\x10\x63reated_machines\x18\x02 \x03(\tR\x0f\x63reatedMachines\"E\n\x18WaitForBMCCommandRequest\x12)\n\tpartition\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\"\xdf\x01\n\x19WaitForBMCCommandResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x45\n\x0b\x62mc_command\x18\x02 \x01(\x0e\x32$.metalstack.api.v2.MachineBMCCommandR\nbmcCommand\x12>\n\x0bmachine_bmc\x18\x03 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineBMCR\nmachineBmc\x12\x1d\n\ncommand_id\x18\x04 \x01(\tR\tcommandId\"[\n\x15\x42MCCommandDoneRequest\x12\x1d\n\ncommand_id\x18\x01 \x01(\tR\tcommandId\x12\x19\n\x05\x65rror\x18\x02 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_error\"\x18\n\x16\x42MCCommandDoneResponse2\xf6\x02\n\nBMCService\x12q\n\rUpdateBMCInfo\x12).metalstack.infra.v2.UpdateBMCInfoRequest\x1a*.metalstack.infra.v2.UpdateBMCInfoResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x7f\n\x11WaitForBMCCommand\x12-.metalstack.infra.v2.WaitForBMCCommandRequest\x1a..metalstack.infra.v2.WaitForBMCCommandResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x30\x01\x12t\n\x0e\x42MCCommandDone\x12*.metalstack.infra.v2.BMCCommandDoneRequest\x1a+.metalstack.infra.v2.BMCCommandDoneResponse\"\t\xe0\xf3\x18\x01\xea\xf3\x18\x01\x01\x42\xcc\x01\n\x17\x63om.metalstack.infra.v2B\x08\x42mcProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.bmc_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\010BmcProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' - _globals['_UPDATEBMCINFOREQUEST_BMCREPORTSENTRY']._loaded_options = None - _globals['_UPDATEBMCINFOREQUEST_BMCREPORTSENTRY']._serialized_options = b'8\001' - _globals['_UPDATEBMCINFOREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_UPDATEBMCINFOREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_UPDATEBMCINFOREQUEST'].fields_by_name['bmc_reports']._loaded_options = None - _globals['_UPDATEBMCINFOREQUEST'].fields_by_name['bmc_reports']._serialized_options = b'\272H\n\232\001\007\"\005r\003\260\001\001' - _globals['_WAITFORBMCCOMMANDREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_WAITFORBMCCOMMANDREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_WAITFORBMCCOMMANDRESPONSE'].fields_by_name['uuid']._loaded_options = None - _globals['_WAITFORBMCCOMMANDRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BMCSERVICE'].methods_by_name['UpdateBMCInfo']._loaded_options = None - _globals['_BMCSERVICE'].methods_by_name['UpdateBMCInfo']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_BMCSERVICE'].methods_by_name['WaitForBMCCommand']._loaded_options = None - _globals['_BMCSERVICE'].methods_by_name['WaitForBMCCommand']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_BMCSERVICE'].methods_by_name['BMCCommandDone']._loaded_options = None - _globals['_BMCSERVICE'].methods_by_name['BMCCommandDone']._serialized_options = b'\340\363\030\001\352\363\030\001\001' - _globals['_UPDATEBMCINFOREQUEST']._serialized_start=191 - _globals['_UPDATEBMCINFOREQUEST']._serialized_end=463 - _globals['_UPDATEBMCINFOREQUEST_BMCREPORTSENTRY']._serialized_start=365 - _globals['_UPDATEBMCINFOREQUEST_BMCREPORTSENTRY']._serialized_end=463 - _globals['_UPDATEBMCINFORESPONSE']._serialized_start=465 - _globals['_UPDATEBMCINFORESPONSE']._serialized_end=574 - _globals['_WAITFORBMCCOMMANDREQUEST']._serialized_start=576 - _globals['_WAITFORBMCCOMMANDREQUEST']._serialized_end=645 - _globals['_WAITFORBMCCOMMANDRESPONSE']._serialized_start=648 - _globals['_WAITFORBMCCOMMANDRESPONSE']._serialized_end=871 - _globals['_BMCCOMMANDDONEREQUEST']._serialized_start=873 - _globals['_BMCCOMMANDDONEREQUEST']._serialized_end=964 - _globals['_BMCCOMMANDDONERESPONSE']._serialized_start=966 - _globals['_BMCCOMMANDDONERESPONSE']._serialized_end=990 - _globals['_BMCSERVICE']._serialized_start=993 - _globals['_BMCSERVICE']._serialized_end=1367 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/bmc_pb2.pyi b/python/metalstack/infra/v2/bmc_pb2.pyi deleted file mode 100644 index 25feae67..00000000 --- a/python/metalstack/infra/v2/bmc_pb2.pyi +++ /dev/null @@ -1,64 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class UpdateBMCInfoRequest(_message.Message): - __slots__ = ("partition", "bmc_reports") - class BmcReportsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _machine_pb2.MachineBMCReport - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_machine_pb2.MachineBMCReport, _Mapping]] = ...) -> None: ... - PARTITION_FIELD_NUMBER: _ClassVar[int] - BMC_REPORTS_FIELD_NUMBER: _ClassVar[int] - partition: str - bmc_reports: _containers.MessageMap[str, _machine_pb2.MachineBMCReport] - def __init__(self, partition: _Optional[str] = ..., bmc_reports: _Optional[_Mapping[str, _machine_pb2.MachineBMCReport]] = ...) -> None: ... - -class UpdateBMCInfoResponse(_message.Message): - __slots__ = ("updated_machines", "created_machines") - UPDATED_MACHINES_FIELD_NUMBER: _ClassVar[int] - CREATED_MACHINES_FIELD_NUMBER: _ClassVar[int] - updated_machines: _containers.RepeatedScalarFieldContainer[str] - created_machines: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, updated_machines: _Optional[_Iterable[str]] = ..., created_machines: _Optional[_Iterable[str]] = ...) -> None: ... - -class WaitForBMCCommandRequest(_message.Message): - __slots__ = ("partition",) - PARTITION_FIELD_NUMBER: _ClassVar[int] - partition: str - def __init__(self, partition: _Optional[str] = ...) -> None: ... - -class WaitForBMCCommandResponse(_message.Message): - __slots__ = ("uuid", "bmc_command", "machine_bmc", "command_id") - UUID_FIELD_NUMBER: _ClassVar[int] - BMC_COMMAND_FIELD_NUMBER: _ClassVar[int] - MACHINE_BMC_FIELD_NUMBER: _ClassVar[int] - COMMAND_ID_FIELD_NUMBER: _ClassVar[int] - uuid: str - bmc_command: _machine_pb2.MachineBMCCommand - machine_bmc: _machine_pb2.MachineBMC - command_id: str - def __init__(self, uuid: _Optional[str] = ..., bmc_command: _Optional[_Union[_machine_pb2.MachineBMCCommand, str]] = ..., machine_bmc: _Optional[_Union[_machine_pb2.MachineBMC, _Mapping]] = ..., command_id: _Optional[str] = ...) -> None: ... - -class BMCCommandDoneRequest(_message.Message): - __slots__ = ("command_id", "error") - COMMAND_ID_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - command_id: str - error: str - def __init__(self, command_id: _Optional[str] = ..., error: _Optional[str] = ...) -> None: ... - -class BMCCommandDoneResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... diff --git a/python/metalstack/infra/v2/boot_connect.py b/python/metalstack/infra/v2/boot_connect.py index 3cc39a22..e8386e40 100644 --- a/python/metalstack/infra/v2/boot_connect.py +++ b/python/metalstack/infra/v2/boot_connect.py @@ -1,44 +1,60 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/infra/v2/boot.proto +# Generated from metalstack/infra/v2/boot.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.infra.v2.boot_pb2 as metalstack_dot_infra_dot_v2_dot_boot__pb2 + +from .boot_pb import BootServiceBootRequest, BootServiceBootResponse, BootServiceDhcpRequest, BootServiceDhcpResponse, BootServiceInstallationSucceededRequest, BootServiceInstallationSucceededResponse, BootServiceRegisterRequest, BootServiceRegisterResponse, BootServiceSuperUserPasswordRequest, BootServiceSuperUserPasswordResponse, BootServiceWaitRequest, BootServiceWaitResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class BootService(Protocol): - async def dhcp(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def dhcp(self, request: BootServiceDhcpRequest, ctx: RequestContext[BootServiceDhcpRequest, BootServiceDhcpResponse]) -> BootServiceDhcpResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def boot(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def boot(self, request: BootServiceBootRequest, ctx: RequestContext[BootServiceBootRequest, BootServiceBootResponse]) -> BootServiceBootResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def super_user_password(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def super_user_password(self, request: BootServiceSuperUserPasswordRequest, ctx: RequestContext[BootServiceSuperUserPasswordRequest, BootServiceSuperUserPasswordResponse]) -> BootServiceSuperUserPasswordResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def register(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def register(self, request: BootServiceRegisterRequest, ctx: RequestContext[BootServiceRegisterRequest, BootServiceRegisterResponse]) -> BootServiceRegisterResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - def wait(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: RequestContext) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def wait(self, request: BootServiceWaitRequest, ctx: RequestContext[BootServiceWaitRequest, BootServiceWaitResponse]) -> AsyncIterator[BootServiceWaitResponse]: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def installation_succeeded(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def installation_succeeded(self, request: BootServiceInstallationSucceededRequest, ctx: RequestContext[BootServiceInstallationSucceededRequest, BootServiceInstallationSucceededResponse]) -> BootServiceInstallationSucceededResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class BootServiceASGIApplication(ConnectASGIApplication[BootService]): - def __init__(self, service: BootService | AsyncGenerator[BootService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: BootService | AsyncGenerator[BootService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -46,8 +62,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="Dhcp", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + input=BootServiceDhcpRequest, + output=BootServiceDhcpResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.dhcp, @@ -56,8 +72,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="Boot", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + input=BootServiceBootRequest, + output=BootServiceBootResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.boot, @@ -66,8 +82,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="SuperUserPassword", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + input=BootServiceSuperUserPasswordRequest, + output=BootServiceSuperUserPasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.super_user_password, @@ -76,8 +92,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="Register", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + input=BootServiceRegisterRequest, + output=BootServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.register, @@ -86,8 +102,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="Wait", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + input=BootServiceWaitRequest, + output=BootServiceWaitResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.wait, @@ -96,8 +112,8 @@ def __init__(self, service: BootService | AsyncGenerator[BootService], *, interc method=MethodInfo( name="InstallationSucceeded", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse, + input=BootServiceInstallationSucceededRequest, + output=BootServiceInstallationSucceededResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.installation_succeeded, @@ -118,18 +134,18 @@ def path(self) -> str: class BootServiceClient(ConnectClient): async def dhcp( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + request: BootServiceDhcpRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + ) -> BootServiceDhcpResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Dhcp", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + input=BootServiceDhcpRequest, + output=BootServiceDhcpResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -138,18 +154,18 @@ async def dhcp( async def boot( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + request: BootServiceBootRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + ) -> BootServiceBootResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Boot", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + input=BootServiceBootRequest, + output=BootServiceBootResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -158,18 +174,18 @@ async def boot( async def super_user_password( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + request: BootServiceSuperUserPasswordRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + ) -> BootServiceSuperUserPasswordResponse: return await self.execute_unary( request=request, method=MethodInfo( name="SuperUserPassword", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + input=BootServiceSuperUserPasswordRequest, + output=BootServiceSuperUserPasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -178,18 +194,18 @@ async def super_user_password( async def register( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + request: BootServiceRegisterRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + ) -> BootServiceRegisterResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Register", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + input=BootServiceRegisterRequest, + output=BootServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -198,18 +214,18 @@ async def register( def wait( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + request: BootServiceWaitRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> AsyncIterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + ) -> AsyncIterator[BootServiceWaitResponse]: return self.execute_server_stream( request=request, method=MethodInfo( name="Wait", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + input=BootServiceWaitRequest, + output=BootServiceWaitResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -218,53 +234,61 @@ def wait( async def installation_succeeded( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, + request: BootServiceInstallationSucceededRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse: + ) -> BootServiceInstallationSucceededResponse: return await self.execute_unary( request=request, method=MethodInfo( name="InstallationSucceeded", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse, + input=BootServiceInstallationSucceededRequest, + output=BootServiceInstallationSucceededResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class BootServiceSync(Protocol): + def dhcp(self, request: BootServiceDhcpRequest, ctx: RequestContext[BootServiceDhcpRequest, BootServiceDhcpResponse]) -> BootServiceDhcpResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + + def boot(self, request: BootServiceBootRequest, ctx: RequestContext[BootServiceBootRequest, BootServiceBootResponse]) -> BootServiceBootResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def super_user_password(self, request: BootServiceSuperUserPasswordRequest, ctx: RequestContext[BootServiceSuperUserPasswordRequest, BootServiceSuperUserPasswordResponse]) -> BootServiceSuperUserPasswordResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def register(self, request: BootServiceRegisterRequest, ctx: RequestContext[BootServiceRegisterRequest, BootServiceRegisterResponse]) -> BootServiceRegisterResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def wait(self, request: BootServiceWaitRequest, ctx: RequestContext[BootServiceWaitRequest, BootServiceWaitResponse]) -> Iterator[BootServiceWaitResponse]: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') -class BootServiceSync(Protocol): - def dhcp(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def boot(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def super_user_password(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def register(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def wait(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, ctx: RequestContext) -> Iterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def installation_succeeded(self, request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def installation_succeeded(self, request: BootServiceInstallationSucceededRequest, ctx: RequestContext[BootServiceInstallationSucceededRequest, BootServiceInstallationSucceededResponse]) -> BootServiceInstallationSucceededResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class BootServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: BootServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.infra.v2.BootService/Dhcp": EndpointSync.unary( method=MethodInfo( name="Dhcp", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + input=BootServiceDhcpRequest, + output=BootServiceDhcpResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.dhcp, @@ -273,8 +297,8 @@ def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Boot", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + input=BootServiceBootRequest, + output=BootServiceBootResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.boot, @@ -283,8 +307,8 @@ def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="SuperUserPassword", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + input=BootServiceSuperUserPasswordRequest, + output=BootServiceSuperUserPasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.super_user_password, @@ -293,8 +317,8 @@ def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Register", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + input=BootServiceRegisterRequest, + output=BootServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.register, @@ -303,8 +327,8 @@ def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="Wait", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + input=BootServiceWaitRequest, + output=BootServiceWaitResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.wait, @@ -313,8 +337,8 @@ def __init__(self, service: BootServiceSync, interceptors: Iterable[InterceptorS method=MethodInfo( name="InstallationSucceeded", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse, + input=BootServiceInstallationSucceededRequest, + output=BootServiceInstallationSucceededResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.installation_succeeded, @@ -335,122 +359,115 @@ def path(self) -> str: class BootServiceClientSync(ConnectClientSync): def dhcp( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, + request: BootServiceDhcpRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse: + ) -> BootServiceDhcpResponse: return self.execute_unary( request=request, method=MethodInfo( name="Dhcp", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceDhcpResponse, + input=BootServiceDhcpRequest, + output=BootServiceDhcpResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def boot( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, + request: BootServiceBootRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse: + ) -> BootServiceBootResponse: return self.execute_unary( request=request, method=MethodInfo( name="Boot", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceBootResponse, + input=BootServiceBootRequest, + output=BootServiceBootResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def super_user_password( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, + request: BootServiceSuperUserPasswordRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse: + ) -> BootServiceSuperUserPasswordResponse: return self.execute_unary( request=request, method=MethodInfo( name="SuperUserPassword", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceSuperUserPasswordResponse, + input=BootServiceSuperUserPasswordRequest, + output=BootServiceSuperUserPasswordResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def register( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, + request: BootServiceRegisterRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse: + ) -> BootServiceRegisterResponse: return self.execute_unary( request=request, method=MethodInfo( name="Register", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceRegisterResponse, + input=BootServiceRegisterRequest, + output=BootServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def wait( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, + request: BootServiceWaitRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> Iterator[metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse]: + ) -> Iterator[BootServiceWaitResponse]: return self.execute_server_stream( request=request, method=MethodInfo( name="Wait", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceWaitResponse, + input=BootServiceWaitRequest, + output=BootServiceWaitResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def installation_succeeded( self, - request: metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, + request: BootServiceInstallationSucceededRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse: + ) -> BootServiceInstallationSucceededResponse: return self.execute_unary( request=request, method=MethodInfo( name="InstallationSucceeded", service_name="metalstack.infra.v2.BootService", - input=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededRequest, - output=metalstack_dot_infra_dot_v2_dot_boot__pb2.BootServiceInstallationSucceededResponse, + input=BootServiceInstallationSucceededRequest, + output=BootServiceInstallationSucceededResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/infra/v2/boot_pb.py b/python/metalstack/infra/v2/boot_pb.py new file mode 100644 index 00000000..bd42f72d --- /dev/null +++ b/python/metalstack/infra/v2/boot_pb.py @@ -0,0 +1,531 @@ +# Generated from metalstack/infra/v2/boot.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, machine_pb, predefined_rules_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.machine_pb import MachineAllocation, MachineBMC, MachineBios, MachineFRU, MachineHardware + + +_BootServiceDhcpRequestFields: TypeAlias = Literal["uuid", "partition"] + +class BootServiceDhcpRequest(Message[_BootServiceDhcpRequestFields]): + """ + BootServiceDhcpRequest is called once a machine issues a dhcp request + + ```proto + message metalstack.infra.v2.BootServiceDhcpRequest + ``` + + Attributes: + uuid: + UUID of the machine + + ```proto + string uuid = 1; + ``` + partition: + Partition where this machine is located + + ```proto + string partition = 2; + ``` + """ + + __slots__ = ("uuid", "partition") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + partition: str = "", + ) -> None: + pass + + uuid: str + partition: str + +_BootServiceDhcpResponseFields: TypeAlias = NoReturn + +class BootServiceDhcpResponse(Message[_BootServiceDhcpResponseFields]): + """ + BootServiceDhcpResponse contains the response to a dhcp request + + ```proto + message metalstack.infra.v2.BootServiceDhcpResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_BootServiceBootRequestFields: TypeAlias = Literal["mac", "partition"] + +class BootServiceBootRequest(Message[_BootServiceBootRequestFields]): + """ + BootServiceBootRequest is called to get specified parameters to boot a machine with the given mac + + ```proto + message metalstack.infra.v2.BootServiceBootRequest + ``` + + Attributes: + mac: + Mac address of the machine + + ```proto + string mac = 1; + ``` + partition: + Partition where this machine is located + + ```proto + string partition = 2; + ``` + """ + + __slots__ = ("mac", "partition") + + if TYPE_CHECKING: + + def __init__( + self, + *, + mac: str = "", + partition: str = "", + ) -> None: + pass + + mac: str + partition: str + +_BootServiceBootResponseFields: TypeAlias = Literal["kernel", "init_ram_disks", "cmdline"] + +class BootServiceBootResponse(Message[_BootServiceBootResponseFields]): + """ + BootServiceBootResponse contains additional infos which are required to boot a machine + + ```proto + message metalstack.infra.v2.BootServiceBootResponse + ``` + + Attributes: + kernel: + Kernel is the url to the linux kernel to boot + + ```proto + string kernel = 1; + ``` + init_ram_disks: + Initial ram disk is the url to the initial ram disk to boot + + ```proto + repeated string init_ram_disks = 2; + ``` + cmdline: + CMDLine contains kernel command line parameters to boot + + ```proto + optional string cmdline = 3; + ``` + """ + + __slots__ = ("kernel", "init_ram_disks", "cmdline") + + if TYPE_CHECKING: + + def __init__( + self, + *, + kernel: str = "", + init_ram_disks: list[str] | None = None, + cmdline: str | None = None, + ) -> None: + pass + + kernel: str + init_ram_disks: list[str] + cmdline: str + +_BootServiceRegisterRequestFields: TypeAlias = Literal["uuid", "hardware", "bios", "bmc", "fru", "tags", "metal_hammer_version", "partition"] + +class BootServiceRegisterRequest(Message[_BootServiceRegisterRequestFields]): + """ + BootServiceRegisterRequest is called from metal-hammer to register a machine with as much hardware details as possible + + ```proto + message metalstack.infra.v2.BootServiceRegisterRequest + ``` + + Attributes: + uuid: + UUID of this machine + + ```proto + string uuid = 1; + ``` + hardware: + Hardware details of this machine + + ```proto + optional metalstack.api.v2.MachineHardware hardware = 2; + ``` + bios: + Bios details of this machine + + ```proto + optional metalstack.api.v2.MachineBios bios = 3; + ``` + bmc: + BMC details of this machine + + ```proto + optional metalstack.api.v2.MachineBMC bmc = 4; + ``` + fru: + FRU details of this machine + + ```proto + optional metalstack.api.v2.MachineFRU fru = 5; + ``` + tags: + Tags of this machine + + ```proto + repeated string tags = 6; + ``` + metal_hammer_version: + MetalHammer version this machine was booted into + + ```proto + string metal_hammer_version = 7; + ``` + partition: + Partition where this machine is located + + ```proto + string partition = 8; + ``` + """ + + __slots__ = ("uuid", "hardware", "bios", "bmc", "fru", "tags", "metal_hammer_version", "partition") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + hardware: MachineHardware | None = None, + bios: MachineBios | None = None, + bmc: MachineBMC | None = None, + fru: MachineFRU | None = None, + tags: list[str] | None = None, + metal_hammer_version: str = "", + partition: str = "", + ) -> None: + pass + + uuid: str + hardware: MachineHardware | None + bios: MachineBios | None + bmc: MachineBMC | None + fru: MachineFRU | None + tags: list[str] + metal_hammer_version: str + partition: str + +_BootServiceRegisterResponseFields: TypeAlias = Literal["uuid", "size", "partition"] + +class BootServiceRegisterResponse(Message[_BootServiceRegisterResponseFields]): + """ + BootServiceRegisterResponse response to a BootServiceRegisterResponse request + + ```proto + message metalstack.infra.v2.BootServiceRegisterResponse + ``` + + Attributes: + uuid: + UUID of this machine + + ```proto + string uuid = 1; + ``` + size: + Size is the calculated size from given hardware details + + ```proto + string size = 2; + ``` + partition: + Partition of this machine + + ```proto + string partition = 3; + ``` + """ + + __slots__ = ("uuid", "size", "partition") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + size: str = "", + partition: str = "", + ) -> None: + pass + + uuid: str + size: str + partition: str + +_BootServiceWaitRequestFields: TypeAlias = Literal["uuid"] + +class BootServiceWaitRequest(Message[_BootServiceWaitRequestFields]): + """ + BootServiceWaitRequest is called when a machine was registered and is waiting for allocation + + ```proto + message metalstack.infra.v2.BootServiceWaitRequest + ``` + + Attributes: + uuid: + UUID of this machine + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_BootServiceWaitResponseFields: TypeAlias = Literal["allocation"] + +class BootServiceWaitResponse(Message[_BootServiceWaitResponseFields]): + """ + BootServiceWaitResponse response to a wait request + + ```proto + message metalstack.infra.v2.BootServiceWaitResponse + ``` + + Attributes: + allocation: + Allocation contains the machine.allocation to actually install the machine + + ```proto + optional metalstack.api.v2.MachineAllocation allocation = 1; + ``` + """ + + __slots__ = ("allocation",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + allocation: MachineAllocation | None = None, + ) -> None: + pass + + allocation: MachineAllocation | None + +_BootServiceInstallationSucceededRequestFields: TypeAlias = Literal["uuid", "console_password"] + +class BootServiceInstallationSucceededRequest(Message[_BootServiceInstallationSucceededRequestFields]): + """ + BootServiceInstallationSucceededRequest is sent from metal-hammer to the api to report the installation succeeded + + ```proto + message metalstack.infra.v2.BootServiceInstallationSucceededRequest + ``` + + Attributes: + uuid: + UUID of the machine to boot + + ```proto + string uuid = 1; + ``` + console_password: + ConsolePassword + + ```proto + string console_password = 2; + ``` + """ + + __slots__ = ("uuid", "console_password") + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + console_password: str = "", + ) -> None: + pass + + uuid: str + console_password: str + +_BootServiceInstallationSucceededResponseFields: TypeAlias = NoReturn + +class BootServiceInstallationSucceededResponse(Message[_BootServiceInstallationSucceededResponseFields]): + """ + BootServiceInstallationSucceededResponse is the response to a BootServiceInstallationSucceededRequest + + ```proto + message metalstack.infra.v2.BootServiceInstallationSucceededResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + +_BootServiceSuperUserPasswordRequestFields: TypeAlias = Literal["uuid"] + +class BootServiceSuperUserPasswordRequest(Message[_BootServiceSuperUserPasswordRequestFields]): + """ + BootServiceSuperUserPasswordRequest this call returns the password for the machine superuser + + ```proto + message metalstack.infra.v2.BootServiceSuperUserPasswordRequest + ``` + + Attributes: + uuid: + UUID of this machine + + ```proto + string uuid = 1; + ``` + """ + + __slots__ = ("uuid",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + uuid: str = "", + ) -> None: + pass + + uuid: str + +_BootServiceSuperUserPasswordResponseFields: TypeAlias = Literal["feature_disabled", "super_user_password"] + +class BootServiceSuperUserPasswordResponse(Message[_BootServiceSuperUserPasswordResponseFields]): + """ + BootServiceSuperUserPasswordResponse the super user password is returned + + ```proto + message metalstack.infra.v2.BootServiceSuperUserPasswordResponse + ``` + + Attributes: + feature_disabled: + FeatureDisabled on set the superuserpassword in the bmc if this feature is not disabled. + + ```proto + bool feature_disabled = 1; + ``` + super_user_password: + SuperUserPassword is the password of the superuser on the ipmi device + + ```proto + string super_user_password = 2; + ``` + """ + + __slots__ = ("feature_disabled", "super_user_password") + + if TYPE_CHECKING: + + def __init__( + self, + *, + feature_disabled: bool = False, + super_user_password: str = "", + ) -> None: + pass + + feature_disabled: bool + super_user_password: str + + +_DESC = file_desc( + b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto"a\n\x16BootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12)\n\tpartition\x18\x02 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"\x19\n\x17BootServiceDhcpResponse"b\n\x16BootServiceBootRequest\x12\x1d\n\x03mac\x18\x01 \x01(\tR\x03macB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01\x12)\n\tpartition\x18\x02 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"\x9c\x01\n\x17BootServiceBootResponse\x12#\n\x06kernel\x18\x01 \x01(\tR\x06kernelB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12*\n\x07cmdline\x18\x03 \x01(\tH\x00R\x07cmdlineB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x88\x01\x01B\n\n\x08_cmdline"\x8e\x03\n\x1aBootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12>\n\x08hardware\x18\x02 \x01(\x0b2".metalstack.api.v2.MachineHardwareR\x08hardware\x122\n\x04bios\x18\x03 \x01(\x0b2\x1e.metalstack.api.v2.MachineBiosR\x04bios\x12/\n\x03bmc\x18\x04 \x01(\x0b2\x1d.metalstack.api.v2.MachineBMCR\x03bmc\x12/\n\x03fru\x18\x05 \x01(\x0b2\x1d.metalstack.api.v2.MachineFRUR\x03fru\x12\x12\n\x04tags\x18\x06 \x03(\tR\x04tags\x12=\n\x14metal_hammer_version\x18\x07 \x01(\tR\x12metalHammerVersionB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12)\n\tpartition\x18\x08 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"\x87\x01\n\x1bBootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x12\x1f\n\x04size\x18\x02 \x01(\tR\x04sizeB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01\x12)\n\tpartition\x18\x03 \x01(\tR\tpartitionB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01"6\n\x16BootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"_\n\x17BootServiceWaitResponse\x12D\n\nallocation\x18\x01 \x01(\x0b2$.metalstack.api.v2.MachineAllocationR\nallocation"~\n\'BootServiceInstallationSucceededRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01\x125\n\x10console_password\x18\x02 \x01(\tR\x0fconsolePasswordB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01"*\n(BootServiceInstallationSucceededResponse"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tR\x04uuidB\x08\xbaH\x05r\x03\xb0\x01\x01"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10feature_disabled\x18\x01 \x01(\x08R\x0ffeatureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tR\x11superUserPasswordB\n\xbaH\x07r\x05\x10\x02\x18\x80\x012\x8b\x06\n\x0bBootService\x12l\n\x04Dhcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12l\n\x04Boot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x93\x01\n\x11SuperUserPassword\x128.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a9.metalstack.infra.v2.BootServiceSuperUserPasswordResponse"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a0.metalstack.infra.v2.BootServiceRegisterResponse"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x010\x01\x12\x9f\x01\n\x15InstallationSucceeded\x12<.metalstack.infra.v2.BootServiceInstallationSucceededRequest\x1a=.metalstack.infra.v2.BootServiceInstallationSucceededResponse"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01B\xcd\x01\n\x17com.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3', + [ + validate_pb.desc(), + common_pb.desc(), + machine_pb.desc(), + predefined_rules_pb.desc(), + ], + { + "BootServiceDhcpRequest": BootServiceDhcpRequest, + "BootServiceDhcpResponse": BootServiceDhcpResponse, + "BootServiceBootRequest": BootServiceBootRequest, + "BootServiceBootResponse": BootServiceBootResponse, + "BootServiceRegisterRequest": BootServiceRegisterRequest, + "BootServiceRegisterResponse": BootServiceRegisterResponse, + "BootServiceWaitRequest": BootServiceWaitRequest, + "BootServiceWaitResponse": BootServiceWaitResponse, + "BootServiceInstallationSucceededRequest": BootServiceInstallationSucceededRequest, + "BootServiceInstallationSucceededResponse": BootServiceInstallationSucceededResponse, + "BootServiceSuperUserPasswordRequest": BootServiceSuperUserPasswordRequest, + "BootServiceSuperUserPasswordResponse": BootServiceSuperUserPasswordResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/infra/v2/boot.proto`.""" + return _DESC diff --git a/python/metalstack/infra/v2/boot_pb2.py b/python/metalstack/infra/v2/boot_pb2.py deleted file mode 100644 index ed815060..00000000 --- a/python/metalstack/infra/v2/boot_pb2.py +++ /dev/null @@ -1,111 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/infra/v2/boot.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/infra/v2/boot.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/infra/v2/boot.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"a\n\x16\x42ootServiceDhcpRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12)\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\"\x19\n\x17\x42ootServiceDhcpResponse\"b\n\x16\x42ootServiceBootRequest\x12\x1d\n\x03mac\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12)\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\"\x9c\x01\n\x17\x42ootServiceBootResponse\x12#\n\x06kernel\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xe0\xb3\xae\xb1\x02\x01R\x06kernel\x12$\n\x0einit_ram_disks\x18\x02 \x03(\tR\x0cinitRamDisks\x12*\n\x07\x63mdline\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x07\x63mdline\x88\x01\x01\x42\n\n\x08_cmdline\"\x8e\x03\n\x1a\x42ootServiceRegisterRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12>\n\x08hardware\x18\x02 \x01(\x0b\x32\".metalstack.api.v2.MachineHardwareR\x08hardware\x12\x32\n\x04\x62ios\x18\x03 \x01(\x0b\x32\x1e.metalstack.api.v2.MachineBiosR\x04\x62ios\x12/\n\x03\x62mc\x18\x04 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineBMCR\x03\x62mc\x12/\n\x03\x66ru\x18\x05 \x01(\x0b\x32\x1d.metalstack.api.v2.MachineFRUR\x03\x66ru\x12\x12\n\x04tags\x18\x06 \x03(\tR\x04tags\x12=\n\x14metal_hammer_version\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x12metalHammerVersion\x12)\n\tpartition\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\"\x87\x01\n\x1b\x42ootServiceRegisterResponse\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x1f\n\x04size\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x04size\x12)\n\tpartition\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01R\tpartition\"6\n\x16\x42ootServiceWaitRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"_\n\x17\x42ootServiceWaitResponse\x12\x44\n\nallocation\x18\x01 \x01(\x0b\x32$.metalstack.api.v2.MachineAllocationR\nallocation\"~\n\'BootServiceInstallationSucceededRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\x12\x35\n\x10\x63onsole_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0f\x63onsolePassword\"*\n(BootServiceInstallationSucceededResponse\"C\n#BootServiceSuperUserPasswordRequest\x12\x1c\n\x04uuid\x18\x01 \x01(\tB\x08\xbaH\x05r\x03\xb0\x01\x01R\x04uuid\"\x8d\x01\n$BootServiceSuperUserPasswordResponse\x12)\n\x10\x66\x65\x61ture_disabled\x18\x01 \x01(\x08R\x0f\x66\x65\x61tureDisabled\x12:\n\x13super_user_password\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x11superUserPassword2\x8b\x06\n\x0b\x42ootService\x12l\n\x04\x44hcp\x12+.metalstack.infra.v2.BootServiceDhcpRequest\x1a,.metalstack.infra.v2.BootServiceDhcpResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12l\n\x04\x42oot\x12+.metalstack.infra.v2.BootServiceBootRequest\x1a,.metalstack.infra.v2.BootServiceBootResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x93\x01\n\x11SuperUserPassword\x12\x38.metalstack.infra.v2.BootServiceSuperUserPasswordRequest\x1a\x39.metalstack.infra.v2.BootServiceSuperUserPasswordResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12x\n\x08Register\x12/.metalstack.infra.v2.BootServiceRegisterRequest\x1a\x30.metalstack.infra.v2.BootServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x12n\n\x04Wait\x12+.metalstack.infra.v2.BootServiceWaitRequest\x1a,.metalstack.infra.v2.BootServiceWaitResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x30\x01\x12\x9f\x01\n\x15InstallationSucceeded\x12<.metalstack.infra.v2.BootServiceInstallationSucceededRequest\x1a=.metalstack.infra.v2.BootServiceInstallationSucceededResponse\"\t\xe0\xf3\x18\x02\xf2\xf3\x18\x01\x01\x42\xcd\x01\n\x17\x63om.metalstack.infra.v2B\tBootProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.boot_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\tBootProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_BOOTSERVICEDHCPREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._loaded_options = None - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['mac']._serialized_options = b'\272H\010r\006\270\263\256\261\002\001' - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_BOOTSERVICEBOOTREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._loaded_options = None - _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['kernel']._serialized_options = b'\272H\010r\006\340\263\256\261\002\001' - _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['cmdline']._loaded_options = None - _globals['_BOOTSERVICEBOOTRESPONSE'].fields_by_name['cmdline']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._loaded_options = None - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['metal_hammer_version']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition']._loaded_options = None - _globals['_BOOTSERVICEREGISTERREQUEST'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._loaded_options = None - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['size']._serialized_options = b'\272H\010r\006\310\263\256\261\002\001' - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition']._loaded_options = None - _globals['_BOOTSERVICEREGISTERRESPONSE'].fields_by_name['partition']._serialized_options = b'\272H\010r\006\320\263\256\261\002\001' - _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICEWAITREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST'].fields_by_name['console_password']._loaded_options = None - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST'].fields_by_name['console_password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST'].fields_by_name['uuid']._loaded_options = None - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST'].fields_by_name['uuid']._serialized_options = b'\272H\005r\003\260\001\001' - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._loaded_options = None - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE'].fields_by_name['super_user_password']._serialized_options = b'\272H\007r\005\020\002\030\200\001' - _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Dhcp']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_BOOTSERVICE'].methods_by_name['Boot']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Boot']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['SuperUserPassword']._serialized_options = b'\340\363\030\002\362\363\030\001\001' - _globals['_BOOTSERVICE'].methods_by_name['Register']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\362\363\030\001\001' - _globals['_BOOTSERVICE'].methods_by_name['Wait']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['Wait']._serialized_options = b'\340\363\030\002\362\363\030\001\001' - _globals['_BOOTSERVICE'].methods_by_name['InstallationSucceeded']._loaded_options = None - _globals['_BOOTSERVICE'].methods_by_name['InstallationSucceeded']._serialized_options = b'\340\363\030\002\362\363\030\001\001' - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_start=191 - _globals['_BOOTSERVICEDHCPREQUEST']._serialized_end=288 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_start=290 - _globals['_BOOTSERVICEDHCPRESPONSE']._serialized_end=315 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_start=317 - _globals['_BOOTSERVICEBOOTREQUEST']._serialized_end=415 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_start=418 - _globals['_BOOTSERVICEBOOTRESPONSE']._serialized_end=574 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_start=577 - _globals['_BOOTSERVICEREGISTERREQUEST']._serialized_end=975 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_start=978 - _globals['_BOOTSERVICEREGISTERRESPONSE']._serialized_end=1113 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_start=1115 - _globals['_BOOTSERVICEWAITREQUEST']._serialized_end=1169 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_start=1171 - _globals['_BOOTSERVICEWAITRESPONSE']._serialized_end=1266 - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST']._serialized_start=1268 - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDREQUEST']._serialized_end=1394 - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDRESPONSE']._serialized_start=1396 - _globals['_BOOTSERVICEINSTALLATIONSUCCEEDEDRESPONSE']._serialized_end=1438 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_start=1440 - _globals['_BOOTSERVICESUPERUSERPASSWORDREQUEST']._serialized_end=1507 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_start=1510 - _globals['_BOOTSERVICESUPERUSERPASSWORDRESPONSE']._serialized_end=1651 - _globals['_BOOTSERVICE']._serialized_start=1654 - _globals['_BOOTSERVICE']._serialized_end=2433 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/boot_pb2.pyi b/python/metalstack/infra/v2/boot_pb2.pyi deleted file mode 100644 index 343eea94..00000000 --- a/python/metalstack/infra/v2/boot_pb2.pyi +++ /dev/null @@ -1,109 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class BootServiceDhcpRequest(_message.Message): - __slots__ = ("uuid", "partition") - UUID_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - uuid: str - partition: str - def __init__(self, uuid: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... - -class BootServiceDhcpResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class BootServiceBootRequest(_message.Message): - __slots__ = ("mac", "partition") - MAC_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - mac: str - partition: str - def __init__(self, mac: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... - -class BootServiceBootResponse(_message.Message): - __slots__ = ("kernel", "init_ram_disks", "cmdline") - KERNEL_FIELD_NUMBER: _ClassVar[int] - INIT_RAM_DISKS_FIELD_NUMBER: _ClassVar[int] - CMDLINE_FIELD_NUMBER: _ClassVar[int] - kernel: str - init_ram_disks: _containers.RepeatedScalarFieldContainer[str] - cmdline: str - def __init__(self, kernel: _Optional[str] = ..., init_ram_disks: _Optional[_Iterable[str]] = ..., cmdline: _Optional[str] = ...) -> None: ... - -class BootServiceRegisterRequest(_message.Message): - __slots__ = ("uuid", "hardware", "bios", "bmc", "fru", "tags", "metal_hammer_version", "partition") - UUID_FIELD_NUMBER: _ClassVar[int] - HARDWARE_FIELD_NUMBER: _ClassVar[int] - BIOS_FIELD_NUMBER: _ClassVar[int] - BMC_FIELD_NUMBER: _ClassVar[int] - FRU_FIELD_NUMBER: _ClassVar[int] - TAGS_FIELD_NUMBER: _ClassVar[int] - METAL_HAMMER_VERSION_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - uuid: str - hardware: _machine_pb2.MachineHardware - bios: _machine_pb2.MachineBios - bmc: _machine_pb2.MachineBMC - fru: _machine_pb2.MachineFRU - tags: _containers.RepeatedScalarFieldContainer[str] - metal_hammer_version: str - partition: str - def __init__(self, uuid: _Optional[str] = ..., hardware: _Optional[_Union[_machine_pb2.MachineHardware, _Mapping]] = ..., bios: _Optional[_Union[_machine_pb2.MachineBios, _Mapping]] = ..., bmc: _Optional[_Union[_machine_pb2.MachineBMC, _Mapping]] = ..., fru: _Optional[_Union[_machine_pb2.MachineFRU, _Mapping]] = ..., tags: _Optional[_Iterable[str]] = ..., metal_hammer_version: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... - -class BootServiceRegisterResponse(_message.Message): - __slots__ = ("uuid", "size", "partition") - UUID_FIELD_NUMBER: _ClassVar[int] - SIZE_FIELD_NUMBER: _ClassVar[int] - PARTITION_FIELD_NUMBER: _ClassVar[int] - uuid: str - size: str - partition: str - def __init__(self, uuid: _Optional[str] = ..., size: _Optional[str] = ..., partition: _Optional[str] = ...) -> None: ... - -class BootServiceWaitRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class BootServiceWaitResponse(_message.Message): - __slots__ = ("allocation",) - ALLOCATION_FIELD_NUMBER: _ClassVar[int] - allocation: _machine_pb2.MachineAllocation - def __init__(self, allocation: _Optional[_Union[_machine_pb2.MachineAllocation, _Mapping]] = ...) -> None: ... - -class BootServiceInstallationSucceededRequest(_message.Message): - __slots__ = ("uuid", "console_password") - UUID_FIELD_NUMBER: _ClassVar[int] - CONSOLE_PASSWORD_FIELD_NUMBER: _ClassVar[int] - uuid: str - console_password: str - def __init__(self, uuid: _Optional[str] = ..., console_password: _Optional[str] = ...) -> None: ... - -class BootServiceInstallationSucceededResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class BootServiceSuperUserPasswordRequest(_message.Message): - __slots__ = ("uuid",) - UUID_FIELD_NUMBER: _ClassVar[int] - uuid: str - def __init__(self, uuid: _Optional[str] = ...) -> None: ... - -class BootServiceSuperUserPasswordResponse(_message.Message): - __slots__ = ("feature_disabled", "super_user_password") - FEATURE_DISABLED_FIELD_NUMBER: _ClassVar[int] - SUPER_USER_PASSWORD_FIELD_NUMBER: _ClassVar[int] - feature_disabled: bool - super_user_password: str - def __init__(self, feature_disabled: _Optional[bool] = ..., super_user_password: _Optional[str] = ...) -> None: ... diff --git a/python/metalstack/infra/v2/component_connect.py b/python/metalstack/infra/v2/component_connect.py index 38d4a515..0ef87c31 100644 --- a/python/metalstack/infra/v2/component_connect.py +++ b/python/metalstack/infra/v2/component_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/infra/v2/component.proto +# Generated from metalstack/infra/v2/component.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.infra.v2.component_pb2 as metalstack_dot_infra_dot_v2_dot_component__pb2 + +from .component_pb import ComponentServicePingRequest, ComponentServicePingResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class ComponentService(Protocol): - async def ping(self, request: metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def ping(self, request: ComponentServicePingRequest, ctx: RequestContext[ComponentServicePingRequest, ComponentServicePingResponse]) -> ComponentServicePingResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ComponentServiceASGIApplication(ConnectASGIApplication[ComponentService]): - def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ComponentService | AsyncGenerator[ComponentService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: ComponentService | AsyncGenerator[ComponentService], method=MethodInfo( name="Ping", service_name="metalstack.infra.v2.ComponentService", - input=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, - output=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse, + input=ComponentServicePingRequest, + output=ComponentServicePingResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.ping, @@ -53,43 +69,46 @@ def path(self) -> str: class ComponentServiceClient(ConnectClient): async def ping( self, - request: metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, + request: ComponentServicePingRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse: + ) -> ComponentServicePingResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Ping", service_name="metalstack.infra.v2.ComponentService", - input=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, - output=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse, + input=ComponentServicePingRequest, + output=ComponentServicePingResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class ComponentServiceSync(Protocol): - def ping(self, request: metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def ping(self, request: ComponentServicePingRequest, ctx: RequestContext[ComponentServicePingRequest, ComponentServicePingResponse]) -> ComponentServicePingResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class ComponentServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: ComponentServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: ComponentServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.infra.v2.ComponentService/Ping": EndpointSync.unary( method=MethodInfo( name="Ping", service_name="metalstack.infra.v2.ComponentService", - input=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, - output=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse, + input=ComponentServicePingRequest, + output=ComponentServicePingResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.ping, @@ -110,22 +129,20 @@ def path(self) -> str: class ComponentServiceClientSync(ConnectClientSync): def ping( self, - request: metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, + request: ComponentServicePingRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse: + ) -> ComponentServicePingResponse: return self.execute_unary( request=request, method=MethodInfo( name="Ping", service_name="metalstack.infra.v2.ComponentService", - input=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingRequest, - output=metalstack_dot_infra_dot_v2_dot_component__pb2.ComponentServicePingResponse, + input=ComponentServicePingRequest, + output=ComponentServicePingResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/infra/v2/component_pb.py b/python/metalstack/infra/v2/component_pb.py new file mode 100644 index 00000000..9e6de839 --- /dev/null +++ b/python/metalstack/infra/v2/component_pb.py @@ -0,0 +1,131 @@ +# Generated from metalstack/infra/v2/component.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, NoReturn, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb, timestamp_pb + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, component_pb, predefined_rules_pb, version_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration, Timestamp + + from ...api.v2.component_pb import ComponentType + from ...api.v2.version_pb import Version + + +_ComponentServicePingRequestFields: TypeAlias = Literal["type", "identifier", "started_at", "interval", "version"] + +class ComponentServicePingRequest(Message[_ComponentServicePingRequestFields]): + """ + ComponentServicePingRequest is the request payload for pinging a microservice. + + ```proto + message metalstack.infra.v2.ComponentServicePingRequest + ``` + + Attributes: + type: + Type defines which service is actually pinging + + ```proto + metalstack.api.v2.ComponentType type = 1; + ``` + identifier: + Identifier is a unique identifier of this service, for example if two instances are running, this might be the pod ID + + ```proto + string identifier = 2; + ``` + started_at: + StartedAt is the timestamp this service was started + + ```proto + optional google.protobuf.Timestamp started_at = 3; + ``` + interval: + Interval at which the ping is scheduled, must be between 5 seconds and 1 hour + + ```proto + optional google.protobuf.Duration interval = 4; + ``` + version: + Version of this service + + ```proto + optional metalstack.api.v2.Version version = 5; + ``` + """ + + __slots__ = ("type", "identifier", "started_at", "interval", "version") + + if TYPE_CHECKING: + + def __init__( + self, + *, + type: ComponentType | None = None, + identifier: str = "", + started_at: Timestamp | None = None, + interval: Duration | None = None, + version: Version | None = None, + ) -> None: + pass + + type: ComponentType + identifier: str + started_at: Timestamp | None + interval: Duration | None + version: Version | None + +_ComponentServicePingResponseFields: TypeAlias = NoReturn + +class ComponentServicePingResponse(Message[_ComponentServicePingResponseFields]): + """ + ComponentServicePingResponse is the response payload for pinging a microservice. + + ```proto + message metalstack.infra.v2.ComponentServicePingResponse + ``` + """ + + __slots__ = () + + if TYPE_CHECKING: + + def __init__( + self, + ) -> None: + pass + + +_DESC = file_desc( + b'\n#metalstack/infra/v2/component.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/component.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/version.proto"\xcd\x02\n\x1bComponentServicePingRequest\x12>\n\x04type\x18\x01 \x01(\x0e2 .metalstack.api.v2.ComponentTypeR\x04typeB\x08\xbaH\x05\x82\x01\x02\x10\x01\x12+\n\nidentifier\x18\x02 \x01(\tR\nidentifierB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01\x12C\n\nstarted_at\x18\x03 \x01(\x0b2\x1a.google.protobuf.TimestampR\tstartedAtB\x08\xbaH\x05\xb2\x01\x028\x01\x12F\n\x08interval\x18\x04 \x01(\x0b2\x19.google.protobuf.DurationR\x08intervalB\x0f\xbaH\x0c\xaa\x01\t"\x03\x08\x90\x1c2\x02\x08\x05\x124\n\x07version\x18\x05 \x01(\x0b2\x1a.metalstack.api.v2.VersionR\x07version"\x1e\n\x1cComponentServicePingResponse2\x8a\x01\n\x10ComponentService\x12v\n\x04Ping\x120.metalstack.infra.v2.ComponentServicePingRequest\x1a1.metalstack.infra.v2.ComponentServicePingResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01B\xd2\x01\n\x17com.metalstack.infra.v2B\x0eComponentProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + timestamp_pb.desc(), + common_pb.desc(), + component_pb.desc(), + predefined_rules_pb.desc(), + version_pb.desc(), + ], + { + "ComponentServicePingRequest": ComponentServicePingRequest, + "ComponentServicePingResponse": ComponentServicePingResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/infra/v2/component.proto`.""" + return _DESC diff --git a/python/metalstack/infra/v2/component_pb2.py b/python/metalstack/infra/v2/component_pb2.py deleted file mode 100644 index 1b8826e4..00000000 --- a/python/metalstack/infra/v2/component_pb2.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/infra/v2/component.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/infra/v2/component.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import component_pb2 as metalstack_dot_api_dot_v2_dot_component__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import version_pb2 as metalstack_dot_api_dot_v2_dot_version__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#metalstack/infra/v2/component.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a!metalstack/api/v2/component.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1fmetalstack/api/v2/version.proto\"\xcd\x02\n\x1b\x43omponentServicePingRequest\x12>\n\x04type\x18\x01 \x01(\x0e\x32 .metalstack.api.v2.ComponentTypeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12+\n\nidentifier\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\nidentifier\x12\x43\n\nstarted_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x08\xbaH\x05\xb2\x01\x02\x38\x01R\tstartedAt\x12\x46\n\x08interval\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x0f\xbaH\x0c\xaa\x01\t\"\x03\x08\x90\x1c\x32\x02\x08\x05R\x08interval\x12\x34\n\x07version\x18\x05 \x01(\x0b\x32\x1a.metalstack.api.v2.VersionR\x07version\"\x1e\n\x1c\x43omponentServicePingResponse2\x8a\x01\n\x10\x43omponentService\x12v\n\x04Ping\x12\x30.metalstack.infra.v2.ComponentServicePingRequest\x1a\x31.metalstack.infra.v2.ComponentServicePingResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x42\xd2\x01\n\x17\x63om.metalstack.infra.v2B\x0e\x43omponentProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.component_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\016ComponentProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['type']._loaded_options = None - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['type']._serialized_options = b'\272H\005\202\001\002\020\001' - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['identifier']._loaded_options = None - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['identifier']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001' - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['started_at']._loaded_options = None - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['started_at']._serialized_options = b'\272H\005\262\001\0028\001' - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['interval']._loaded_options = None - _globals['_COMPONENTSERVICEPINGREQUEST'].fields_by_name['interval']._serialized_options = b'\272H\014\252\001\t\"\003\010\220\0342\002\010\005' - _globals['_COMPONENTSERVICE'].methods_by_name['Ping']._loaded_options = None - _globals['_COMPONENTSERVICE'].methods_by_name['Ping']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_COMPONENTSERVICEPINGREQUEST']._serialized_start=297 - _globals['_COMPONENTSERVICEPINGREQUEST']._serialized_end=630 - _globals['_COMPONENTSERVICEPINGRESPONSE']._serialized_start=632 - _globals['_COMPONENTSERVICEPINGRESPONSE']._serialized_end=662 - _globals['_COMPONENTSERVICE']._serialized_start=665 - _globals['_COMPONENTSERVICE']._serialized_end=803 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/component_pb2.pyi b/python/metalstack/infra/v2/component_pb2.pyi deleted file mode 100644 index 704142fd..00000000 --- a/python/metalstack/infra/v2/component_pb2.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import component_pb2 as _component_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import version_pb2 as _version_pb2 -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class ComponentServicePingRequest(_message.Message): - __slots__ = ("type", "identifier", "started_at", "interval", "version") - TYPE_FIELD_NUMBER: _ClassVar[int] - IDENTIFIER_FIELD_NUMBER: _ClassVar[int] - STARTED_AT_FIELD_NUMBER: _ClassVar[int] - INTERVAL_FIELD_NUMBER: _ClassVar[int] - VERSION_FIELD_NUMBER: _ClassVar[int] - type: _component_pb2.ComponentType - identifier: str - started_at: _timestamp_pb2.Timestamp - interval: _duration_pb2.Duration - version: _version_pb2.Version - def __init__(self, type: _Optional[_Union[_component_pb2.ComponentType, str]] = ..., identifier: _Optional[str] = ..., started_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., interval: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., version: _Optional[_Union[_version_pb2.Version, _Mapping]] = ...) -> None: ... - -class ComponentServicePingResponse(_message.Message): - __slots__ = () - def __init__(self) -> None: ... diff --git a/python/metalstack/infra/v2/event_connect.py b/python/metalstack/infra/v2/event_connect.py index 6eaf0274..d17236bd 100644 --- a/python/metalstack/infra/v2/event_connect.py +++ b/python/metalstack/infra/v2/event_connect.py @@ -1,29 +1,45 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/infra/v2/event.proto +# Generated from metalstack/infra/v2/event.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.infra.v2.event_pb2 as metalstack_dot_infra_dot_v2_dot_event__pb2 + +from .event_pb import EventServiceSendRequest, EventServiceSendResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class EventService(Protocol): - async def send(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def send(self, request: EventServiceSendRequest, ctx: RequestContext[EventServiceSendRequest, EventServiceSendResponse]) -> EventServiceSendResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class EventServiceASGIApplication(ConnectASGIApplication[EventService]): - def __init__(self, service: EventService | AsyncGenerator[EventService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: EventService | AsyncGenerator[EventService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -31,8 +47,8 @@ def __init__(self, service: EventService | AsyncGenerator[EventService], *, inte method=MethodInfo( name="Send", service_name="metalstack.infra.v2.EventService", - input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, - output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + input=EventServiceSendRequest, + output=EventServiceSendResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.send, @@ -53,43 +69,46 @@ def path(self) -> str: class EventServiceClient(ConnectClient): async def send( self, - request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + request: EventServiceSendRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + ) -> EventServiceSendResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Send", service_name="metalstack.infra.v2.EventService", - input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, - output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + input=EventServiceSendRequest, + output=EventServiceSendResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - - - class EventServiceSync(Protocol): - def send(self, request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def send(self, request: EventServiceSendRequest, ctx: RequestContext[EventServiceSendRequest, EventServiceSendResponse]) -> EventServiceSendResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class EventServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: EventServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: EventServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.infra.v2.EventService/Send": EndpointSync.unary( method=MethodInfo( name="Send", service_name="metalstack.infra.v2.EventService", - input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, - output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + input=EventServiceSendRequest, + output=EventServiceSendResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.send, @@ -110,22 +129,20 @@ def path(self) -> str: class EventServiceClientSync(ConnectClientSync): def send( self, - request: metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, + request: EventServiceSendRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse: + ) -> EventServiceSendResponse: return self.execute_unary( request=request, method=MethodInfo( name="Send", service_name="metalstack.infra.v2.EventService", - input=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendRequest, - output=metalstack_dot_infra_dot_v2_dot_event__pb2.EventServiceSendResponse, + input=EventServiceSendRequest, + output=EventServiceSendResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/infra/v2/event_pb.py b/python/metalstack/infra/v2/event_pb.py new file mode 100644 index 00000000..22ddcbd2 --- /dev/null +++ b/python/metalstack/infra/v2/event_pb.py @@ -0,0 +1,110 @@ +# Generated from metalstack/infra/v2/event.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc + +from ...api.v2 import common_pb, machine_pb + +if TYPE_CHECKING: + from protobuf import DescFile + + from ...api.v2.machine_pb import MachineProvisioningEvent + + +_EventServiceSendRequestFields: TypeAlias = Literal["events"] + +class EventServiceSendRequest(Message[_EventServiceSendRequestFields]): + """ + EventServiceSendRequest is the request payload for sending provisioning events. + + ```proto + message metalstack.infra.v2.EventServiceSendRequest + ``` + + Attributes: + events: + Events grouped by machine IDs + + ```proto + map events = 1; + ``` + """ + + __slots__ = ("events",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + events: dict[str, MachineProvisioningEvent] | None = None, + ) -> None: + pass + + events: dict[str, MachineProvisioningEvent] + +_EventServiceSendResponseFields: TypeAlias = Literal["events", "failed"] + +class EventServiceSendResponse(Message[_EventServiceSendResponseFields]): + """ + EventServiceSendResponse is the response payload for sending provisioning events. + + ```proto + message metalstack.infra.v2.EventServiceSendResponse + ``` + + Attributes: + events: + Events counts the number of events successfully stored in the database + + ```proto + uint64 events = 1; + ``` + failed: + Failed contains IDs of all machines whose events could not be stored in the database + + ```proto + repeated string failed = 2; + ``` + """ + + __slots__ = ("events", "failed") + + if TYPE_CHECKING: + + def __init__( + self, + *, + events: int = 0, + failed: list[str] | None = None, + ) -> None: + pass + + events: int + failed: list[str] + + +_DESC = file_desc( + b'\n\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto"\xd3\x01\n\x17EventServiceSendRequest\x12P\n\x06events\x18\x01 \x03(\x0b28.metalstack.infra.v2.EventServiceSendRequest.EventsEntryR\x06events\x1af\n\x0bEventsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12A\n\x05value\x18\x02 \x01(\x0b2+.metalstack.api.v2.MachineProvisioningEventR\x05value:\x028\x01"J\n\x18EventServiceSendResponse\x12\x16\n\x06events\x18\x01 \x01(\x04R\x06events\x12\x16\n\x06failed\x18\x02 \x03(\tR\x06failed2~\n\x0cEventService\x12n\n\x04Send\x12,.metalstack.infra.v2.EventServiceSendRequest\x1a-.metalstack.infra.v2.EventServiceSendResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01B\xce\x01\n\x17com.metalstack.infra.v2B\nEventProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3', + [ + common_pb.desc(), + machine_pb.desc(), + ], + { + "EventServiceSendRequest": EventServiceSendRequest, + "EventServiceSendResponse": EventServiceSendResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/infra/v2/event.proto`.""" + return _DESC diff --git a/python/metalstack/infra/v2/event_pb2.py b/python/metalstack/infra/v2/event_pb2.py deleted file mode 100644 index b25695ed..00000000 --- a/python/metalstack/infra/v2/event_pb2.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/infra/v2/event.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/infra/v2/event.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fmetalstack/infra/v2/event.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\"\xd3\x01\n\x17\x45ventServiceSendRequest\x12P\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x38.metalstack.infra.v2.EventServiceSendRequest.EventsEntryR\x06\x65vents\x1a\x66\n\x0b\x45ventsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32+.metalstack.api.v2.MachineProvisioningEventR\x05value:\x02\x38\x01\"J\n\x18\x45ventServiceSendResponse\x12\x16\n\x06\x65vents\x18\x01 \x01(\x04R\x06\x65vents\x12\x16\n\x06\x66\x61iled\x18\x02 \x03(\tR\x06\x66\x61iled2~\n\x0c\x45ventService\x12n\n\x04Send\x12,.metalstack.infra.v2.EventServiceSendRequest\x1a-.metalstack.infra.v2.EventServiceSendResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x42\xce\x01\n\x17\x63om.metalstack.infra.v2B\nEventProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.event_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\nEventProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' - _globals['_EVENTSERVICESENDREQUEST_EVENTSENTRY']._loaded_options = None - _globals['_EVENTSERVICESENDREQUEST_EVENTSENTRY']._serialized_options = b'8\001' - _globals['_EVENTSERVICE'].methods_by_name['Send']._loaded_options = None - _globals['_EVENTSERVICE'].methods_by_name['Send']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_EVENTSERVICESENDREQUEST']._serialized_start=184 - _globals['_EVENTSERVICESENDREQUEST']._serialized_end=395 - _globals['_EVENTSERVICESENDREQUEST_EVENTSENTRY']._serialized_start=293 - _globals['_EVENTSERVICESENDREQUEST_EVENTSENTRY']._serialized_end=395 - _globals['_EVENTSERVICESENDRESPONSE']._serialized_start=397 - _globals['_EVENTSERVICESENDRESPONSE']._serialized_end=471 - _globals['_EVENTSERVICE']._serialized_start=473 - _globals['_EVENTSERVICE']._serialized_end=599 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/event_pb2.pyi b/python/metalstack/infra/v2/event_pb2.pyi deleted file mode 100644 index ea14d0bb..00000000 --- a/python/metalstack/infra/v2/event_pb2.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import timestamp_pb2 as _timestamp_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import machine_pb2 as _machine_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Iterable as _Iterable, Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class EventServiceSendRequest(_message.Message): - __slots__ = ("events",) - class EventsEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _machine_pb2.MachineProvisioningEvent - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_machine_pb2.MachineProvisioningEvent, _Mapping]] = ...) -> None: ... - EVENTS_FIELD_NUMBER: _ClassVar[int] - events: _containers.MessageMap[str, _machine_pb2.MachineProvisioningEvent] - def __init__(self, events: _Optional[_Mapping[str, _machine_pb2.MachineProvisioningEvent]] = ...) -> None: ... - -class EventServiceSendResponse(_message.Message): - __slots__ = ("events", "failed") - EVENTS_FIELD_NUMBER: _ClassVar[int] - FAILED_FIELD_NUMBER: _ClassVar[int] - events: int - failed: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, events: _Optional[int] = ..., failed: _Optional[_Iterable[str]] = ...) -> None: ... diff --git a/python/metalstack/infra/v2/switch_connect.py b/python/metalstack/infra/v2/switch_connect.py index 764b6274..c825a2c7 100644 --- a/python/metalstack/infra/v2/switch_connect.py +++ b/python/metalstack/infra/v2/switch_connect.py @@ -1,35 +1,51 @@ -# -*- coding: utf-8 -*- -# Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT! -# source: metalstack/infra/v2/switch.proto +# Generated from metalstack/infra/v2/switch.proto. DO NOT EDIT. +# Generated by protoc-gen-connectrpc-py v0.11.1 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off -from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping -from typing import Protocol +from __future__ import annotations + +from typing import Protocol, TYPE_CHECKING from connectrpc.client import ConnectClient, ConnectClientSync from connectrpc.code import Code -from connectrpc.codec import Codec -from connectrpc.compression import Compression from connectrpc.errors import ConnectError -from connectrpc.interceptor import Interceptor, InterceptorSync from connectrpc.method import IdempotencyLevel, MethodInfo -from connectrpc.request import Headers, RequestContext from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync -import metalstack.infra.v2.switch_pb2 as metalstack_dot_infra_dot_v2_dot_switch__pb2 + +from .switch_pb import SwitchServiceGetRequest, SwitchServiceGetResponse, SwitchServiceHeartbeatRequest, SwitchServiceHeartbeatResponse, SwitchServiceRegisterRequest, SwitchServiceRegisterResponse + +if TYPE_CHECKING: + from collections.abc import AsyncGenerator, Iterable, Mapping + + from connectrpc.codec import Codec + from connectrpc.compression import Compression + from connectrpc.interceptor import Interceptor, InterceptorSync + from connectrpc.request import Headers, RequestContext class SwitchService(Protocol): - async def get(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def get(self, request: SwitchServiceGetRequest, ctx: RequestContext[SwitchServiceGetRequest, SwitchServiceGetResponse]) -> SwitchServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def register(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def register(self, request: SwitchServiceRegisterRequest, ctx: RequestContext[SwitchServiceRegisterRequest, SwitchServiceRegisterResponse]) -> SwitchServiceRegisterResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - async def heartbeat(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + async def heartbeat(self, request: SwitchServiceHeartbeatRequest, ctx: RequestContext[SwitchServiceHeartbeatRequest, SwitchServiceHeartbeatResponse]) -> SwitchServiceHeartbeatResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SwitchServiceASGIApplication(ConnectASGIApplication[SwitchService]): - def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SwitchService | AsyncGenerator[SwitchService], + *, + interceptors: Iterable[Interceptor] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( service=service, endpoints=lambda svc: { @@ -37,8 +53,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Get", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.get, @@ -47,8 +63,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Register", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse, + input=SwitchServiceRegisterRequest, + output=SwitchServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.register, @@ -57,8 +73,8 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in method=MethodInfo( name="Heartbeat", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse, + input=SwitchServiceHeartbeatRequest, + output=SwitchServiceHeartbeatResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=svc.heartbeat, @@ -79,18 +95,18 @@ def path(self) -> str: class SwitchServiceClient(ConnectClient): async def get( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, + request: SwitchServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: + ) -> SwitchServiceGetResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -99,18 +115,18 @@ async def get( async def register( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, + request: SwitchServiceRegisterRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: + ) -> SwitchServiceRegisterResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Register", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse, + input=SwitchServiceRegisterRequest, + output=SwitchServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, @@ -119,47 +135,52 @@ async def register( async def heartbeat( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, + request: SwitchServiceHeartbeatRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse: + ) -> SwitchServiceHeartbeatResponse: return await self.execute_unary( request=request, method=MethodInfo( name="Heartbeat", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse, + input=SwitchServiceHeartbeatRequest, + output=SwitchServiceHeartbeatResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) +class SwitchServiceSync(Protocol): + def get(self, request: SwitchServiceGetRequest, ctx: RequestContext[SwitchServiceGetRequest, SwitchServiceGetResponse]) -> SwitchServiceGetResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') + def register(self, request: SwitchServiceRegisterRequest, ctx: RequestContext[SwitchServiceRegisterRequest, SwitchServiceRegisterResponse]) -> SwitchServiceRegisterResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') - - -class SwitchServiceSync(Protocol): - def get(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def register(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") - def heartbeat(self, request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, ctx: RequestContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse: - raise ConnectError(Code.UNIMPLEMENTED, "Not implemented") + def heartbeat(self, request: SwitchServiceHeartbeatRequest, ctx: RequestContext[SwitchServiceHeartbeatRequest, SwitchServiceHeartbeatResponse]) -> SwitchServiceHeartbeatResponse: + raise ConnectError(Code.UNIMPLEMENTED, 'Not implemented') class SwitchServiceWSGIApplication(ConnectWSGIApplication): - def __init__(self, service: SwitchServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None, codecs: Iterable[Codec] | None = None) -> None: + def __init__( + self, + service: SwitchServiceSync, + interceptors: Iterable[InterceptorSync] = (), + read_max_bytes: int | None = None, + compressions: Iterable[Compression] | None = None, + codecs: Iterable[Codec] | None = None, + ) -> None: super().__init__( endpoints={ "/metalstack.infra.v2.SwitchService/Get": EndpointSync.unary( method=MethodInfo( name="Get", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.get, @@ -168,8 +189,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Register", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse, + input=SwitchServiceRegisterRequest, + output=SwitchServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.register, @@ -178,8 +199,8 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto method=MethodInfo( name="Heartbeat", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse, + input=SwitchServiceHeartbeatRequest, + output=SwitchServiceHeartbeatResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), function=service.heartbeat, @@ -200,62 +221,58 @@ def path(self) -> str: class SwitchServiceClientSync(ConnectClientSync): def get( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, + request: SwitchServiceGetRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse: + ) -> SwitchServiceGetResponse: return self.execute_unary( request=request, method=MethodInfo( name="Get", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceGetResponse, + input=SwitchServiceGetRequest, + output=SwitchServiceGetResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def register( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, + request: SwitchServiceRegisterRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: + ) -> SwitchServiceRegisterResponse: return self.execute_unary( request=request, method=MethodInfo( name="Register", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse, + input=SwitchServiceRegisterRequest, + output=SwitchServiceRegisterResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - def heartbeat( self, - request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, + request: SwitchServiceHeartbeatRequest, *, - headers: Headers | Mapping[str, str] | None = None, + headers: Headers | Mapping[str, str] | None = None, timeout_ms: int | None = None, - ) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse: + ) -> SwitchServiceHeartbeatResponse: return self.execute_unary( request=request, method=MethodInfo( name="Heartbeat", service_name="metalstack.infra.v2.SwitchService", - input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatRequest, - output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceHeartbeatResponse, + input=SwitchServiceHeartbeatRequest, + output=SwitchServiceHeartbeatResponse, idempotency_level=IdempotencyLevel.UNKNOWN, ), headers=headers, timeout_ms=timeout_ms, ) - - diff --git a/python/metalstack/infra/v2/switch_pb.py b/python/metalstack/infra/v2/switch_pb.py new file mode 100644 index 00000000..2ab8c47b --- /dev/null +++ b/python/metalstack/infra/v2/switch_pb.py @@ -0,0 +1,288 @@ +# Generated from metalstack/infra/v2/switch.proto. DO NOT EDIT. +# Generated by protoc-gen-py v0.2.0 with parameter "". +# ruff: noqa: PGH004 +# ruff: noqa +# fmt: off + +from __future__ import annotations + +from typing import Literal, TYPE_CHECKING, TypeAlias + +from protobuf import Message +from protobuf._codegen import file_desc +from protobuf.wkt import duration_pb + +from ....buf.validate import validate_pb +from ...api.v2 import common_pb, predefined_rules_pb, switch_pb + +if TYPE_CHECKING: + from protobuf import DescFile + from protobuf.wkt import Duration + + from ...api.v2.switch_pb import Switch, SwitchBGPPortState, SwitchPortStatus, SwitchSync + + +_SwitchServiceGetRequestFields: TypeAlias = Literal["id"] + +class SwitchServiceGetRequest(Message[_SwitchServiceGetRequestFields]): + """ + SwitchServiceGetRequest is the request payload for getting a switch. + + ```proto + message metalstack.infra.v2.SwitchServiceGetRequest + ``` + + Attributes: + id: + Id of the switch + + ```proto + string id = 1; + ``` + """ + + __slots__ = ("id",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + ) -> None: + pass + + id: str + +_SwitchServiceGetResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceGetResponse(Message[_SwitchServiceGetResponseFields]): + """ + SwitchServiceGetResponse is the response payload for getting a switch. + + ```proto + message metalstack.infra.v2.SwitchServiceGetResponse + ``` + + Attributes: + switch: + Switch contains the requested switch + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceRegisterRequestFields: TypeAlias = Literal["switch"] + +class SwitchServiceRegisterRequest(Message[_SwitchServiceRegisterRequestFields]): + """ + SwitchServiceRegisterRequest is the request payload for registering a switch. + + ```proto + message metalstack.infra.v2.SwitchServiceRegisterRequest + ``` + + Attributes: + switch: + Switch to register + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceRegisterResponseFields: TypeAlias = Literal["switch"] + +class SwitchServiceRegisterResponse(Message[_SwitchServiceRegisterResponseFields]): + """ + SwitchServiceRegisterResponse is the response payload for registering a switch. + + ```proto + message metalstack.infra.v2.SwitchServiceRegisterResponse + ``` + + Attributes: + switch: + Switch contains the registered switch + + ```proto + optional metalstack.api.v2.Switch switch = 1; + ``` + """ + + __slots__ = ("switch",) + + if TYPE_CHECKING: + + def __init__( + self, + *, + switch: Switch | None = None, + ) -> None: + pass + + switch: Switch | None + +_SwitchServiceHeartbeatRequestFields: TypeAlias = Literal["id", "duration", "error", "port_states", "bgp_port_states"] + +class SwitchServiceHeartbeatRequest(Message[_SwitchServiceHeartbeatRequestFields]): + """ + SwitchServiceHeartbeatRequest is the request payload for sending a switch heartbeat. + + ```proto + message metalstack.infra.v2.SwitchServiceHeartbeatRequest + ``` + + Attributes: + id: + Id of the switch + + ```proto + string id = 1; + ``` + duration: + Duration of the sync + + ```proto + optional google.protobuf.Duration duration = 2; + ``` + error: + Error if any occurred during the sync + + ```proto + optional string error = 3; + ``` + port_states: + PortStates maps port identifiers to the respective port's operational state + + ```proto + map port_states = 4; + ``` + bgp_port_states: + BgpPortStates maps port identifiers to the respective port's BGP state + + ```proto + map bgp_port_states = 5; + ``` + """ + + __slots__ = ("id", "duration", "error", "port_states", "bgp_port_states") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + duration: Duration | None = None, + error: str | None = None, + port_states: dict[str, SwitchPortStatus] | None = None, + bgp_port_states: dict[str, SwitchBGPPortState] | None = None, + ) -> None: + pass + + id: str + duration: Duration | None + error: str + port_states: dict[str, SwitchPortStatus] + bgp_port_states: dict[str, SwitchBGPPortState] + +_SwitchServiceHeartbeatResponseFields: TypeAlias = Literal["id", "last_sync", "last_sync_error"] + +class SwitchServiceHeartbeatResponse(Message[_SwitchServiceHeartbeatResponseFields]): + """ + SwitchServiceHeartbeatResponse is the response payload for sending a switch heartbeat. + + ```proto + message metalstack.infra.v2.SwitchServiceHeartbeatResponse + ``` + + Attributes: + id: + Id of the switch + + ```proto + string id = 1; + ``` + last_sync: + LastSync holds information about the last sync + + ```proto + optional metalstack.api.v2.SwitchSync last_sync = 2; + ``` + last_sync_error: + LastSyncError holds information about the last erroneous sync + + ```proto + optional metalstack.api.v2.SwitchSync last_sync_error = 3; + ``` + """ + + __slots__ = ("id", "last_sync", "last_sync_error") + + if TYPE_CHECKING: + + def __init__( + self, + *, + id: str = "", + last_sync: SwitchSync | None = None, + last_sync_error: SwitchSync | None = None, + ) -> None: + pass + + id: str + last_sync: SwitchSync | None + last_sync_error: SwitchSync | None + + +_DESC = file_desc( + b'\n metalstack/infra/v2/switch.proto\x12\x13metalstack.infra.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01"M\n\x18SwitchServiceGetResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"Q\n\x1cSwitchServiceRegisterRequest\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"R\n\x1dSwitchServiceRegisterResponse\x121\n\x06switch\x18\x01 \x01(\x0b2\x19.metalstack.api.v2.SwitchR\x06switch"\xbb\x04\n\x1dSwitchServiceHeartbeatRequest\x12\x1d\n\x02id\x18\x01 \x01(\tR\x02idB\r\xbaH\nr\x08\xc0\xb3\xae\xb1\x02\x01h\x01\x125\n\x08duration\x18\x02 \x01(\x0b2\x19.google.protobuf.DurationR\x08duration\x12\x19\n\x05error\x18\x03 \x01(\tH\x00R\x05error\x88\x01\x01\x12c\n\x0bport_states\x18\x04 \x03(\x0b2B.metalstack.infra.v2.SwitchServiceHeartbeatRequest.PortStatesEntryR\nportStates\x12m\n\x0fbgp_port_states\x18\x05 \x03(\x0b2E.metalstack.infra.v2.SwitchServiceHeartbeatRequest.BgpPortStatesEntryR\rbgpPortStates\x1ab\n\x0fPortStatesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x129\n\x05value\x18\x02 \x01(\x0e2#.metalstack.api.v2.SwitchPortStatusR\x05value:\x028\x01\x1ag\n\x12BgpPortStatesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12;\n\x05value\x18\x02 \x01(\x0b2%.metalstack.api.v2.SwitchBGPPortStateR\x05value:\x028\x01B\x08\n\x06_error"\xb3\x01\n\x1eSwitchServiceHeartbeatResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12:\n\tlast_sync\x18\x02 \x01(\x0b2\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12E\n\x0flast_sync_error\x18\x03 \x01(\x0b2\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncError2\xfe\x02\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.infra.v2.SwitchServiceGetRequest\x1a-.metalstack.infra.v2.SwitchServiceGetResponse"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12|\n\x08Register\x121.metalstack.infra.v2.SwitchServiceRegisterRequest\x1a2.metalstack.infra.v2.SwitchServiceRegisterResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x7f\n\tHeartbeat\x122.metalstack.infra.v2.SwitchServiceHeartbeatRequest\x1a3.metalstack.infra.v2.SwitchServiceHeartbeatResponse"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01B\xcf\x01\n\x17com.metalstack.infra.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3', + [ + validate_pb.desc(), + duration_pb.desc(), + common_pb.desc(), + predefined_rules_pb.desc(), + switch_pb.desc(), + ], + { + "SwitchServiceGetRequest": SwitchServiceGetRequest, + "SwitchServiceGetResponse": SwitchServiceGetResponse, + "SwitchServiceRegisterRequest": SwitchServiceRegisterRequest, + "SwitchServiceRegisterResponse": SwitchServiceRegisterResponse, + "SwitchServiceHeartbeatRequest": SwitchServiceHeartbeatRequest, + "SwitchServiceHeartbeatResponse": SwitchServiceHeartbeatResponse, + }, +) + + +def desc() -> DescFile: + """Returns the descriptor for the file `metalstack/infra/v2/switch.proto`.""" + return _DESC diff --git a/python/metalstack/infra/v2/switch_pb2.py b/python/metalstack/infra/v2/switch_pb2.py deleted file mode 100644 index 06382be6..00000000 --- a/python/metalstack/infra/v2/switch_pb2.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE -# source: metalstack/infra/v2/switch.proto -# Protobuf Python Version: 7.35.1 -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version -from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 7, - 35, - 1, - '', - 'metalstack/infra/v2/switch.proto' -) -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2 -from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2 -from metalstack.api.v2 import switch_pb2 as metalstack_dot_api_dot_v2_dot_switch__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/infra/v2/switch.proto\x12\x13metalstack.infra.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\"M\n\x18SwitchServiceGetResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"Q\n\x1cSwitchServiceRegisterRequest\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"R\n\x1dSwitchServiceRegisterResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xbb\x04\n\x1dSwitchServiceHeartbeatRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x35\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08\x64uration\x12\x19\n\x05\x65rror\x18\x03 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x12\x63\n\x0bport_states\x18\x04 \x03(\x0b\x32\x42.metalstack.infra.v2.SwitchServiceHeartbeatRequest.PortStatesEntryR\nportStates\x12m\n\x0f\x62gp_port_states\x18\x05 \x03(\x0b\x32\x45.metalstack.infra.v2.SwitchServiceHeartbeatRequest.BgpPortStatesEntryR\rbgpPortStates\x1a\x62\n\x0fPortStatesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x39\n\x05value\x18\x02 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusR\x05value:\x02\x38\x01\x1ag\n\x12\x42gpPortStatesEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12;\n\x05value\x18\x02 \x01(\x0b\x32%.metalstack.api.v2.SwitchBGPPortStateR\x05value:\x02\x38\x01\x42\x08\n\x06_error\"\xb3\x01\n\x1eSwitchServiceHeartbeatResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12:\n\tlast_sync\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12\x45\n\x0flast_sync_error\x18\x03 \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncError2\xfe\x02\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.infra.v2.SwitchServiceGetRequest\x1a-.metalstack.infra.v2.SwitchServiceGetResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x12|\n\x08Register\x12\x31.metalstack.infra.v2.SwitchServiceRegisterRequest\x1a\x32.metalstack.infra.v2.SwitchServiceRegisterResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x12\x7f\n\tHeartbeat\x12\x32.metalstack.infra.v2.SwitchServiceHeartbeatRequest\x1a\x33.metalstack.infra.v2.SwitchServiceHeartbeatResponse\"\t\xe0\xf3\x18\x02\xea\xf3\x18\x01\x01\x42\xcf\x01\n\x17\x63om.metalstack.infra.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3') - -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.switch_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\013SwitchProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2' - _globals['_SWITCHSERVICEGETREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEGETREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICEHEARTBEATREQUEST_PORTSTATESENTRY']._loaded_options = None - _globals['_SWITCHSERVICEHEARTBEATREQUEST_PORTSTATESENTRY']._serialized_options = b'8\001' - _globals['_SWITCHSERVICEHEARTBEATREQUEST_BGPPORTSTATESENTRY']._loaded_options = None - _globals['_SWITCHSERVICEHEARTBEATREQUEST_BGPPORTSTATESENTRY']._serialized_options = b'8\001' - _globals['_SWITCHSERVICEHEARTBEATREQUEST'].fields_by_name['id']._loaded_options = None - _globals['_SWITCHSERVICEHEARTBEATREQUEST'].fields_by_name['id']._serialized_options = b'\272H\nr\010h\001\300\263\256\261\002\001' - _globals['_SWITCHSERVICE'].methods_by_name['Get']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Get']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002' - _globals['_SWITCHSERVICE'].methods_by_name['Register']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_SWITCHSERVICE'].methods_by_name['Heartbeat']._loaded_options = None - _globals['_SWITCHSERVICE'].methods_by_name['Heartbeat']._serialized_options = b'\340\363\030\002\352\363\030\001\001' - _globals['_SWITCHSERVICEGETREQUEST']._serialized_start=224 - _globals['_SWITCHSERVICEGETREQUEST']._serialized_end=280 - _globals['_SWITCHSERVICEGETRESPONSE']._serialized_start=282 - _globals['_SWITCHSERVICEGETRESPONSE']._serialized_end=359 - _globals['_SWITCHSERVICEREGISTERREQUEST']._serialized_start=361 - _globals['_SWITCHSERVICEREGISTERREQUEST']._serialized_end=442 - _globals['_SWITCHSERVICEREGISTERRESPONSE']._serialized_start=444 - _globals['_SWITCHSERVICEREGISTERRESPONSE']._serialized_end=526 - _globals['_SWITCHSERVICEHEARTBEATREQUEST']._serialized_start=529 - _globals['_SWITCHSERVICEHEARTBEATREQUEST']._serialized_end=1100 - _globals['_SWITCHSERVICEHEARTBEATREQUEST_PORTSTATESENTRY']._serialized_start=887 - _globals['_SWITCHSERVICEHEARTBEATREQUEST_PORTSTATESENTRY']._serialized_end=985 - _globals['_SWITCHSERVICEHEARTBEATREQUEST_BGPPORTSTATESENTRY']._serialized_start=987 - _globals['_SWITCHSERVICEHEARTBEATREQUEST_BGPPORTSTATESENTRY']._serialized_end=1090 - _globals['_SWITCHSERVICEHEARTBEATRESPONSE']._serialized_start=1103 - _globals['_SWITCHSERVICEHEARTBEATRESPONSE']._serialized_end=1282 - _globals['_SWITCHSERVICE']._serialized_start=1285 - _globals['_SWITCHSERVICE']._serialized_end=1667 -# @@protoc_insertion_point(module_scope) diff --git a/python/metalstack/infra/v2/switch_pb2.pyi b/python/metalstack/infra/v2/switch_pb2.pyi deleted file mode 100644 index 3b7c6c21..00000000 --- a/python/metalstack/infra/v2/switch_pb2.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import datetime - -from buf.validate import validate_pb2 as _validate_pb2 -from google.protobuf import duration_pb2 as _duration_pb2 -from metalstack.api.v2 import common_pb2 as _common_pb2 -from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2 -from metalstack.api.v2 import switch_pb2 as _switch_pb2 -from google.protobuf.internal import containers as _containers -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from collections.abc import Mapping as _Mapping -from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union - -DESCRIPTOR: _descriptor.FileDescriptor - -class SwitchServiceGetRequest(_message.Message): - __slots__ = ("id",) - ID_FIELD_NUMBER: _ClassVar[int] - id: str - def __init__(self, id: _Optional[str] = ...) -> None: ... - -class SwitchServiceGetResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceRegisterRequest(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceRegisterResponse(_message.Message): - __slots__ = ("switch",) - SWITCH_FIELD_NUMBER: _ClassVar[int] - switch: _switch_pb2.Switch - def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ... - -class SwitchServiceHeartbeatRequest(_message.Message): - __slots__ = ("id", "duration", "error", "port_states", "bgp_port_states") - class PortStatesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _switch_pb2.SwitchPortStatus - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_switch_pb2.SwitchPortStatus, str]] = ...) -> None: ... - class BgpPortStatesEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: _switch_pb2.SwitchBGPPortState - def __init__(self, key: _Optional[str] = ..., value: _Optional[_Union[_switch_pb2.SwitchBGPPortState, _Mapping]] = ...) -> None: ... - ID_FIELD_NUMBER: _ClassVar[int] - DURATION_FIELD_NUMBER: _ClassVar[int] - ERROR_FIELD_NUMBER: _ClassVar[int] - PORT_STATES_FIELD_NUMBER: _ClassVar[int] - BGP_PORT_STATES_FIELD_NUMBER: _ClassVar[int] - id: str - duration: _duration_pb2.Duration - error: str - port_states: _containers.ScalarMap[str, _switch_pb2.SwitchPortStatus] - bgp_port_states: _containers.MessageMap[str, _switch_pb2.SwitchBGPPortState] - def __init__(self, id: _Optional[str] = ..., duration: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., error: _Optional[str] = ..., port_states: _Optional[_Mapping[str, _switch_pb2.SwitchPortStatus]] = ..., bgp_port_states: _Optional[_Mapping[str, _switch_pb2.SwitchBGPPortState]] = ...) -> None: ... - -class SwitchServiceHeartbeatResponse(_message.Message): - __slots__ = ("id", "last_sync", "last_sync_error") - ID_FIELD_NUMBER: _ClassVar[int] - LAST_SYNC_FIELD_NUMBER: _ClassVar[int] - LAST_SYNC_ERROR_FIELD_NUMBER: _ClassVar[int] - id: str - last_sync: _switch_pb2.SwitchSync - last_sync_error: _switch_pb2.SwitchSync - def __init__(self, id: _Optional[str] = ..., last_sync: _Optional[_Union[_switch_pb2.SwitchSync, _Mapping]] = ..., last_sync_error: _Optional[_Union[_switch_pb2.SwitchSync, _Mapping]] = ...) -> None: ... diff --git a/python/setup.py b/python/setup.py index e979ea69..ed897582 100644 --- a/python/setup.py +++ b/python/setup.py @@ -5,7 +5,7 @@ REQUIRES = [ # this version needs to match the version specified in buf.gen.yaml - "connectrpc==0.10.1", + "connectrpc==0.11.1", "protobuf>=7.0", "protovalidate>=1.2.0", ]