Skip to content

Commit 648d12d

Browse files
committed
PMM-12913 migrate /v1/updates/Start
1 parent f8d4a7d commit 648d12d

11 files changed

+294
-293
lines changed

api/MIGRATION_TO_V3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ POST /v1/AWSInstanceCheck GET /v1/server/AWSInstance
1111
POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck ✅
1212
POST /v1/settings/Change PUT /v1/server/settings ✅
1313
POST /v1/settings/Get GET /v1/server/settings ✅
14-
POST /v1/updates/Check GET /v1/server/updates
15-
POST /v1/updates/Start POST /v1/server/updates:start
14+
POST /v1/updates/Check GET /v1/server/updates
15+
POST /v1/updates/Start POST /v1/server/updates:start
1616
POST /v1/updates/Status GET /v1/server/updates/status pass "auth_token" via headers
1717

1818
**UserService** **UserService**

api/server/v1/json/client/server_service/server_service_client.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/v1/json/client/server_service/start_update_responses.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/v1/json/v1.json

+74-74
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,80 @@
846846
}
847847
}
848848
},
849+
"/v1/server/updates:start": {
850+
"post": {
851+
"description": "Starts PMM Server update.",
852+
"tags": [
853+
"ServerService"
854+
],
855+
"summary": "Start update",
856+
"operationId": "StartUpdate",
857+
"parameters": [
858+
{
859+
"name": "body",
860+
"in": "body",
861+
"required": true,
862+
"schema": {
863+
"type": "object"
864+
}
865+
}
866+
],
867+
"responses": {
868+
"200": {
869+
"description": "A successful response.",
870+
"schema": {
871+
"type": "object",
872+
"properties": {
873+
"auth_token": {
874+
"description": "Authentication token for getting update statuses.",
875+
"type": "string",
876+
"x-order": 0
877+
},
878+
"log_offset": {
879+
"description": "Progress log offset.",
880+
"type": "integer",
881+
"format": "int64",
882+
"x-order": 1
883+
}
884+
}
885+
}
886+
},
887+
"default": {
888+
"description": "An unexpected error response.",
889+
"schema": {
890+
"type": "object",
891+
"properties": {
892+
"code": {
893+
"type": "integer",
894+
"format": "int32",
895+
"x-order": 0
896+
},
897+
"details": {
898+
"type": "array",
899+
"items": {
900+
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }",
901+
"type": "object",
902+
"properties": {
903+
"@type": {
904+
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics.",
905+
"type": "string",
906+
"x-order": 0
907+
}
908+
},
909+
"additionalProperties": false
910+
},
911+
"x-order": 2
912+
},
913+
"message": {
914+
"type": "string",
915+
"x-order": 1
916+
}
917+
}
918+
}
919+
}
920+
}
921+
}
922+
},
849923
"/v1/server/version": {
850924
"get": {
851925
"description": "Returns PMM Server versions.",
@@ -972,80 +1046,6 @@
9721046
}
9731047
}
9741048
},
975-
"/v1/updates/Start": {
976-
"post": {
977-
"description": "Starts PMM Server update.",
978-
"tags": [
979-
"ServerService"
980-
],
981-
"summary": "Start update",
982-
"operationId": "StartUpdate",
983-
"parameters": [
984-
{
985-
"name": "body",
986-
"in": "body",
987-
"required": true,
988-
"schema": {
989-
"type": "object"
990-
}
991-
}
992-
],
993-
"responses": {
994-
"200": {
995-
"description": "A successful response.",
996-
"schema": {
997-
"type": "object",
998-
"properties": {
999-
"auth_token": {
1000-
"description": "Authentication token for getting update statuses.",
1001-
"type": "string",
1002-
"x-order": 0
1003-
},
1004-
"log_offset": {
1005-
"description": "Progress log offset.",
1006-
"type": "integer",
1007-
"format": "int64",
1008-
"x-order": 1
1009-
}
1010-
}
1011-
}
1012-
},
1013-
"default": {
1014-
"description": "An unexpected error response.",
1015-
"schema": {
1016-
"type": "object",
1017-
"properties": {
1018-
"code": {
1019-
"type": "integer",
1020-
"format": "int32",
1021-
"x-order": 0
1022-
},
1023-
"details": {
1024-
"type": "array",
1025-
"items": {
1026-
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }",
1027-
"type": "object",
1028-
"properties": {
1029-
"@type": {
1030-
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics.",
1031-
"type": "string",
1032-
"x-order": 0
1033-
}
1034-
},
1035-
"additionalProperties": false
1036-
},
1037-
"x-order": 2
1038-
},
1039-
"message": {
1040-
"type": "string",
1041-
"x-order": 1
1042-
}
1043-
}
1044-
}
1045-
}
1046-
}
1047-
}
1048-
},
10491049
"/v1/updates/Status": {
10501050
"post": {
10511051
"description": "Returns PMM Server update status.",

0 commit comments

Comments
 (0)