I'm unable to create an IBM Cloud action. I have no idea why.
My IBM data that I get in console is as follows:
API endpoint: https://api.eu-gb.bluemix.net
Region: eu-gb
User: my-name#my-company.com
Account: My Name's Account (12fcae9b137946b8bbfe481448612345)
Resource group: Default
CF API endpoint: https://api.eu-gb.bluemix.net (API version: 2.92.0)
Org: my-org
Space: dev
That look fine to me.
When I execute the test action as the docs says here as follows:
ibmcloud wsk action invoke whisk.system/utils/echo -p message hello --result
I get correct result:
{
"message": "hello"
}
But I'm not able to create my own actions.
The folder looks as follows:
Thus there is .zip file that I created with
zip -r as24-crawler.zip virtualenv commmon.py __main__.py
And now when I try to create an action as the docs says here with
ibmcloud wsk action create my-action-name --kind python:3 as24-crawler.zip
I got an error as follows:
error: Unable to create action 'my-action-name': The connection
failed, or timed out. (HTTP status code 413)
Any idea what am I doing wrong?
UPDATE
Is the file size to big? I'm not sure. The error message is not clear but the meaning could be that the file to big is.
They say in the docs that the limit is 48MB. But my created .zip file is 43.6MB. Thus I assume that that not the problem is.
I am one of the guys responsible for IBM Cloud Functions.
We have been looking into this issue and must admit that this is a bug (causing zip files to be rejected even if the are smaller than the documented 48MB limit); we are already working on a fix to get this resolved asap.
In the meantime you may want to have a look at the workaround (which allows you to "outsource" some of your dependencies etc.) described here:
http://jamesthom.as/blog/2017/08/04/large-applications-on-openwhisk/
I hope this helps - feel free to contact me (e.g. via Linkedin/Twitter, see my profile information) directly in case you have further questions or in case you want to discuss anything else.
Thanks for having found and reported this issue and sorry for inconvenience.
it seems according to the return code '413' the provided data used to create the action is too large. To get an indication about the system limits you might want to check IBM Cloud Functions documentation here: https://console.bluemix.net/docs/openwhisk/openwhisk_reference.html#openwhisk_syslimits.
Related
Following the guide in Google's documentation I am attempting to update fields for a device. This returns Permission denied. Did you provide the correct client id? which I have verified is absolutely the correct id.
If I log the error.msg I get HTTP Error 400: Bad Request, and looking at the contents I see that
<p>The requested URL <code>/v1/devices/abc123/deviceUsers/abc-123-ddd/clientState/companyid-string?updateMask=healthScore</code> was not found on this server. <ins>That\xe2\x80\x99s all we know.
I took the resource name from using the list method, as suggested by the docs, so I am fairly certain this is the correct name. I don't believe its a scope permission error as the scope listed works to list/get devices.
I have tried updating different fields, different devices, and switching it up as much as I could think to do and still run into a 400. If anyone has updated any of the clientState fields and can provide guidance I would greatly appreciate it.
I want to get all the latest changes possible like commits, pull requests, issues, their comments, discussions, etc of a Github repository.
For that, I want to create some decorators such as #repo.on_new_commit() or #repo.on_new_issue_comment(), where repo is a Github Repo object with at least the repository name. The code will always be running and I want #repo.on_new_commit() to return the new commit immediately when the commit occurs. Or a single decorator #repo.on_update() which returns all new changes.
How can I do that? Any suggestion is accepted.
GIT! and the OS module
like
import os
#get activy
activity=os.system('git log github.com/githubuser/repo')
so our 'activity' variable is our
activity and the one on top is the latest!
I finally got the exact answer. This can only be done through GitHub Webhooks and a server like Django or Flask (for Python)
Everytime a new event happens, github sends a POST request to the payload url defined by the user in the webhooks. Through that, you can easily extract the json data from the body along with the github event from the request headers and do any external work you want!
Thanks for the suggestions.
I am trying to convert my BASH script to Python and am having difficulties in finding the equivalent code for openstack server show or openstack server list --long. I would like to know what host is my server currently located and use this information for a check before migrating it to another host.
Looking through the latest novaclient documentation and its servers module, I have found two potential commands that I was hoping would accomplish the task, but does not do so:
list(detailed=True)
Gets a list servers
detailed=True should return detailed server info (optional).
This returns a regular list of servers with their names.
get(server)
Get a server
This returns only the name of the server.
I have been researching for the past two days, and I could not find the same / similar problem here in stack overflow so I have decided to ask and I am hoping that someone can help me with this.
Either list or get should be fine here.
As an example get would be used like this.
instance = nova_client.servers.get('my-server')
print(instance.name)
print(instance.addresses)
print(instance.status)
Or using list.
for instance in nova_client.servers.list():
print(instance.name)
print(instance.addresses)
print(instance.status)
If you want an easy way of understanding the type of data you can get, you can simply use the Python inbuilt dir.
instance = nova_client.servers.get('my-server')
print(dir(instance))
'my-server' needs to be the id as in instance.id, the name of the server is not valid.
I cant yet comment, so i wrote an answer.
I'm trying to get the User Owner of any particular AWS resource, be it instance, volume, security group etc..
I searched but could not find any helpful information apart from this
Link,
This is what I found closer [The answer suggests we can get the user who created an instance] to what I'm looking for but still couldn't use it as the code mentioned is not complete.
If I consider the code from above mentioned post's answer, the following line
ct_conn = sess.client(service_name='cloudtrail',region_name='us-east-1')
is mentioned without defining the "sess".
AWS will not records any AWS user activities info unless you setup Cloudtrail and send those info to S3 repository.
I am trying to get up to speed with CouchDB. As a relatively new user on Python, I am trying to set up a view-server so that I can pass on python functions to couchdb.design.ViewDefinitions function. As I understand, ViewDefinitions take javascript code to execute map/reduce function.
Here is what I struggle to understand - I am well aware that this might be a basic question. According to wiki (http://wiki.apache.org/couchdb/View_server):
To register query servers with CouchDB, add a line for each server to local.ini. The basic syntax is:
'[query_servers] python=/usr/bin/couchpy'
How do I access local.ini file? I am an 10.6.8 Mac user. Thanks!
Update: Thank you Kxepal. It seems I was able to create the design/view on Futon in Python. Alternatively, I figured that python viewserver can be created as follows:
curl -X PUT http://[localhost]/_config/query_servers/python '"/path/to/couchpy"'
However, I still cannot execute the python script. Running the view on Couch results in following:
'Error: An error occurred accessing the view no response'
I would appreciate if somebody can point in the right direction. Thanks!
I encountered the same "Error: An error occurred accessing the view no response" problem, and it turned out to be a bug in my python code. Specifically, in the javascript implementation I had something like:
function (doc) {
emit(doc.somefield, doc);
}
I had converted this to:
def map(doc):
yield doc.somefield, doc
However, this gave me the "no response" error you describe.
Changing it to the following fixed the problem.
def map(doc):
yield doc['somefield'], doc
I don't know there OSX keeps CouchDB config files, but you always may setup Python query server through Futon. On sidebar click Configuration, than "Add section" at the bottom of the page and fill the fields with same data as you planned to write into local.ini. As bonus, you don't need restart CouchDB - configuration changes through HTTP API are applied instantly, but be sure that you'd specified correct values.