Showing Volume Details using python openstacksdk, python novaclient, python cinderclient - openstack

Hello guys and I hope you're having a great day. I have a question about using Openstack API in Python.
I'm using python-novaclient for getting server details and flavor details. And I want to get the volume details too but I don't know how to do it, I've tried to collect volume details but it failed somehow and I need to ask you guys if you have any idea.
This information is what I want to get:
volume_id, attached to (w/c volume), name, status and volume_type (CEPH or LVM)
I used python-cinderclient, but I only got the volume_id.
Here's the code:
volumes = cinder.volumes.list()
Can someone help me to get the other data? Other than running Openstack command-line in the server, I just need some Python module to get these data.
Thanks in advance.

I've finally figured it out, and I'm going to answer this for anyone who is interested in Openstack SDK or other Python API for Openstack.
First, for authentication you need to use Keystone API, the documentation is all over the internet so no need to worry, you could just oversee in your Openstack for credentials needed. And for my question, I use the function get_volume from Connection class. Please see the documentation
for this. You can read other documentation as well on the internet.
So, here is the example of how to get volumes details:
vol = conn.get_volume(volume_id)
print(vol)

Related

Connect RCassandra to Datastax with secure bundle zip file

I want to connect a code in R with datastax cassandra, I have found the package RCassandra and in several examples it shows how to connect to cassandra, but I need an example which adds a "secure-bundle.zip" which is required to connect to Datastax.
So far I got this:
install.packages("RCassandra")
library("RCassandra")
RC.connect(host="c58d5d9e-015a-4255-8f6c-05784a7c59ba-us-east1.db.astra.datastax.com",port=31808) -> con
RC.login(con, username = "user", password = "pwd")
But I need to add to this snippet a line for my "secure-bundle.zip". Is there a way to do that?
Please, help.
No, it's impossible to do with that package. The primary reason is that it's very old, and uses the obsolete Thrift protocol that isn't available for DataStax Astra.
P.S. more details in the answer for similar question answered some time ago

Not able to connect to my Google Account using gconnect function of gtrendsR package

In order to start working with the newly developed package "gtrendsR" (the version 1.3.1 released by 2015-12-10) which in fact is a package to Perform and Display Google Trends Queries, you should connect to a google account. I have tried it several times to connect to my gmail account just as it is written in the instructions, but I have not been able to connect yet.
gconnect("usr#gmail.com", "psw")
It gives me this error:
Error in function (type, msg, asError = TRUE) :
Operation timed out after 0 milliseconds with 0 out of 0 bytes received
I have no idea how to fix it guys...!!??
Package Co-Maintainer here. We write about this in README.md and in the help page.
Maybe you have you two-factor authentication? Maybe you are behind some type of firewall and you need to try out in the open? It "works for me" with a dedicated account I created for Google Trends; others use the same trick.
If you file an issue ticket, or better still, read the existing discussion over there, you may get some better help. Right now your question is unanswerable due to lack of specifics or reproducible results.
As Dirk Eddelbuettel wrote, this might be because you are behind a Firewall. If so, you can either unblock the port that you are using for connecting or alternatively use a Proxy Server (I received the same error as you, until I configured a proxy).
For Information on how to configure Internet Access via Proxy in Rstudio see:
RStudio Proxy Configuration on Windows
or
https://support.rstudio.com/hc/en-us/articles/200488488-Configuring-R-to-Use-an-HTTP-or-HTTPS-Proxy
For Setting Proxies in R see:
http://stat.ethz.ch/R-manual/R-patched/library/utils/html/download.file.html

Error:1411809D:SSL routines - When trying to make https call from inside R module in AzureML

I have an experiment in AzureML which has a R module at its core. Additionally, I have some .RData files stored in Azure blob storage. The blob container is set as private (no anonymous access).
Now, I am trying to make a https call from inside the R script to the azure blob storage container in order to download some files. I am using the httr package's GET() function and properly set up the url, authentication etc...The code works in R on my local machine but the same code gives me the following error when called from inside the R module in the experiment
error:1411809D:SSL routines:SSL_CHECK_SERVERHELLO_TLSEXT:tls invalid ecpointformat list
Apparently this is an error from the underlying OpenSSL library (which got fixed a while ago). Some suggested workarounds I found here were to set sslversion = 3 and ssl_verifypeer = 1, or turn off verification ssl_verifypeer = 0. Both of these approaches returned the same error.
I am guessing that this has something to do with the internal Azure certificate / validation...? Or maybe I am missing or overseeing something?
Any help or ideas would be greatly appreciated. Thanks in advance.
Regards
After a while, an answer came back from the support team, so I am going to post the relevant part as an answer here for anyone who lands here with the same problem.
"This is a known issue. The container (a sandbox technology known as "drawbridge" running on top of Azure PaaS VM) executing the Execute R module doesn't support outbound HTTPS traffic. Please try to switch to HTTP and that should work."
As well as that a solution is on the way :
"We are actively looking at how to fix this bug. "
Here is the original link as a reference.
hth

hylafax not sending fax using iaxmodem

Hi everyone i am having an issue with Hylafax + iaxmodem + asterisk/freepbx. It is odd because i can receive faxes correctly and don't have any issues, but when i try to send a fax using hylafax it just says no answer from remote and when i am looking at asterisk by doing asterisk -r i don't even see the iaxmodem trying to send out a fax. I am lost at this point. I can successfully receive but cannot send and the iaxmodem extension is registered in asterisk. I am not sure what type of configuration files you need to see to try and help me, but if you ask for the files i can provide them. Thanks!
Found out what the solution was to my issue. The password i was using for the iax extension had an '#' symbol in it. This caused the whole issue. I removed it and faxing started to work accordingly. I stumbled upon this in this german forum that i had to translate to english.
http://www.ip-phone-forum.de/showthread.php?t=254880
Thank you everyone for all the help.

Connect R to POP Email Server (Gmail)

Is is possible to have R connect to gmail's POP server and read/download the messages in a specific folder of mine? I have been storing emails and would like to go back and start to analyze subject lines, etc.
Basically, I need a way to export a folder in my gmail account and I would like to do this pro grammatically if it all possible.
Thanks in advance!
I am not sure that this can be done via a single command. Maybe there is a package out there, which I am not aware of that can accomplish that, but as long as you do not run into that maybe the following process would be a solution ...
Consider got-your-back (http://code.google.com/p/got-your-back/wiki/GettingStarted#Step_4%3a_Performing_A_Backup) which "is a command line tool that backs up and restores your Gmail account".
You can invoke it like this (given that python is available on your machine):
python gyb.py --email foo#bar.com --search "from:pip#pop.com" --folder "mail_from_pip"
After completion you'll find all the emails matching the --search in the specified --folder, along with a sqlite database. (posted by dukedave, Dec 4 '11)
So depending on your OS you should be able to invoke the above command from within R and then access the downloaded mails in the respective folder.
GotYourBack is a good backup utility, but for downloading metadata for analysis, you might want something that doesn't first require you to fetch the entire content of all your email.
I've recently used the gmailr package to do a similar analysis.

Resources