Files
teleport/lib/services/databaseobjectimportrule.go
T
Krzysztof Skrzętnicki 0f5f6124c5 Change the tctl format for database_object_import_rule resource (#39764)
* Fix incorrect expiry when using resource153ToLegacyAdapter

* Change the `tctl` format for database_object_import_rule resource.

Prior to this change the resource wouldn't round-trip through `tctl get ... | tctl create` because of header incompatibilities.

In general, all resources must be compatible with services.UnknownResource for their `tctl` storage format.

* Lint fix
2024-04-04 11:10:40 +00:00

47 lines
2.3 KiB
Go

/*
* Teleport
* Copyright (C) 2023 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package services
import (
"context"
dbobjectimportrulev1 "github.com/gravitational/teleport/api/gen/proto/go/teleport/dbobjectimportrule/v1"
)
// DatabaseObjectImportRules manages DatabaseObjectImportRule resources.
type DatabaseObjectImportRules interface {
// CreateDatabaseObjectImportRule will create a new DatabaseObjectImportRule resource.
CreateDatabaseObjectImportRule(ctx context.Context, rule *dbobjectimportrulev1.DatabaseObjectImportRule) (*dbobjectimportrulev1.DatabaseObjectImportRule, error)
// UpsertDatabaseObjectImportRule creates a new DatabaseObjectImportRule or forcefully updates an existing DatabaseObjectImportRule.
UpsertDatabaseObjectImportRule(ctx context.Context, rule *dbobjectimportrulev1.DatabaseObjectImportRule) (*dbobjectimportrulev1.DatabaseObjectImportRule, error)
// GetDatabaseObjectImportRule will get a DatabaseObjectImportRule resource by name.
GetDatabaseObjectImportRule(ctx context.Context, name string) (*dbobjectimportrulev1.DatabaseObjectImportRule, error)
// DeleteDatabaseObjectImportRule will delete a DatabaseObjectImportRule resource.
DeleteDatabaseObjectImportRule(ctx context.Context, name string) error
// UpdateDatabaseObjectImportRule updates an existing DatabaseObjectImportRule.
UpdateDatabaseObjectImportRule(ctx context.Context, rule *dbobjectimportrulev1.DatabaseObjectImportRule) (*dbobjectimportrulev1.DatabaseObjectImportRule, error)
// ListDatabaseObjectImportRules will list DatabaseObjectImportRule resources.
ListDatabaseObjectImportRules(ctx context.Context, size int, pageToken string) ([]*dbobjectimportrulev1.DatabaseObjectImportRule, string, error)
}