Can SQL Views be created through API?

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

···

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

···

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

Thanks, will check this out and get back.

···

On 30 November 2016 at 10:43, Morten Olav Hansen morten@dhis2.org wrote:

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

Dear Morten

The documentation talks about executing an existing sqlView but I want to create a new one using the API. Not sure if that is possible.

What we are attempting is that a dhis2 app when loaded first checks if the sqlView exists(By name let’s say). And if not then it creates a new one through the API. Once created it can be used as usual…

Could you please confirm.

Thanks

harsh

···

On 30 November 2016 at 15:54, Harsh Atal harsh.atal@gmail.com wrote:

Thanks, will check this out and get back.

On 30 November 2016 at 10:43, Morten Olav Hansen morten@dhis2.org wrote:

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

List of existing ones:
https://play.dhis2.org/demo/api/sqlViews.json

POSTing a new one:

https://play.dhis2.org/demo/api/sqlViews/QAlOivHBY3a.json

···

On Thu, Dec 1, 2016 at 6:23 PM, Harsh Atal harsh.atal@gmail.com wrote:

Dear Morten

The documentation talks about executing an existing sqlView but I want to create a new one using the API. Not sure if that is possible.

What we are attempting is that a dhis2 app when loaded first checks if the sqlView exists(By name let’s say). And if not then it creates a new one through the API. Once created it can be used as usual…

Could you please confirm.

Thanks

harsh


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

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

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

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

On 30 November 2016 at 15:54, Harsh Atal harsh.atal@gmail.com wrote:

Thanks, will check this out and get back.

On 30 November 2016 at 10:43, Morten Olav Hansen morten@dhis2.org wrote:

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

Knut Staring

Dept. of Informatics, University of Oslo

Norway: +4791880522

Skype: knutstar

http://dhis2.org

Hi Harsh,

You can import the sql view with the metadata importer, just like any other metadata object.

Regards,

Jason

···

On Thu, Dec 1, 2016 at 12:23 PM, Harsh Atal harsh.atal@gmail.com wrote:

Dear Morten

The documentation talks about executing an existing sqlView but I want to create a new one using the API. Not sure if that is possible.

What we are attempting is that a dhis2 app when loaded first checks if the sqlView exists(By name let’s say). And if not then it creates a new one through the API. Once created it can be used as usual…

Could you please confirm.

Thanks

harsh


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

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

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

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

On 30 November 2016 at 15:54, Harsh Atal harsh.atal@gmail.com wrote:

Thanks, will check this out and get back.

On 30 November 2016 at 10:43, Morten Olav Hansen morten@dhis2.org wrote:

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

Got it!

Thanks

harsh

···

On 1 December 2016 at 16:56, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Harsh,

You can import the sql view with the metadata importer, just like any other metadata object.

Regards,

Jason

On Thu, Dec 1, 2016 at 12:23 PM, Harsh Atal harsh.atal@gmail.com wrote:

Dear Morten

The documentation talks about executing an existing sqlView but I want to create a new one using the API. Not sure if that is possible.

What we are attempting is that a dhis2 app when loaded first checks if the sqlView exists(By name let’s say). And if not then it creates a new one through the API. Once created it can be used as usual…

Could you please confirm.

Thanks

harsh


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

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

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

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

Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049

On 30 November 2016 at 15:54, Harsh Atal harsh.atal@gmail.com wrote:

Thanks, will check this out and get back.

On 30 November 2016 at 10:43, Morten Olav Hansen morten@dhis2.org wrote:

You can read more about it here

https://ci.dhis2.org/docs/master/en/developer/html/webapi_sql_views.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:12 PM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Harsh

We have a /api/sqlViews endpoint you might want to look at? that should enable you to create sql views using the web-api.

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Wed, Nov 30, 2016 at 12:09 PM, Harsh Atal harsh.atal@gmail.com wrote:

Hi

We have a reporting app which uses SQL View with variables. The app has to be used on multiple instances and we don’t want to create the sql views manually on each instance. Intention is to make the app make its own sql view on start up.

Is that possible?

Regards

harsh


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

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

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

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