Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 85 additions & 2 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,46 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/otterscale.resource.v1.SchemaResponse'
/otterscale.resource.v1.ResourceService/Update:
post:
tags:
- ResourceService
summary: Update
description: |-
Update performs a full replacement (PUT) of an existing resource using
the provided manifest. The caller is responsible for supplying any
server-required fields (such as metadata.resourceVersion) inside the
manifest.
Comment thread
ZhangEnYao marked this conversation as resolved.
operationId: ResourceService_Update
parameters:
- name: Connect-Protocol-Version
in: header
required: true
schema:
$ref: '#/components/schemas/connect-protocol-version'
- name: Connect-Timeout-Ms
in: header
schema:
$ref: '#/components/schemas/connect-timeout-header'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/otterscale.resource.v1.UpdateRequest'
required: true
responses:
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/connect.error'
"200":
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/otterscale.resource.v1.Resource'
/otterscale.resource.v1.ResourceService/Watch:
post:
tags:
Expand Down Expand Up @@ -1808,7 +1848,9 @@ components:
type: string
title: manifest
format: byte
description: A partial or YAML manifest in JSON format to be merged by the API server.
description: |-
A partial or complete manifest (YAML or JSON) to be merged by the
API server via Server-Side Apply.
force:
type: boolean
title: force
Expand Down Expand Up @@ -1847,7 +1889,7 @@ components:
type: string
title: manifest
format: byte
description: The full manifest of the object to be created in YAML format.
description: The manifest (YAML or JSON) describing the object to be created.
title: CreateRequest
additionalProperties: false
description: CreateRequest defines the parameters for creating a new object.
Expand Down Expand Up @@ -2107,6 +2149,47 @@ components:
title: SchemaResponse
additionalProperties: false
description: SchemaResponse contains the JSON Schema for a Kubernetes resource type.
otterscale.resource.v1.UpdateRequest:
type: object
properties:
cluster:
type: string
title: cluster
description: The target Kubernetes cluster identifier.
group:
type: string
title: group
description: Kubernetes API Group (e.g., "apps" for Deployments, "" for core resources like Pods).
version:
type: string
title: version
description: Kubernetes API Version (e.g., "v1").
resource:
type: string
title: resource
description: Kubernetes API Resource name in plural (e.g., "pods", "deployments").
namespace:
type: string
title: namespace
description: The namespace of the resource.
name:
type: string
title: name
description: The name of the resource.
manifest:
type: string
title: manifest
format: byte
description: |-
The complete manifest (YAML or JSON) that will replace the stored object.
Server-required fields such as metadata.resourceVersion must be included.
fieldManager:
type: string
title: field_manager
description: Identifies the entity submitting the update (e.g., "otterscale-web-ui").
title: UpdateRequest
additionalProperties: false
description: UpdateRequest defines the parameters for a full-replacement update (PUT).
otterscale.resource.v1.WatchEvent:
type: object
properties:
Expand Down
45 changes: 43 additions & 2 deletions proto/resource/v1/resource.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ service ResourceService {
option (otterscale.api.feature) = {name: "resource-enabled"};
}

// Update performs a full replacement (PUT) of an existing resource using
// the provided manifest. The caller is responsible for supplying any
// server-required fields (such as metadata.resourceVersion) inside the
// manifest.
rpc Update(UpdateRequest) returns (Resource) {
option (otterscale.api.feature) = {name: "resource-enabled"};
}

// Delete removes a resource from the cluster by its name.
rpc Delete(DeleteRequest) returns (google.protobuf.Empty) {
option (otterscale.api.feature) = {name: "resource-enabled"};
Expand Down Expand Up @@ -264,7 +272,7 @@ message CreateRequest {
// The namespace of the resource.
string namespace = 5;

// The full manifest of the object to be created in YAML format.
// The manifest (YAML or JSON) describing the object to be created.
bytes manifest = 6;
}

Expand Down Expand Up @@ -292,7 +300,8 @@ message ApplyRequest {
// The name of the resource.
string name = 6;

// A partial or YAML manifest in JSON format to be merged by the API server.
// A partial or complete manifest (YAML or JSON) to be merged by the
// API server via Server-Side Apply.
bytes manifest = 7;

// If true, conflicts are resolved in favour of the caller's field manager.
Expand All @@ -302,6 +311,38 @@ message ApplyRequest {
string field_manager = 9;
}

// ---------------------------------------------------------------------------
// Update
// ---------------------------------------------------------------------------

// UpdateRequest defines the parameters for a full-replacement update (PUT).
message UpdateRequest {
// The target Kubernetes cluster identifier.
string cluster = 1;

// Kubernetes API Group (e.g., "apps" for Deployments, "" for core resources like Pods).
string group = 2;

// Kubernetes API Version (e.g., "v1").
string version = 3;

// Kubernetes API Resource name in plural (e.g., "pods", "deployments").
string resource = 4;

// The namespace of the resource.
string namespace = 5;

// The name of the resource.
string name = 6;

// The complete manifest (YAML or JSON) that will replace the stored object.
// Server-required fields such as metadata.resourceVersion must be included.
bytes manifest = 7;

// Identifies the entity submitting the update (e.g., "otterscale-web-ui").
string field_manager = 8;
}

// ---------------------------------------------------------------------------
// Delete
// ---------------------------------------------------------------------------
Expand Down
40 changes: 40 additions & 0 deletions resource/v1/resource.connect.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading