Skip to content

Commit 0acfb08

Browse files
CLOUDP-148788: [AtlasCLI] cutover command is using orgId instead of projectId (#1543)
1 parent f59fc52 commit 0acfb08

File tree

9 files changed

+25
-26
lines changed

9 files changed

+25
-26
lines changed

docs/atlascli/command/atlas-liveMigrations-create.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ Options
5656
- strings
5757
- true
5858
- List of hosts running the MongoDB Agent that can transfer your MongoDB data from the source (Cloud Manager or Ops Manager) to destination (Atlas) deployments. Each live migration process uses its own dedicated migration host.
59-
* - --orgId
60-
- string
61-
- false
62-
- Organization ID to use. Overrides the settings in the configuration file or environment variable.
6359
* - -o, --output
6460
- string
6561
- false
6662
- Output format. Valid values are json, json-path, go-template, or go-template-file.
63+
* - --projectId
64+
- string
65+
- false
66+
- Project ID to use. Overrides the settings in the configuration file or environment variable.
6767
* - --sourceCACertificatePath
6868
- string
6969
- false

docs/atlascli/command/atlas-liveMigrations-validation-create.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ Options
5656
- strings
5757
- true
5858
- List of hosts running the MongoDB Agent that can transfer your MongoDB data from the source (Cloud Manager or Ops Manager) to destination (Atlas) deployments. Each live migration process uses its own dedicated migration host.
59-
* - --orgId
60-
- string
61-
- false
62-
- Organization ID to use. Overrides the settings in the configuration file or environment variable.
6359
* - -o, --output
6460
- string
6561
- false
6662
- Output format. Valid values are json, json-path, go-template, or go-template-file.
63+
* - --projectId
64+
- string
65+
- false
66+
- Project ID to use. Overrides the settings in the configuration file or environment variable.
6767
* - --sourceCACertificatePath
6868
- string
6969
- false

docs/mongocli/command/mongocli-atlas-liveMigrations-create.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ Options
5656
- strings
5757
- true
5858
- List of hosts running the MongoDB Agent that can transfer your MongoDB data from the source (Cloud Manager or Ops Manager) to destination (Atlas) deployments. Each live migration process uses its own dedicated migration host.
59-
* - --orgId
60-
- string
61-
- false
62-
- Organization ID to use. Overrides the settings in the configuration file or environment variable.
6359
* - -o, --output
6460
- string
6561
- false
6662
- Output format. Valid values are json, json-path, go-template, or go-template-file.
63+
* - --projectId
64+
- string
65+
- false
66+
- Project ID to use. Overrides the settings in the configuration file or environment variable.
6767
* - --sourceCACertificatePath
6868
- string
6969
- false

docs/mongocli/command/mongocli-atlas-liveMigrations-validation-create.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ Options
5656
- strings
5757
- true
5858
- List of hosts running the MongoDB Agent that can transfer your MongoDB data from the source (Cloud Manager or Ops Manager) to destination (Atlas) deployments. Each live migration process uses its own dedicated migration host.
59-
* - --orgId
60-
- string
61-
- false
62-
- Organization ID to use. Overrides the settings in the configuration file or environment variable.
6359
* - -o, --output
6460
- string
6561
- false
6662
- Output format. Valid values are json, json-path, go-template, or go-template-file.
63+
* - --projectId
64+
- string
65+
- false
66+
- Project ID to use. Overrides the settings in the configuration file or environment variable.
6767
* - --sourceCACertificatePath
6868
- string
6969
- false

internal/cli/atlas/livemigrations/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestCreateBuilder(t *testing.T) {
6565
CreateBuilder(),
6666
0,
6767
[]string{
68-
flag.OrgID,
68+
flag.ProjectID,
6969
flag.LiveMigrationSourceClusterName,
7070
flag.LiveMigrationSourceProjectID,
7171
flag.LiveMigrationSourceUsername,

internal/cli/atlas/livemigrations/cutover.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (opts *CutoverOpts) initStore(ctx context.Context) func() error {
4343
}
4444

4545
func (opts *CutoverOpts) Run() error {
46-
r, err := opts.store.CreateLiveMigrationCutover(opts.ConfigOrgID(), opts.liveMigrationID)
46+
r, err := opts.store.CreateLiveMigrationCutover(opts.ConfigProjectID(), opts.liveMigrationID)
4747
if err != nil {
4848
return err
4949
}
@@ -60,7 +60,7 @@ func CutoverBuilder() *cobra.Command {
6060
Long: "Your API Key must have the Organization Owner role to successfully run this command.",
6161
PreRunE: func(cmd *cobra.Command, args []string) error {
6262
return opts.PreRunE(
63-
opts.ValidateOrgID,
63+
opts.ValidateProjectID,
6464
opts.initStore(cmd.Context()),
6565
opts.InitOutput(cmd.OutOrStdout(), cutoverTemplate),
6666
)

internal/cli/atlas/livemigrations/options/live_migrations_opts.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ func (opts *LiveMigrationsOpts) Validate() error {
125125
return err
126126
}
127127

128-
if opts.SourceManagedAuthentication && opts.SourceUsername != "" {
129-
return fmt.Errorf("--%s and --%s are exclusive", flag.LiveMigrationSourceManagedAuthentication, flag.LiveMigrationSourceUsername)
130-
}
131128
if !opts.SourceManagedAuthentication && opts.SourceUsername == "" {
132129
return fmt.Errorf("MongoDB Automation is not managing authentication, --%s must be set", flag.LiveMigrationSourceUsername)
133130
}
@@ -138,7 +135,7 @@ func (opts *LiveMigrationsOpts) Validate() error {
138135
}
139136

140137
func (opts *LiveMigrationsOpts) GenerateFlags(cmd *cobra.Command) {
141-
cmd.Flags().StringVar(&opts.OrgID, flag.OrgID, "", usage.OrgID)
138+
cmd.Flags().StringVar(&opts.ProjectID, flag.ProjectID, "", usage.ProjectID)
142139
cmd.Flags().StringVar(&opts.SourceClusterName, flag.LiveMigrationSourceClusterName, "", usage.LiveMigrationSourceClusterName)
143140
cmd.Flags().StringVar(&opts.SourceProjectID, flag.LiveMigrationSourceProjectID, "", usage.LiveMigrationSourceProjectID)
144141
cmd.Flags().StringVarP(&opts.SourceUsername, flag.LiveMigrationSourceUsername, flag.UsernameShort, "", usage.LiveMigrationSourceUsername)
@@ -152,6 +149,8 @@ func (opts *LiveMigrationsOpts) GenerateFlags(cmd *cobra.Command) {
152149
cmd.Flags().BoolVar(&opts.Force, flag.Force, false, usage.Force)
153150
cmd.Flags().StringVarP(&opts.Output, flag.Output, flag.OutputShort, "", usage.FormatOut)
154151

152+
cmd.MarkFlagsMutuallyExclusive(flag.LiveMigrationSourceManagedAuthentication, flag.LiveMigrationSourceUsername)
153+
155154
_ = cmd.MarkFlagRequired(flag.LiveMigrationSourceClusterName)
156155
_ = cmd.MarkFlagRequired(flag.LiveMigrationSourceProjectID)
157156
_ = cmd.MarkFlagRequired(flag.ClusterName)

internal/cli/atlas/livemigrations/validation/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestCreateBuilder(t *testing.T) {
6464
CreateBuilder(),
6565
0,
6666
[]string{
67-
flag.OrgID,
67+
flag.ProjectID,
6868
flag.LiveMigrationSourceClusterName,
6969
flag.LiveMigrationSourceProjectID,
7070
flag.LiveMigrationSourceUsername,

internal/store/live_migrations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type LiveMigrationDescriber interface {
3232
LiveMigrationDescribe(string, string) (*atlas.LiveMigration, error)
3333
}
3434

35-
// LiveMigrationCreate encapsulate the logic to manage different cloud providers.
35+
// LiveMigrationCreate encapsulates the logic to manage different cloud providers.
3636
func (s *Store) LiveMigrationCreate(groupID string, liveMigration *atlas.LiveMigration) (*atlas.LiveMigration, error) {
3737
switch s.service {
3838
case config.CloudService:
@@ -43,7 +43,7 @@ func (s *Store) LiveMigrationCreate(groupID string, liveMigration *atlas.LiveMig
4343
}
4444
}
4545

46-
// LiveMigrationCreate encapsulate the logic to manage different cloud providers.
46+
// LiveMigrationDescribe encapsulates the logic to manage different cloud providers.
4747
func (s *Store) LiveMigrationDescribe(groupID, migrationID string) (*atlas.LiveMigration, error) {
4848
switch s.service {
4949
case config.CloudService:

0 commit comments

Comments
 (0)