diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f078b8a..0f4df7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.5 - name: Install Go - uses: actions/setup-go@v4.1.0 + uses: actions/setup-go@v5.0.1 with: go-version-file: go.mod diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 96e99cf..945e17e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,11 +35,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.1.5 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. diff --git a/service/fixed/databases/model.go b/service/fixed/databases/model.go new file mode 100644 index 0000000..b849159 --- /dev/null +++ b/service/fixed/databases/model.go @@ -0,0 +1,146 @@ +package databases + +import ( + "time" + + "github.com/RedisLabs/rediscloud-go-api/internal" + "github.com/RedisLabs/rediscloud-go-api/service/databases" +) + +type CreateFixedDatabase struct { + Name *string `json:"name,omitempty"` + Protocol *string `json:"protocol,omitempty"` + MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` + SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` + RespVersion *string `json:"respVersion,omitempty"` + UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` + EnableDatabaseClustering *bool `json:"enableDatabaseClustering,omitempty"` + DataPersistence *string `json:"dataPersistence,omitempty"` + DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` + Replication *bool `json:"replication,omitempty"` + PeriodicBackupPath *string `json:"periodicBackupPath,omitempty"` + SourceIPs []*string `json:"sourceIps,omitempty"` + RegexRules []*string `json:"regexRules,omitempty"` + Replica *ReplicaOf `json:"replica,omitempty"` + ClientTlsCertificates []*DatabaseCertificate `json:"clientTlsCertificates,omitempty"` + EnableTls *bool `json:"enableTls,omitempty"` + Password *string `json:"password,omitempty"` + Alerts []*databases.Alert `json:"alerts,omitempty"` + Modules []*databases.Module `json:"modules,omitempty"` +} + +type UpdateFixedDatabase struct { + Name *string `json:"name,omitempty"` + MemoryLimitInGB *float64 `json:"memoryLimitInGb,omitempty"` + SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` + RespVersion *string `json:"respVersion,omitempty"` + UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` + EnableDatabaseClustering *bool `json:"enableDatabaseClustering,omitempty"` + DataPersistence *string `json:"dataPersistence,omitempty"` + DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` + Replication *bool `json:"replication,omitempty"` + PeriodicBackupPath *string `json:"periodicBackupPath,omitempty"` + SourceIPs []*string `json:"sourceIps,omitempty"` + Replica *ReplicaOf `json:"replica,omitempty"` + RegexRules []*string `json:"regexRules,omitempty"` + ClientTlsCertificates []*DatabaseCertificate `json:"clientTlsCertificates,omitempty"` + EnableTls *bool `json:"enableTls,omitempty"` + Password *string `json:"password,omitempty"` + Alerts []*databases.Alert `json:"alerts,omitempty"` + // As with flexible databases, this is only available on the update endpoint + EnableDefaultUser *bool `json:"enableDefaultUser,omitempty"` +} + +type FixedDatabase struct { + DatabaseId *int `json:"databaseId,omitempty"` + Name *string `json:"name,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Provider *string `json:"provider,omitempty"` + Region *string `json:"region,omitempty"` + RedisVersionCompliance *string `json:"redisVersionCompliance,omitempty"` + RespVersion *string `json:"respVersion,omitempty"` + Status *string `json:"status,omitempty"` + PlanMemoryLimit *float64 `json:"planMemoryLimit,omitempty"` + MemoryLimitMeasurementUnit *string `json:"memoryLimitMeasurementUnit,omitempty"` + MemoryLimitInGb *float64 `json:"memoryLimitInGb,omitempty"` + MemoryUsedInMb *float64 `json:"memoryUsedInMb,omitempty"` + NetworkMonthlyUsageInByte *float64 `json:"networkMonthlyUsageInByte,omitempty"` + MemoryStorage *string `json:"memoryStorage,omitempty"` + SupportOSSClusterAPI *bool `json:"supportOSSClusterApi,omitempty"` + UseExternalEndpointForOSSClusterAPI *bool `json:"useExternalEndpointForOSSClusterApi,omitempty"` + DataPersistence *string `json:"dataPersistence,omitempty"` + Replication *bool `json:"replication,omitempty"` + DataEvictionPolicy *string `json:"dataEvictionPolicy,omitempty"` + ActivatedOn *time.Time `json:"activatedOn,omitempty"` + LastModified *time.Time `json:"lastModified,omitempty"` + PublicEndpoint *string `json:"publicEndpoint,omitempty"` + PrivateEndpoint *string `json:"privateEndpoint,omitempty"` + // The following are undocumented but are returned + Replica *ReplicaOf `json:"replica,omitempty"` + Clustering *Clustering `json:"clustering,omitempty"` + Security *Security `json:"security,omitempty"` + Modules *[]databases.Module `json:"modules,omitempty"` + Alerts *[]databases.Alert `json:"alerts,omitempty"` + Backup *databases.Backup `json:"backup,omitempty"` +} + +type ReplicaOf struct { + Description *string `json:"description,omitempty"` + SyncSources []*SyncSource `json:"syncSources,omitempty"` +} + +func (o ReplicaOf) String() string { + return internal.ToString(o) +} + +type SyncSource struct { + Description *string `json:"description,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + Encryption *bool `json:"encryption,omitempty"` + ServerCert *string `json:"serverCert,omitempty"` +} + +func (o SyncSource) String() string { + return internal.ToString(o) +} + +type DatabaseCertificate struct { + Description *string `json:"description,omitempty"` + PublicCertificatePEMString *string `json:"publicCertificatePEMString,omitempty"` +} + +func (o DatabaseCertificate) String() string { + return internal.ToString(o) +} + +type Clustering struct { + Enabled *bool `json:"enabled,omitempty"` + RegexRules *[]databases.RegexRule `json:"regexRules,omitempty"` + HashingPolicy *string `json:"hashingPolicy,omitempty"` +} + +func (o Clustering) String() string { + return internal.ToString(o) +} + +type Security struct { + EnableDefaultUser *bool `json:"defaultUserEnabled,omitempty"` + Password *string `json:"password,omitempty"` + SSLClientAuthentication *bool `json:"sslClientAuthentication,omitempty"` + TLSClientAuthentication *bool `json:"tlsClientAuthentication,omitempty"` + EnableTls *bool `json:"enableTls,omitempty"` + SourceIPs []*string `json:"sourceIps,omitempty"` +} + +func (o Security) String() string { + return internal.ToString(o) +} + +type Backup struct { + Enabled *bool `json:"remoteBackupEnabled,omitempty"` + Status *string `json:"status,omitempty"` +} + +func (o Backup) String() string { + return internal.ToString(o) +}