diff --git a/app/src/main/java/io/apicurio/registry/rest/v3/AdminResourceImpl.java b/app/src/main/java/io/apicurio/registry/rest/v3/AdminResourceImpl.java index ac9035bdb0..e8131110fe 100644 --- a/app/src/main/java/io/apicurio/registry/rest/v3/AdminResourceImpl.java +++ b/app/src/main/java/io/apicurio/registry/rest/v3/AdminResourceImpl.java @@ -1,31 +1,5 @@ package io.apicurio.registry.rest.v3; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_FOR_BROWSER; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_NAME; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_PRINCIPAL_ID; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_ROLE_MAPPING; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_RULE; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_RULE_TYPE; -import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_UPDATE_ROLE; -import static io.apicurio.registry.util.DtoUtil.appAuthPropertyToRegistry; -import static io.apicurio.registry.util.DtoUtil.registryAuthPropertyToApp; - -import java.io.IOException; -import java.io.InputStream; -import java.math.BigInteger; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.function.Supplier; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.zip.ZipInputStream; - -import org.eclipse.microprofile.config.Config; -import org.eclipse.microprofile.config.inject.ConfigProperty; -import org.slf4j.Logger; - import io.apicurio.common.apps.config.Dynamic; import io.apicurio.common.apps.config.DynamicConfigPropertyDef; import io.apicurio.common.apps.config.DynamicConfigPropertyDto; @@ -46,6 +20,7 @@ import io.apicurio.registry.rest.v3.beans.RoleMapping; import io.apicurio.registry.rest.v3.beans.RoleMappingSearchResults; import io.apicurio.registry.rest.v3.beans.Rule; +import io.apicurio.registry.rest.v3.beans.SnapshotMetaData; import io.apicurio.registry.rest.v3.beans.UpdateConfigurationProperty; import io.apicurio.registry.rest.v3.beans.UpdateRole; import io.apicurio.registry.rest.v3.shared.DataExporter; @@ -73,6 +48,31 @@ import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; +import org.eclipse.microprofile.config.Config; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.slf4j.Logger; + +import java.io.IOException; +import java.io.InputStream; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.zip.ZipInputStream; + +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_FOR_BROWSER; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_NAME; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_PRINCIPAL_ID; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_ROLE_MAPPING; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_RULE; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_RULE_TYPE; +import static io.apicurio.common.apps.logging.audit.AuditingConstants.KEY_UPDATE_ROLE; +import static io.apicurio.registry.util.DtoUtil.appAuthPropertyToRegistry; +import static io.apicurio.registry.util.DtoUtil.registryAuthPropertyToApp; @ApplicationScoped @Interceptors({ResponseErrorLivenessCheck.class, ResponseTimeoutReadinessCheck.class}) @@ -109,7 +109,7 @@ public class AdminResourceImpl implements AdminResource { @Info(category = "download", description = "Download link expiry", availableSince = "2.1.2.Final") Supplier downloadHrefTtl; - private static final void requireParameter(String parameterName, Object parameterValue) { + private static void requireParameter(String parameterName, Object parameterValue) { if (parameterValue == null) { throw new MissingRequiredParameterException(parameterName); } @@ -135,8 +135,9 @@ public List listArtifactTypes() { @Override @Authorized(style=AuthorizedStyle.None, level=AuthorizedLevel.Admin) - public void triggerSnapshot() { + public SnapshotMetaData triggerSnapshot() { storage.triggerSnapshotCreation(); + return SnapshotMetaData.builder().build(); } /** @@ -381,7 +382,7 @@ public List listConfigProperties() { // Return value is the set of all dynamic config properties, with either configured or default values (depending // on whether the value is actually configured and stored in the DB or not). return dynamicPropertyIndex.getAcceptedPropertyNames().stream() - .sorted((pname1, pname2) -> pname1.compareTo(pname2)) + .sorted(String::compareTo) .map(pname -> propsI.containsKey(pname) ? V3ApiUtil.dtoToConfigurationProperty(dynamicPropertyIndex.getProperty(pname), propsI.get(pname)) : defToConfigurationProperty(dynamicPropertyIndex.getProperty(pname))) .collect(Collectors.toList()); } @@ -454,7 +455,7 @@ private ConfigurationProperty defToConfigurationProperty(DynamicConfigPropertyDe /** * Lookup the dynamic configuration property being set. Ensure that it exists (throws - * a {@link NotFoundException} if it does not. + * a {@link io.apicurio.registry.storage.error.NotFoundException} if it does not. * @param propertyName the name of the dynamic property * @return the dynamic config property definition */ diff --git a/common/src/main/resources/META-INF/openapi.json b/common/src/main/resources/META-INF/openapi.json index ead1c3239a..494ccd26d0 100644 --- a/common/src/main/resources/META-INF/openapi.json +++ b/common/src/main/resources/META-INF/openapi.json @@ -2482,9 +2482,9 @@ "description": "Gets a list of all the configured artifact types.\n\nThis operation can fail for the following reasons:\n\n* A server error occurred (HTTP error `500`)\n" } }, - "/admin/config/triggerSnapshot": { + "/admin/snapshots": { "summary": "Triggers a snapshot of the Registry storage. Only supported in KafkaSQL storage", - "get": { + "post": { "tags": [ "KafkaSQL", "Admin", @@ -2492,8 +2492,14 @@ ], "responses": { "200": { - "content": {}, - "description": "Empty content. A 200 means that the snapshot has been successfully triggered." + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SnapshotMetaData" + } + } + }, + "description": "The snapshot has been successfully triggered." }, "500": { "$ref": "#/components/responses/ServerError" @@ -4442,6 +4448,21 @@ "createdOn" ], "type": "string" + }, + "SnapshotMetaData": { + "title": "Root Type for SnapshotMetaData", + "description": "", + "required": [ + "snapshotId" + ], + "type": "object", + "properties": { + "snapshotId": { + "description": "", + "type": "string" + } + }, + "example": {} } }, "responses": { diff --git a/go-sdk/pkg/registryclient-v2/models/new_comment_escaped.go b/go-sdk/pkg/registryclient-v2/models/new_comment_escaped.go deleted file mode 100644 index a4ce97d6e0..0000000000 --- a/go-sdk/pkg/registryclient-v2/models/new_comment_escaped.go +++ /dev/null @@ -1,86 +0,0 @@ -package models - -import ( - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" -) - -// NewCommentEscaped -type NewCommentEscaped struct { - // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - additionalData map[string]any - // The value property - value *string -} - -// NewNewCommentEscaped instantiates a new NewCommentEscaped and sets the default values. -func NewNewCommentEscaped() *NewCommentEscaped { - m := &NewCommentEscaped{} - m.SetAdditionalData(make(map[string]any)) - return m -} - -// CreateNewCommentEscapedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -func CreateNewCommentEscapedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewNewCommentEscaped(), nil -} - -// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *NewCommentEscaped) GetAdditionalData() map[string]any { - return m.additionalData -} - -// GetFieldDeserializers the deserialization information for the current model -func (m *NewCommentEscaped) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) - res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetStringValue() - if err != nil { - return err - } - if val != nil { - m.SetValue(val) - } - return nil - } - return res -} - -// GetValue gets the value property value. The value property -func (m *NewCommentEscaped) GetValue() *string { - return m.value -} - -// Serialize serializes information the current object -func (m *NewCommentEscaped) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { - { - err := writer.WriteStringValue("value", m.GetValue()) - if err != nil { - return err - } - } - { - err := writer.WriteAdditionalData(m.GetAdditionalData()) - if err != nil { - return err - } - } - return nil -} - -// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *NewCommentEscaped) SetAdditionalData(value map[string]any) { - m.additionalData = value -} - -// SetValue sets the value property value. The value property -func (m *NewCommentEscaped) SetValue(value *string) { - m.value = value -} - -// NewCommentEscapedable -type NewCommentEscapedable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetValue() *string - SetValue(value *string) -} diff --git a/go-sdk/pkg/registryclient-v3/admin/admin_request_builder.go b/go-sdk/pkg/registryclient-v3/admin/admin_request_builder.go index 694f0c1aef..19892a3ea6 100644 --- a/go-sdk/pkg/registryclient-v3/admin/admin_request_builder.go +++ b/go-sdk/pkg/registryclient-v3/admin/admin_request_builder.go @@ -48,3 +48,8 @@ func (m *AdminRequestBuilder) RoleMappings() *RoleMappingsRequestBuilder { func (m *AdminRequestBuilder) Rules() *RulesRequestBuilder { return NewRulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) } + +// Snapshots triggers a snapshot of the Registry storage. Only supported in KafkaSQL storage +func (m *AdminRequestBuilder) Snapshots() *SnapshotsRequestBuilder { + return NewSnapshotsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/go-sdk/pkg/registryclient-v3/admin/config_trigger_snapshot_request_builder.go b/go-sdk/pkg/registryclient-v3/admin/config_trigger_snapshot_request_builder.go deleted file mode 100644 index 0a8111e365..0000000000 --- a/go-sdk/pkg/registryclient-v3/admin/config_trigger_snapshot_request_builder.go +++ /dev/null @@ -1,70 +0,0 @@ -package admin - -import ( - "context" - i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71 "github.com/apicurio/apicurio-registry/go-sdk/pkg/registryclient-v3/models" - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" -) - -// ConfigTriggerSnapshotRequestBuilder triggers a snapshot of the Registry storage. Only supported in KafkaSQL storage -type ConfigTriggerSnapshotRequestBuilder struct { - i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder -} - -// ConfigTriggerSnapshotRequestBuilderGetRequestConfiguration configuration for the request such as headers, query parameters, and middleware options. -type ConfigTriggerSnapshotRequestBuilderGetRequestConfiguration struct { - // Request headers - Headers *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestHeaders - // Request options - Options []i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestOption -} - -// NewConfigTriggerSnapshotRequestBuilderInternal instantiates a new TriggerSnapshotRequestBuilder and sets the default values. -func NewConfigTriggerSnapshotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ConfigTriggerSnapshotRequestBuilder { - m := &ConfigTriggerSnapshotRequestBuilder{ - BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/config/triggerSnapshot", pathParameters), - } - return m -} - -// NewConfigTriggerSnapshotRequestBuilder instantiates a new TriggerSnapshotRequestBuilder and sets the default values. -func NewConfigTriggerSnapshotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter) *ConfigTriggerSnapshotRequestBuilder { - urlParams := make(map[string]string) - urlParams["request-raw-url"] = rawUrl - return NewConfigTriggerSnapshotRequestBuilderInternal(urlParams, requestAdapter) -} - -// Get 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 *ConfigTriggerSnapshotRequestBuilder) Get(ctx context.Context, requestConfiguration *ConfigTriggerSnapshotRequestBuilderGetRequestConfiguration) ([]byte, error) { - requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration) - if err != nil { - return nil, err - } - errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{ - "500": i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateErrorFromDiscriminatorValue, - } - res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", errorMapping) - if err != nil { - return nil, err - } - if res == nil { - return nil, nil - } - return res.([]byte), nil -} - -// ToGetRequestInformation 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 *ConfigTriggerSnapshotRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *ConfigTriggerSnapshotRequestBuilderGetRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { - requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, 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 *ConfigTriggerSnapshotRequestBuilder) WithUrl(rawUrl string) *ConfigTriggerSnapshotRequestBuilder { - return NewConfigTriggerSnapshotRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter) -} diff --git a/go-sdk/pkg/registryclient-v3/admin/snapshots_request_builder.go b/go-sdk/pkg/registryclient-v3/admin/snapshots_request_builder.go new file mode 100644 index 0000000000..2849175068 --- /dev/null +++ b/go-sdk/pkg/registryclient-v3/admin/snapshots_request_builder.go @@ -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) +} diff --git a/go-sdk/pkg/registryclient-v3/kiota-lock.json b/go-sdk/pkg/registryclient-v3/kiota-lock.json index 9ea3d354ba..0285db31e8 100644 --- a/go-sdk/pkg/registryclient-v3/kiota-lock.json +++ b/go-sdk/pkg/registryclient-v3/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "63866A1698DBB7DE89156A5B48D7BDCEC3C8CA3C96D8789E209496ABED828D4388775AEA55B710450C15EFCC7C99C60D43395DE7648C86CAB639E3683E00B82C", + "descriptionHash": "529CE820489E3D80E20AD8B9FF580F48197ACE698CABD870E42CCAFD8C6B517851E02D68DBBBAA0DD52197FE9FB4F54B9F5B0FC7333425F8663304F20BECADAF", "descriptionLocation": "../../v3.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.10.1", diff --git a/go-sdk/pkg/registryclient-v3/models/new_comment_escaped.go b/go-sdk/pkg/registryclient-v3/models/new_comment_escaped.go deleted file mode 100644 index a4ce97d6e0..0000000000 --- a/go-sdk/pkg/registryclient-v3/models/new_comment_escaped.go +++ /dev/null @@ -1,86 +0,0 @@ -package models - -import ( - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" -) - -// NewCommentEscaped -type NewCommentEscaped struct { - // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. - additionalData map[string]any - // The value property - value *string -} - -// NewNewCommentEscaped instantiates a new NewCommentEscaped and sets the default values. -func NewNewCommentEscaped() *NewCommentEscaped { - m := &NewCommentEscaped{} - m.SetAdditionalData(make(map[string]any)) - return m -} - -// CreateNewCommentEscapedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value -func CreateNewCommentEscapedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { - return NewNewCommentEscaped(), nil -} - -// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *NewCommentEscaped) GetAdditionalData() map[string]any { - return m.additionalData -} - -// GetFieldDeserializers the deserialization information for the current model -func (m *NewCommentEscaped) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) - res["value"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { - val, err := n.GetStringValue() - if err != nil { - return err - } - if val != nil { - m.SetValue(val) - } - return nil - } - return res -} - -// GetValue gets the value property value. The value property -func (m *NewCommentEscaped) GetValue() *string { - return m.value -} - -// Serialize serializes information the current object -func (m *NewCommentEscaped) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { - { - err := writer.WriteStringValue("value", m.GetValue()) - if err != nil { - return err - } - } - { - err := writer.WriteAdditionalData(m.GetAdditionalData()) - if err != nil { - return err - } - } - return nil -} - -// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -func (m *NewCommentEscaped) SetAdditionalData(value map[string]any) { - m.additionalData = value -} - -// SetValue sets the value property value. The value property -func (m *NewCommentEscaped) SetValue(value *string) { - m.value = value -} - -// NewCommentEscapedable -type NewCommentEscapedable interface { - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder - i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable - GetValue() *string - SetValue(value *string) -} diff --git a/go-sdk/pkg/registryclient-v3/models/snapshot_meta_data.go b/go-sdk/pkg/registryclient-v3/models/snapshot_meta_data.go new file mode 100644 index 0000000000..d4f1a86d29 --- /dev/null +++ b/go-sdk/pkg/registryclient-v3/models/snapshot_meta_data.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SnapshotMetaData +type SnapshotMetaData struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The snapshotId property + snapshotId *string +} + +// NewSnapshotMetaData instantiates a new SnapshotMetaData and sets the default values. +func NewSnapshotMetaData() *SnapshotMetaData { + m := &SnapshotMetaData{} + m.SetAdditionalData(make(map[string]any)) + return m +} + +// CreateSnapshotMetaDataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +func CreateSnapshotMetaDataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) (i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshotMetaData(), nil +} + +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SnapshotMetaData) GetAdditionalData() map[string]any { + return m.additionalData +} + +// GetFieldDeserializers the deserialization information for the current model +func (m *SnapshotMetaData) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error) + res["snapshotId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSnapshotId(val) + } + return nil + } + return res +} + +// GetSnapshotId gets the snapshotId property value. The snapshotId property +func (m *SnapshotMetaData) GetSnapshotId() *string { + return m.snapshotId +} + +// Serialize serializes information the current object +func (m *SnapshotMetaData) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error { + { + err := writer.WriteStringValue("snapshotId", m.GetSnapshotId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} + +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *SnapshotMetaData) SetAdditionalData(value map[string]any) { + m.additionalData = value +} + +// SetSnapshotId sets the snapshotId property value. The snapshotId property +func (m *SnapshotMetaData) SetSnapshotId(value *string) { + m.snapshotId = value +} + +// SnapshotMetaDataable +type SnapshotMetaDataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSnapshotId() *string + SetSnapshotId(value *string) +} diff --git a/integration-tests/src/test/java/io/apicurio/deployment/KafkaSqlDeploymentManager.java b/integration-tests/src/test/java/io/apicurio/deployment/KafkaSqlDeploymentManager.java index cd170c6c68..f341dddb3e 100644 --- a/integration-tests/src/test/java/io/apicurio/deployment/KafkaSqlDeploymentManager.java +++ b/integration-tests/src/test/java/io/apicurio/deployment/KafkaSqlDeploymentManager.java @@ -82,7 +82,7 @@ private static void prepareSnapshotData(String registryBaseUrl) { } LOGGER.info("Creating kafkasql snapshot.."); - client.admin().config().triggerSnapshot().get(); + client.admin().snapshots().post(); LOGGER.info("Adding new artifacts on top of the snapshot.."); for (int idx = 0; idx < 1000; idx++) { diff --git a/ui/ui-app/src/app/pages/root/RootRedirectPage.tsx b/ui/ui-app/src/app/pages/root/RootRedirectPage.tsx index 48c49f9844..1426dcd953 100644 --- a/ui/ui-app/src/app/pages/root/RootRedirectPage.tsx +++ b/ui/ui-app/src/app/pages/root/RootRedirectPage.tsx @@ -9,7 +9,7 @@ import { AppNavigation, useAppNavigation } from "@services/useAppNavigation.ts"; export const RootRedirectPage: FunctionComponent = () => { const appNav: AppNavigation = useAppNavigation(); - const redirect: string = appNav.createLink("/artifacts"); + const redirect: string = appNav.createLink("/explore"); return ( );