ONTAP Discussions

snapshot-get-schedule returns incorrect 'which-hours' list when none is set

chris_algar
1,983 Views

 

When calling :

 

my $snap_sched = NetAppApi::NaElement->new("snapshot-get-schedule");
$snap_sched->child_add_string("volume", $name);

my $output = $serv->invoke_elem( $snap_sched );

 

the returned value of $output->child_get_string("which-hours") is  '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23' (rather than undef of ' ') for a snapshot schedule that does not have any hours specified.

 

For example for this schedule:

 

lnn30oznp1> snap sched <volumename>
Volume <volumename>: 4 0 0

 

returns : 

Debug : Response $VAR1 = bless( {
'content' => '',
'name' => 'results',
'children' => [
bless( {
'content' => '4',
'name' => 'weeks',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0',
'name' => 'days',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0',
'name' => 'hours',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0',
'name' => 'minutes',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23',
'name' => 'which-hours',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => ' ',
'name' => 'which-minutes',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' )
],
'attrvals' => [
'passed'
],
'attrkeys' => [
'status'
]
}, 'NetAppApi::NaElement' );

 

 

Compare to this schedule:

 

<filername> snap sched <volumename> 4 0 2@6,1

 

which corerctly returns:

Debug : Response $VAR1 = bless( {
'content' => '',
'name' => 'results',
'children' => [
bless( {
'content' => '4',
'name' => 'weeks',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0',
'name' => 'days',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '2',
'name' => 'hours',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '0',
'name' => 'minutes',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => '6,12',
'name' => 'which-hours',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' ),
bless( {
'content' => ' ',
'name' => 'which-minutes',
'children' => [],
'attrvals' => [],
'attrkeys' => []
}, 'NetAppApi::NaElement' )
],
'attrvals' => [
'passed'
],
'attrkeys' => [
'status'
]
}, 'NetAppApi::NaElement' );

 

 

 

If there are no hourly values set in the schedule the I would expect which-hours to be undef. Is this a known bug?

1 REPLY 1

ekashpureff
1,968 Views

 

Chris -

 

The output is correct. A null string in the hours field of a snap sched implies to take a snapshot every hour of the day.

 


I hope this response has been helpful to you.

At your service,

Eugene E. Kashpureff, Sr.
Independent NetApp Consultant http://www.linkedin.com/in/eugenekashpureff
Senior NetApp Instructor, IT Learning Solutions http://sg.itls.asia/netapp
(P.S. I appreciate 'kudos' on any helpful posts.)

 

Public