Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Thanks, will take a look On Tuesday, March 25, 2014 11:33 PM, Collins, Sean sean_colli...@cable.comcast.com wrote: On Fri, Mar 21, 2014 at 08:35:05PM EDT, Rajdeep Dua wrote: Sean, If you can point me to the project file in github which needs to be modified , i will include these docs Thanks Rajdeep I imagine inside the openstack-manuals git repo https://github.com/openstack/openstack-manuals Possibly inside the doc/user-guide tree. Although others may have better suggestions. -- Sean M. Collins___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
On Fri, Mar 21, 2014 at 08:35:05PM EDT, Rajdeep Dua wrote: Sean, If you can point me to the project file in github which needs to be modified , i will include these docs Thanks Rajdeep I imagine inside the openstack-manuals git repo https://github.com/openstack/openstack-manuals Possibly inside the doc/user-guide tree. Although others may have better suggestions. -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Sean, If you can point me to the project file in github which needs to be modified , i will include these docs Thanks Rajdeep On Sunday, February 9, 2014 9:04 PM, Collins, Sean sean_colli...@cable.comcast.com wrote: Do you have plans to submit these back upstream? It would be a great first start, perhaps we could add these as examples underneath the JSON request/reponse in http://api.openstack.org/api-ref-networking.html Sean M. Collins From: Rajdeep Dua [dua_rajd...@yahoo.com] Sent: Saturday, February 08, 2014 11:10 PM To: OpenStack Development Mailing List (not for usage questions) Subject: Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed? Sean, We have written a few docs for writing these samples http://python-api-guide.cfapps.io/content/neutron.html You can find get the source here https://github.com/rajdeepd/openstack-samples Thanks Rajdeep On Sunday, February 9, 2014 12:57 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
I'm sure the Documentation team would love to hear from you: https://wiki.openstack.org/wiki/Documentation -Ben On 2014-02-09 23:24, Rajdeep Dua wrote: Yes, We would be interested in doing that. Please let me know which is the right group/ team for this? On Monday, February 10, 2014 10:34 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Do you have plans to submit these back upstream? It would be a great first start, perhaps we could add these as examples underneath the JSON request/reponse in http://api.openstack.org/api-ref-networking.html Sean M. Collins - FROM: Rajdeep Dua [dua_rajd...@yahoo.com] SENT: Saturday, February 08, 2014 11:10 PM TO: OpenStack Development Mailing List (not for usage questions) SUBJECT: Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed? Sean, We have written a few docs for writing these samples http://python-api-guide.cfapps.io/content/neutron.html You can find get the source here https://github.com/rajdeepd/openstack-samples Thanks Rajdeep On Sunday, February 9, 2014 12:57 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst [2] If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html [3] So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev [1] ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev [1] Links: -- [1] http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev [2] https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst [3] http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Hi Sean, Yes, please do improve docstrings for the client object! And I think you found that Lorin Hochstein recently added a Python SDK chapter to the end user guide at http://docs.openstack.org/user-guide/content/ch_sdk.html. As for the CLI project itself, the docs team has taken all the command help and subcommand help for each python-projectclient and made a CLI reference: http://docs.openstack.org/cli-reference/content/neutronclient_commands.html We haven't tackled or planned much for all the python-projectclient docs due to: priorities, resources, and a wait-and-see approach to the unified OpenStack client. Hope that helps -- happy to plan an attack with you on the openstack-docs list if you have ideas. Anne On Sat, Feb 8, 2014 at 1:20 PM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Do you have plans to submit these back upstream? It would be a great first start, perhaps we could add these as examples underneath the JSON request/reponse in http://api.openstack.org/api-ref-networking.html Sean M. Collins From: Rajdeep Dua [dua_rajd...@yahoo.com] Sent: Saturday, February 08, 2014 11:10 PM To: OpenStack Development Mailing List (not for usage questions) Subject: Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed? Sean, We have written a few docs for writing these samples http://python-api-guide.cfapps.io/content/neutron.html You can find get the source here https://github.com/rajdeepd/openstack-samples Thanks Rajdeep On Sunday, February 9, 2014 12:57 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ...tenant_id=os.environ['OS_TENANT_ID'], ...username=os.environ['OS_USERNAME'], ...password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.orgmailto:OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Yes, We would be interested in doing that. Please let me know which is the right group/ team for this? On Monday, February 10, 2014 10:34 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Do you have plans to submit these back upstream? It would be a great first start, perhaps we could add these as examples underneath the JSON request/reponse in http://api.openstack.org/api-ref-networking.html Sean M. Collins From: Rajdeep Dua [dua_rajd...@yahoo.com] Sent: Saturday, February 08, 2014 11:10 PM To: OpenStack Development Mailing List (not for usage questions) Subject: Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed? Sean, We have written a few docs for writing these samples http://python-api-guide.cfapps.io/content/neutron.html You can find get the source here https://github.com/rajdeepd/openstack-samples Thanks Rajdeep On Sunday, February 9, 2014 12:57 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
[openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
Re: [openstack-dev] [Neutron] Using Python-Neutronclient from Python - docstrings needed?
Sean, We have written a few docs for writing these samples http://python-api-guide.cfapps.io/content/neutron.html You can find get the source here https://github.com/rajdeepd/openstack-samples Thanks Rajdeep On Sunday, February 9, 2014 12:57 AM, Collins, Sean sean_colli...@cable.comcast.com wrote: Hi, I was writing a small script yesterday to parse a list of IP blocks and create security groups and rules, by using python-neutronclient. To be honest, it was very difficult - even though I have actually written extensions to Python-Neutronclient for the QoS API. For those that are trying to use the client from inside their code, they end up getting zero help as to how to actually call any of the functions, and what parameters they take. neutron = client.Client('2.0', auth_url=os.environ['OS_AUTH_URL'], ... tenant_id=os.environ['OS_TENANT_ID'], ... username=os.environ['OS_USERNAME'], ... password=os.environ['OS_PASSWORD']) help(neutron) | create_credential = function with_params | | create_firewall = function with_params | | create_firewall_policy = function with_params | | create_firewall_rule = function with_params | | create_floatingip = function with_params | | create_health_monitor = function with_params | | create_ikepolicy = function with_params | | create_ipsec_site_connection = function with_params | | create_ipsecpolicy = function with_params | | create_member = function with_params | | create_metering_label = function with_params Since there was nothing there, I decided to go check the source of python-neutronclient and see if there are any examples. https://github.com/openstack/python-neutronclient/blob/master/doc/source/index.rst If you read closely enough, you'll find out that the function takes a dictionary, that looks very similar to the request/response examples listed in the API documentation. So, I went over and checked it out. http://docs.openstack.org/api/openstack-network/2.0/content/POST_security-groups-v2.0_createSecGroup_v2.0_security-groups_security-groups-ext.html So from there, I was able to remember enough that each of these functions takes a single argument, that is a dictionary, that mimics the same structure that you see in the API documentation, so from there it was just some experimentation to get the structure right. Honestly it wasn't easy to remember all this stuff, since it had been a couple months since I had worked with python-neutronclient, and it had been from inside the library itself. This was my first experience using it on the outside and it was pretty tough - so I'm going to try and look into how we can improve the docstrings for the client object, to make it a bit easier to figure out. Thoughts? -- Sean M. Collins ___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev___ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev