Skip to content

Commit d1fe703

Browse files
author
Marcin Przepiorowski
committed
version 2.4.9
2 parents a40d145 + 6c0008d commit d1fe703

File tree

13 files changed

+553
-55
lines changed

13 files changed

+553
-55
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ jobs:
183183
run: |
184184
# have a static version of perl 5.30.2_1
185185
brew uninstall --ignore-dependencies perl
186-
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
186+
#brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
187+
brew install pioro/repo/perl@5.30
187188
brew install cpanminus
188189
# brew install openssl
189190
cpanm Crypt::CBC
@@ -210,7 +211,7 @@ jobs:
210211
211212
- name: Compile
212213
run: |
213-
CELL=`brew --prefix perl`
214+
CELL=`brew --prefix pioro/repo/perl@5.30`
214215
OPENLIB=`brew --prefix openssl`
215216
CDIR=`pwd`
216217
export PP=${CELL}/bin/pp

.github/workflows/develop.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ jobs:
215215
run: |
216216
# have a static version of perl 5.30.2_1
217217
brew uninstall --ignore-dependencies perl
218-
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
218+
#brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/8ff2935985d6da4f2f463ea2666545e6017c4d54/Formula/perl.rb
219+
brew install pioro/repo/perl@5.30
219220
brew install cpanminus
220221
# brew install openssl
221222
cpanm Crypt::CBC
@@ -244,7 +245,7 @@ jobs:
244245
245246
- name: Compile
246247
run: |
247-
CELL=`brew --prefix perl`
248+
CELL=`brew --prefix pioro/repo/perl@5.30`
248249
OPENLIB=`brew --prefix openssl`
249250
CDIR=`pwd`
250251
export PP=${CELL}/bin/pp

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1-
## 2.4.8
1+
## 2.4.9
2+
3+
### Added
4+
- dx_get_dsourcesize - flag -license added to display a license for ingestion model using a new API
5+
- dx_undo_db - new script to undo last rollback or refresh
26

7+
### Changed
8+
- dx_get_db_env: fix for displaying a parent time
9+
- dx_ctl_js_bookmarks: fix for snapshot parameter warning
10+
11+
## 2.4.8
312

413
### Changed
514
- [fix for #149](https://github.com/delphix/dxtoolkit/issues/149) - dx_ctl_js_bookmarks appends date to bookmark name specified

bin/dx_ctl_js_bookmarks.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
exit (1);
128128
}
129129

130-
if ((( lc $snapshots eq 'all' ) || ( lc $snapshots eq 'both' )) && (defined($usefullname))) {
130+
if (defined($snapshots) && ((( lc $snapshots eq 'all' ) || ( lc $snapshots eq 'both' )) && (defined($usefullname)))) {
131131
print "Snapshot option all or both can't run with usefullname flag \n";
132132
pod2usage(-verbose => 1, -input=>\*DATA);
133133
exit (1);

bin/dx_get_db_env.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
} else {
417417
$parenttime = $snaptime;
418418
}
419-
} else {
419+
} elsif (!defined($parenttime)) {
420420
$parenttime = 'N/A';
421421
}
422422

bin/dx_get_dsourcesize.pl

Lines changed: 80 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
'format=s' => \(my $format),
4848
'group=s' => \(my $group),
4949
'host=s' => \(my $host),
50+
'license' => \(my $license),
5051
'envname=s' => \(my $envname),
5152
'debug:i' => \(my $debug),
5253
'dever=s' => \(my $dever),
@@ -76,20 +77,32 @@
7677

7778
my $output = new Formater();
7879

79-
80-
$output->addHeader(
81-
{'Appliance', 10},
82-
{'Env name', 20},
83-
{'Group', 15},
84-
{'Database', 30},
85-
{'Size [GB]', 30},
86-
{"Status", 30},
87-
{"Enabled", 30}
88-
);
80+
if ($license) {
81+
$output->addHeader(
82+
{'Appliance', 10},
83+
{'Type', 40},
84+
{'Database', 40},
85+
{'Size [GB]', 30}
86+
);
87+
} else {
88+
$output->addHeader(
89+
{'Appliance', 10},
90+
{'Env name', 20},
91+
{'Group', 15},
92+
{'Database', 30},
93+
{'Size [GB]', 30},
94+
{"Status", 30},
95+
{"Enabled", 30}
96+
);
97+
}
8998

9099

91100
my $ret = 0;
92101

102+
print "# Delphix can automatically calculate the usage for Oracle, SQL Server and ASE databases for each Delphix Engine.\n";
103+
print "# For other databases, and before the source is connected to the Delphix Engine\n";
104+
print "# you will need to run a query on the source system for the relevant data.\n";
105+
93106
for my $engine ( sort (@{$engine_list}) ) {
94107
# main loop for all work
95108
if ($engine_obj->dlpx_connect($engine)) {
@@ -98,36 +111,62 @@
98111
next;
99112
};
100113

101-
# load objects for current engine
102-
my $databases = new Databases( $engine_obj, $debug);
103-
my $groups = new Group_obj($engine_obj, $debug);
114+
if ($license) {
115+
# use licence API
116+
if (version->parse($engine_obj->getApi()) >= version->parse(1.10.3)) {
117+
my $lic = $engine_obj->getLicenseUsage();
118+
if (defined($lic->{"databases"})) {
119+
for my $db ( @{$lic->{"databases"}}) {
120+
$output->addLine(
121+
$engine,
122+
$db->{"type"},
123+
$db->{"name"},
124+
sprintf("%10.2f", $db->{"size"}/1024/1024/1024)
125+
)
126+
}
127+
}
128+
} else {
129+
print "There is no license API. Results returned by non license API as using method described in CLI method in the Delphix Pricing Guide.\n";
130+
print "For details please contact your Delphix account manager\n";
131+
exit(1);
132+
}
133+
134+
} else {
135+
136+
# load objects for current engine
137+
my $databases = new Databases( $engine_obj, $debug);
138+
my $groups = new Group_obj($engine_obj, $debug);
139+
140+
# filter implementation
141+
142+
my $db_list = Toolkit_helpers::get_dblist_from_filter('dSource', $group, $host, $dbname, $databases, $groups, $envname, undef, undef, undef, undef, undef, $debug);
143+
if (! defined($db_list)) {
144+
print "There is no DB selected to process on $engine . Please check filter definitions. \n";
145+
$ret = $ret + 1;
146+
next;
147+
}
148+
149+
# for filtered databases on current engine - display status
150+
for my $dbitem ( @{$db_list} ) {
151+
my $dbobj = $databases->getDB($dbitem);
152+
153+
$output->addLine(
154+
$engine,
155+
$dbobj->getEnvironmentName(),
156+
$groups->getName($dbobj->getGroup()),
157+
$dbobj->getName(),
158+
$dbobj->getRuntimeSize(),
159+
$dbobj->getRuntimeStatus(),
160+
$dbobj->getEnabled()
161+
);
162+
163+
164+
}
104165

105-
# filter implementation
106-
107-
my $db_list = Toolkit_helpers::get_dblist_from_filter('dSource', $group, $host, $dbname, $databases, $groups, $envname, undef, undef, undef, undef, undef, $debug);
108-
if (! defined($db_list)) {
109-
print "There is no DB selected to process on $engine . Please check filter definitions. \n";
110-
$ret = $ret + 1;
111-
next;
112166
}
113167

114-
# for filtered databases on current engine - display status
115-
for my $dbitem ( @{$db_list} ) {
116-
my $dbobj = $databases->getDB($dbitem);
117-
118-
$output->addLine(
119-
$engine,
120-
$dbobj->getEnvironmentName(),
121-
$groups->getName($dbobj->getGroup()),
122-
$dbobj->getName(),
123-
$dbobj->getRuntimeSize(),
124-
$dbobj->getRuntimeStatus(),
125-
$dbobj->getEnabled()
126-
);
127168

128169

129-
}
130-
131170
}
132171

133172
Toolkit_helpers::print_output($output, $format, $nohead);
@@ -146,7 +185,12 @@ =head1 SYNOPSIS
146185
147186
=head1 DESCRIPTION
148187
149-
Get the information about dSource sizes for ingestion model reporting.
188+
Get the information about dSource sizes. If you want to use those data for ingestion model reporting
189+
please use -license option of the script.
190+
191+
Delphix can automatically calculate the usage for Oracle, SQL Server and ASE databases for each Delphix Engine.
192+
For other databases, and before the source is connected to the Delphix Engine,
193+
you will need to run a query on the source system for the relevant data.
150194
151195
=head1 ARGUMENTS
152196

0 commit comments

Comments
 (0)