-
Notifications
You must be signed in to change notification settings - Fork 276
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
Update the REST API endpoint for creating snapshots #4718
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d1266af
Update the REST API endpoint for creating snapshots
EricWittmann 6f8968e
Fix REST Api due to constructor issues on generated code
EricWittmann 9ed0804
Fix client usage due to rest api rename
EricWittmann f58e9cc
Fix incorrect redirect at UI root
EricWittmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 0 additions & 86 deletions
86
go-sdk/pkg/registryclient-v2/models/new_comment_escaped.go
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
go-sdk/pkg/registryclient-v3/admin/config_trigger_snapshot_request_builder.go
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
go-sdk/pkg/registryclient-v3/admin/snapshots_request_builder.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package admin | ||
|
||
import ( | ||
"context" | ||
i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v3/models" | ||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" | ||
) | ||
|
||
// SnapshotsRequestBuilder triggers a snapshot of the Registry storage. Only supported in KafkaSQL storage | ||
type SnapshotsRequestBuilder struct { | ||
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder | ||
} | ||
|
||
// SnapshotsRequestBuilderPostRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. | ||
type SnapshotsRequestBuilderPostRequestConfiguration struct { | ||
// Request headers | ||
Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders | ||
// Request options | ||
Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption | ||
} | ||
|
||
// NewSnapshotsRequestBuilderInternal instantiates a new SnapshotsRequestBuilder and sets the default values. | ||
func NewSnapshotsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *SnapshotsRequestBuilder { | ||
m := &SnapshotsRequestBuilder{ | ||
BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/snapshots", pathParameters), | ||
} | ||
return m | ||
} | ||
|
||
// NewSnapshotsRequestBuilder instantiates a new SnapshotsRequestBuilder and sets the default values. | ||
func NewSnapshotsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *SnapshotsRequestBuilder { | ||
urlParams := make(map[string]string) | ||
urlParams["request-raw-url"] = rawUrl | ||
return NewSnapshotsRequestBuilderInternal(urlParams, requestAdapter) | ||
} | ||
|
||
// Post triggers the creation of a snapshot of the internal database for compatible storages.This operation can fail for the following reasons:* A server error occurred (HTTP error `500`) | ||
func (m *SnapshotsRequestBuilder) Post(ctx context.Context, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.SnapshotMetaDataable, error) { | ||
requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration) | ||
if err != nil { | ||
return nil, err | ||
} | ||
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ | ||
"500": i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateErrorFromDiscriminatorValue, | ||
} | ||
res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateSnapshotMetaDataFromDiscriminatorValue, errorMapping) | ||
if err != nil { | ||
return nil, err | ||
} | ||
if res == nil { | ||
return nil, nil | ||
} | ||
return res.(i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.SnapshotMetaDataable), nil | ||
} | ||
|
||
// ToPostRequestInformation triggers the creation of a snapshot of the internal database for compatible storages.This operation can fail for the following reasons:* A server error occurred (HTTP error `500`) | ||
func (m *SnapshotsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { | ||
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) | ||
if requestConfiguration != nil { | ||
requestInfo.Headers.AddAll(requestConfiguration.Headers) | ||
requestInfo.AddRequestOptions(requestConfiguration.Options) | ||
} | ||
requestInfo.Headers.TryAdd("Accept", "application/json") | ||
return requestInfo, nil | ||
} | ||
|
||
// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. | ||
func (m *SnapshotsRequestBuilder) WithUrl(rawUrl string) *SnapshotsRequestBuilder { | ||
return NewSnapshotsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!