Skip to content

Commit

Permalink
Merge pull request #347 from civo/fix/dbaas-backup
Browse files Browse the repository at this point in the history
Update the struct field for db backup resposne
  • Loading branch information
vishalanarase authored Oct 26, 2023
2 parents b2f2b0b + 20d842d commit c0a0868
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cmd/database/database_backup_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ var dbBackupCreateCmd = &cobra.Command{
"database_id": bk.DatabaseID,
"database_name": bk.DatabaseName,
"software": bk.Software,
"name": bk.Name,
"schedule": bk.Schedule,
"name": bk.Scheduled.Name,
"schedule": bk.Scheduled.Schedule,
"count": fmt.Sprintf("%d", count),
})
switch common.OutputFormat {
Expand All @@ -91,7 +91,7 @@ var dbBackupCreateCmd = &cobra.Command{
case "custom":
ow.WriteCustomOutput(common.OutputFields)
default:
fmt.Printf("Database backup (%s) for database %s has been created\n", utility.Green(bk.Name), utility.Green(bk.DatabaseName))
fmt.Printf("Database backup (%s) for database %s has been created\n", utility.Green(bk.Scheduled.Name), utility.Green(bk.DatabaseName))
}
},
}
10 changes: 5 additions & 5 deletions cmd/database/database_backup_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ var dbBackupListCmd = &cobra.Command{
ow.StartLine()
ow.AppendDataWithLabel("database_id", utility.TrimID(backups.DatabaseID), "Database ID")
ow.AppendDataWithLabel("database_name", backups.DatabaseName, "Database Name")
ow.AppendDataWithLabel("name", backups.Name, "Backup Name")
ow.AppendDataWithLabel("schedule", backups.Schedule, "Schedule")
ow.AppendDataWithLabel("count", fmt.Sprintf("%d", backups.Count), "Count")
ow.AppendDataWithLabel("name", backups.Scheduled.Name, "Backup Name")
ow.AppendDataWithLabel("schedule", backups.Scheduled.Schedule, "Schedule")
ow.AppendDataWithLabel("count", fmt.Sprintf("%d", backups.Scheduled.Count), "Count")

bk := ""
for i, backup := range backups.Backups {
for i, backup := range backups.Scheduled.Backups {
bk += backup
if i < len(backups.Backups)-1 {
if i < len(backups.Scheduled.Backups)-1 {
bk += "\n"
}
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/database/database_backup_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ var dbBackupUpdateCmd = &cobra.Command{
"database_id": bk.DatabaseID,
"database_name": bk.DatabaseName,
"software": bk.Software,
"name": bk.Name,
"schedule": bk.Schedule,
"name": bk.Scheduled.Name,
"schedule": bk.Scheduled.Schedule,
"count": fmt.Sprintf("%d", count),
})
switch common.OutputFormat {
Expand All @@ -79,7 +79,7 @@ var dbBackupUpdateCmd = &cobra.Command{
case "custom":
ow.WriteCustomOutput(common.OutputFields)
default:
fmt.Printf("Database backup (%s) for database %s has been update\n", utility.Green(bk.Name), utility.Green(bk.DatabaseName))
fmt.Printf("Database backup (%s) for database %s has been update\n", utility.Green(bk.Scheduled.Name), utility.Green(bk.DatabaseName))
}
},
}
8 changes: 4 additions & 4 deletions cmd/kubernetes/kubernetes_nodepool_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var kubernetesNodePoolCreateCmd = &cobra.Command{
os.Exit(1)
}

poolConfig := civogo.KubernetesClusterPoolConfig{ID: poolID, Count: numTargetNodesPool, Size: targetNodesPoolSize}
poolConfig := civogo.KubernetesClusterPoolUpdateConfig{ID: poolID, Count: numTargetNodesPool, Size: targetNodesPoolSize}
if publicIpNodePool {
if config.Current.RegionToFeatures != nil {
if !config.Current.RegionToFeatures[client.Region].PublicIPNodePools {
Expand All @@ -69,21 +69,21 @@ var kubernetesNodePoolCreateCmd = &cobra.Command{
poolConfig.PublicIPNodePool = publicIpNodePool
}

kubernetesCluster, err := client.CreateKubernetesPool(kubernetesFindCluster.ID, &poolConfig)
kubernetesCluster, err := client.CreateKubernetesClusterPool(kubernetesFindCluster.ID, &poolConfig)
if err != nil {
utility.Error("%s", err)
os.Exit(1)
}

ow := utility.NewOutputWriterWithMap(map[string]string{"id": kubernetesCluster.ID, "name": kubernetesCluster.Name, "pool_id": poolID[:6]})
ow := utility.NewOutputWriterWithMap(map[string]string{"id": kubernetesCluster.ID, "name": kubernetesFindCluster.Name, "pool_id": poolID[:6]})

switch common.OutputFormat {
case "json":
ow.WriteSingleObjectJSON(common.PrettySet)
case "custom":
ow.WriteCustomOutput(common.OutputFields)
default:
fmt.Printf("The pool (%s) was added to the cluster (%s)\n", utility.Green(poolID), utility.Green(kubernetesCluster.Name))
fmt.Printf("The pool (%s) was added to the cluster (%s)\n", utility.Green(poolID), utility.Green(kubernetesFindCluster.Name))
}
},
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
github.com/briandowns/spinner v1.11.1
github.com/c4milo/unpackit v0.0.0-20170704181138-4ed373e9ef1c // indirect
github.com/civo/civogo v0.3.46
github.com/civo/civogo v0.3.52
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/google/go-github v17.0.0+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/civo/civogo v0.3.46 h1:F95+85P2sqM73bsJVQEgOmDTYCNMkg8uDL/dano6jTU=
github.com/civo/civogo v0.3.46/go.mod h1:54lv/FOf7gh6wE9ZwVdw4yBehk8V1CvU9aWa4v6dvW0=
github.com/civo/civogo v0.3.52 h1:x300yiN6N8cK3kd79RMxLCzsKCWnm4Nxv8+Nn8hjAEI=
github.com/civo/civogo v0.3.52/go.mod h1:54lv/FOf7gh6wE9ZwVdw4yBehk8V1CvU9aWa4v6dvW0=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down

0 comments on commit c0a0868

Please sign in to comment.