Forum Discussion
Update an internal Data-group
hi, i would like update a group. What's the better way : iControl or iControlREST ? Someone have an example to read and modify an internal Data-group with perl ?
thank you.
6 Replies
- david78
Nimbostratus
I chose iControlREST, and write a PERL script. I can read a data-group internal, but i can't add a new value.
I have an error with 'Records'. someone can help me ?
my %payload; $payload{'name'} = $datagroup; $payload{'type'} = 'string'; $payload{'records'} = { 'name' => 'test-rest1', 'data' => 'test-data-rest1' }; my $json = encode_json \%payload; $bigip->PUT('ltm/data-group/internal/', $json); - david78
Nimbostratus
hello,
now, i can update the Datagroup, but i can't add some data.
sub modif_datagroup { my ($bigip, $datagroup) = @_; my $json = '{"name":"test1","records":"test1"}'; $bigip->PATCH('ltm/data-group/internal/~Common~'. $datagroup, $json); } When i list the all properties, i have this : (tmos) list ltm data-group internal my-datagroup all-properties ltm data-group internal my-datagroup { app-service none description none partition Common records { test1 { data none } } type string }Someone can explain me how i can add a data in datagroup ?
- david78
Nimbostratus
i found ! This code works for add some data in Datagroup :
Modif datagroup sub modif_datagroup { my ($bigip, $datagroup) = @_; my $json = '{"records":[{"name":'.$name1.',"data":'.$data1.'},{"name":'.$name2.',"data":'.$data2.'},{"name":'.$name3.',"data":'.$data3.'}]}'; $bigip->PATCH('ltm/data-group/internal/~Common~'. $datagroup, $json); } - JRahm
Admin
hi david, another customer is looking for help on this with perl, would you mind uploading your completed data-group perl script to the codeshare, or email it to me at rahm -at- f5 -dot- com and I'll take care of it? Thanks!
- david78
Nimbostratus
Hi, there is really no way to add or edit a single entry in a Datagroup?
- david78
Nimbostratus
Thank you Jason. I'll watch it.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com