Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ocm 5976 | Reverting change for DELETE provision_shards/{id} #910

Merged
merged 3 commits into from
Feb 19, 2024
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

# 0.1.403
- Update model version v0.0.356
- Reverting change to remove provision shard from cluster

## 0.1.402
- Update model version v0.0.355
- Removed undefined api calls from the model
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.355
model_version:=v0.0.356
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
33,412 changes: 16,748 additions & 16,664 deletions clustersmgmt/v1/openapi.go

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions clustersmgmt/v1/provision_shard_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ func NewProvisionShardClient(transport http.RoundTripper, path string) *Provisio
}
}

// Delete creates a request for the 'delete' method.
//
// Delete the provision shard.
func (c *ProvisionShardClient) Delete() *ProvisionShardDeleteRequest {
return &ProvisionShardDeleteRequest{
transport: c.transport,
path: c.path,
}
}

// Get creates a request for the 'get' method.
//
// Retrieves the details of the provision shard.
Expand Down Expand Up @@ -187,6 +197,113 @@ func (c *ProvisionShardClient) Poll() *ProvisionShardPollRequest {
}
}

// ProvisionShardDeleteRequest is the request for the 'delete' method.
type ProvisionShardDeleteRequest struct {
transport http.RoundTripper
path string
query url.Values
header http.Header
}

// Parameter adds a query parameter.
func (r *ProvisionShardDeleteRequest) Parameter(name string, value interface{}) *ProvisionShardDeleteRequest {
helpers.AddValue(&r.query, name, value)
return r
}

// Header adds a request header.
func (r *ProvisionShardDeleteRequest) Header(name string, value interface{}) *ProvisionShardDeleteRequest {
helpers.AddHeader(&r.header, name, value)
return r
}

// Impersonate wraps requests on behalf of another user.
// Note: Services that do not support this feature may silently ignore this call.
func (r *ProvisionShardDeleteRequest) Impersonate(user string) *ProvisionShardDeleteRequest {
helpers.AddImpersonationHeader(&r.header, user)
return r
}

// Send sends this request, waits for the response, and returns it.
//
// This is a potentially lengthy operation, as it requires network communication.
// Consider using a context and the SendContext method.
func (r *ProvisionShardDeleteRequest) Send() (result *ProvisionShardDeleteResponse, err error) {
return r.SendContext(context.Background())
}

// SendContext sends this request, waits for the response, and returns it.
func (r *ProvisionShardDeleteRequest) SendContext(ctx context.Context) (result *ProvisionShardDeleteResponse, err error) {
query := helpers.CopyQuery(r.query)
header := helpers.CopyHeader(r.header)
uri := &url.URL{
Path: r.path,
RawQuery: query.Encode(),
}
request := &http.Request{
Method: "DELETE",
URL: uri,
Header: header,
}
if ctx != nil {
request = request.WithContext(ctx)
}
response, err := r.transport.RoundTrip(request)
if err != nil {
return
}
defer response.Body.Close()
result = &ProvisionShardDeleteResponse{}
result.status = response.StatusCode
result.header = response.Header
reader := bufio.NewReader(response.Body)
_, err = reader.Peek(1)
if err == io.EOF {
err = nil
return
}
if result.status >= 400 {
result.err, err = errors.UnmarshalErrorStatus(reader, result.status)
if err != nil {
return
}
err = result.err
return
}
return
}

// ProvisionShardDeleteResponse is the response for the 'delete' method.
type ProvisionShardDeleteResponse struct {
status int
header http.Header
err *errors.Error
}

// Status returns the response status code.
func (r *ProvisionShardDeleteResponse) Status() int {
if r == nil {
return 0
}
return r.status
}

// Header returns header of the response.
func (r *ProvisionShardDeleteResponse) Header() http.Header {
if r == nil {
return nil
}
return r.header
}

// Error returns the response error.
func (r *ProvisionShardDeleteResponse) Error() *errors.Error {
if r == nil {
return nil
}
return r.err
}

// ProvisionShardGetRequest is the request for the 'get' method.
type ProvisionShardGetRequest struct {
transport http.RoundTripper
Expand Down
6 changes: 6 additions & 0 deletions clustersmgmt/v1/provision_shard_resource_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ package v1 // github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1

import "io"

func writeProvisionShardDeleteRequest(request *ProvisionShardDeleteRequest, writer io.Writer) error {
return nil
}
func readProvisionShardDeleteResponse(response *ProvisionShardDeleteResponse, reader io.Reader) error {
return nil
}
func writeProvisionShardGetRequest(request *ProvisionShardGetRequest, writer io.Writer) error {
return nil
}
Expand Down
56 changes: 56 additions & 0 deletions openapi/clusters_mgmt/v1/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7851,6 +7851,34 @@
}
},
"/api/clusters_mgmt/v1/clusters/{cluster_id}/provision_shard": {
"delete": {
"description": "Delete the provision shard.",
"parameters": [
{
"name": "cluster_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"responses": {
"204": {
"description": "Success."
},
"default": {
"description": "Error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"get": {
"description": "Retrieves the details of the provision shard.",
"parameters": [
Expand Down Expand Up @@ -10928,6 +10956,34 @@
}
},
"/api/clusters_mgmt/v1/provision_shards/{provision_shard_id}": {
"delete": {
"description": "Delete the provision shard.",
"parameters": [
{
"name": "provision_shard_id",
"in": "path",
"schema": {
"type": "string"
},
"required": true
}
],
"responses": {
"204": {
"description": "Success."
},
"default": {
"description": "Error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"get": {
"description": "Retrieves the details of the provision shard.",
"parameters": [
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ limitations under the License.

package sdk

const Version = "0.1.402"
const Version = "0.1.403"
Loading