couple questions about dataValueSets API

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

  2. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

I am running on 2.24, if it makes a difference.

Thanks,

Vlad

Hi Vlad,

···

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

···

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!

···

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

···

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

You are right, Morten. It works with --data-binary instead of -d.
Thanks!

···

On 8 December 2016 at 03:28, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Okay thanks Victor, I can see it now, you are right, compressed files are supported :wink:

Lars

···

On Fri, Dec 9, 2016 at 9:25 AM, Victor Garcia vgarciabnz@gmail.com wrote:

You are right, Morten. It works with --data-binary instead of -d.
Thanks!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 8 December 2016 at 03:28, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi Morten,

It does not seem to work with adx message though. Is that right?

Thanks,

Vlad

···

On Fri, Dec 9, 2016 at 9:25 AM, Victor Garcia vgarciabnz@gmail.com wrote:

You are right, Morten. It works with --data-binary instead of -d.
Thanks!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On 8 December 2016 at 03:28, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Hi Vlad

No it doesn’t currently work with adx files.

···

On 15 December 2016 at 18:52, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Hi Morten,

It does not seem to work with adx message though. Is that right?

Thanks,

Vlad

On Fri, Dec 9, 2016 at 4:05 AM Lars Helge Øverland lars@dhis2.org wrote:

Okay thanks Victor, I can see it now, you are right, compressed files are supported :wink:

Lars


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Fri, Dec 9, 2016 at 9:25 AM, Victor Garcia vgarciabnz@gmail.com wrote:

You are right, Morten. It works with --data-binary instead of -d.
Thanks!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On 8 December 2016 at 03:28, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Thanks for confirming.

···

On 15 December 2016 at 18:52, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Hi Morten,

It does not seem to work with adx message though. Is that right?

Thanks,

Vlad

On Fri, Dec 9, 2016 at 4:05 AM Lars Helge Øverland lars@dhis2.org wrote:

Okay thanks Victor, I can see it now, you are right, compressed files are supported :wink:

Lars


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Fri, Dec 9, 2016 at 9:25 AM, Victor Garcia vgarciabnz@gmail.com wrote:

You are right, Morten. It works with --data-binary instead of -d.
Thanks!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On 8 December 2016 at 03:28, Morten Olav Hansen morten@dhis2.org wrote:

Hi

Do you get any errors? it should be possible, it will take the first file in the zip file and use that (so it would be best to always only have one file)

Could you also try with --data-binary instead of -d ?

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Dec 8, 2016 at 1:18 AM, Victor Garcia vgarciabnz@gmail.com wrote:

Hi,

about importing datavalues in zip format, I think it is possible since it was fixed in 2.21 (https://lists.launchpad.net/dhis2-devs/msg46144.html). I am able to import a zip file using Postman and using our own webapp both in 2.21 and 2.25, so it seems to be working fine.

On the other hand, I am not able to import a zip file using curl with the command:

curl.exe -d @test.zip -H “Content-Type: application/json” -X POST “http://localhost/api/dataValueSets” -u user:password -v

but I guess I am missing something…

Regards!


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On 6 December 2016 at 13:39, Vladimer Shioshvili vshioshvili@gmail.com wrote:

Thanks Lars. It was a human error issue, input i was testing with has duplicates and i was looking at ignored, and not noticing the delete count. Thanks!

What would be the level of effort and ability to back port to 2.24 of supporting compressed files in API?

On Tue, Dec 6, 2016 at 6:42 AM Lars Helge Øverland lars@dhis2.org wrote:

Hi Vlad,


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

On Tue, Dec 6, 2016 at 12:04 PM, Vladimer Shioshvili vshioshvili@gmail.com wrote:

  1. just to confirm, web api only accets uncompressed file, right? and it’s the import/export app that is capable of handling zip file?

Yes that is correct per now. We could consider adding that support to the API as well.

  1. does DELETE import strategy work for dataValueSets? I have not been able to get it to work.

It seems to be working - try running the two curl commands below, which indicates that data gets added and then removed.

curl “https://play.dhis2.org/demo/api/24/dataValueSets” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

curl “https://play.dhis2.org/demo/api/24/dataValueSets?importStrategy=DELETE” -i -X POST -H “Content-Type: application/json” --data ‘{“dataSet”:“pBOMPrpg1QX”,“period”:“201401”,“orgUnit”:“DiszpKrYNg8”,“dataValues”:[{“dataElement”:“f7n9E0hX8qk”,“value”:“1”},{“dataElement”:“Ix2HsbDMLea”,“value”:“2”}]}’ -u admin:district -v

regards,

Lars

I am running on 2.24, if it makes a difference.

Thanks,

Vlad


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp


Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org