I have tried below URL
https://bitbucket.org/ownername/projectname/src/5ec35d2481b3523123c43d5b2ddc105dd97b59fb/
I am getting Only 10 files from repo, but I have loaded 20 files , also I saw the response
it returns default pagelen 10, how to resolve this? , please help.
{"pagelen":10,"values":[{"path":"python_patterns","type":"commit_directory","
I got the solution , its have some limitations , can give URL query param
https://bitbucket.org/!api/2.0/repositories/ownername/projectname/src?pagelen=100
minmum pagelen is 10 ,maximum is 100
refer this
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/src/%7Bnode%7D/%7Bpath%7D
Related
I experience a very weird error with the GitHub API using the Octokit Ruby library. Only sometimes API requests to add new files to a repository fail with the following message:
Octokit::UnprocessableEntity: PUT https://api.github.com/repos/organization/repo/contents/config.xml: 422 - Invalid request.
"sha" wasn't supplied. // See: https://developer.github.com/v3/repos/contents/#update-a-file
from C:/Dev/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/octokit-4.8.0/lib/octokit/response/raise_error.rb:16:in `on_complete'
Here is how I am trying to upload the contents of an entire folder to GitHub:
Dir.glob(folder + '/**/*') do |path|
next if File.directory?(path)
octokit_client.create_contents 'organization/repo', path.sub("#{folder}/", ''), '🎉', File.read(path), branch: 'master'
end
If an error occurs, it does so with the first attempt to upload a file.
Edit:
I found that the error only occurs when the first file uploaded is a .xml file.
Additionally I often get ...
Octokit::RepositoryUnavailable
PUT https://api.github.com/repos/organization/repo/contents/icon/_60x60_at1x.png: 403 - Repository access blocked
... for other files but the same repository as well.
What am I doing wrong?
Make sure you don't have a file with the same name in the folder.
In this case, you are editing a file and not creating one.
I generated the html webpage in jenkins jobs and try to success/failure icons inside.
But I noticed it is linked to the url with some random number 9b17c509 in the path
https://ci.jenkins.io/static/9b17c509/images/32x32/red.png
What I preferred is the fixed url for every jenkins instance like
https://ci.jenkins.io/static/images/32x32/blue.png
Any suggestion to solve it ?
BTW: I don't want to connect to external web for those images
9b17c509 looks like a cache.
We can use /images/32x32/blue.png
see https://ci.jenkins.io/images/32x32/blue.png
For a hudson.model.Result or the result name like "SUCCESS" you can get a ball icon with hudson.model.BallColor .
In Groovy
def iconUrl = (result as BallColor).getImageOf("16x16")
In old version of the Google Drive API v2 a fileresource contained was alternateUrl which could be used to point to the file in browser. In latest version of Google Drive v3 a fileresource contains only webViewLink, but it's returned nil.
Maybe there is way to convert file identifier to url ?
Edit:
As mentioned in similar question on stack overflow, the webViewLink is returned only for public folders. As a workaround i used for now:
[NSString stringWithFormat:#"https://drive.google.com/file/d/%#/view", file.identifier]
But not sure if this urls will be valid in future, perfectly google api would return something i could use to later open file in browser.
in my app, my webViewLink have value!
You must in query action add following codefileListQuery.fields = #"*";
If anyone has managed to get locally uploading images I'd be mightily appreciative of some help.
I've downloaded the latest version of nicEdit along with the nicUpload plug in (from nicedit.com - Version 0.9 r24 released June 7th, 2012).
I've also downloaded nicUpload.php from http://svn.nicedit.com//trunk/nicUpload/php/nicUpload.php
NicUpload.php - I've set NICUPLOAD_PATH and NICUPLOAD_URI both to 'images' which is the subfolder of where nicupload.php and nicEdit.js are located.
NicEdit.js - I've added the following to line 271:-
uploadURI : 'nicUpload.php?id=123',
I've given it an ID otherwise it was failing with an invalid ID code. But the ?id=123 isn't meant to be there. I've also set the iconsPath accordingly.
Line 1370 I've switched this:-
nicURI : 'http://api.imgur.com/2/upload.json',
for this:-
nicURI : 'http://www.mydomain.com/nicedit/nicUpload.php',
But I'm still getting "Failed to upload image". I've searched and searched and searched for answers to this and I'm getting close to having spent two days tinkering with it.
With a few debugging displays I can see that it's failing on line 46 of nicUpload.php where it says:-
$file = $_FILES['nicImage'];
$image = $file['tmp_name'];
$max_upload_size = ini_max_upload_size();
if(!$file) {...
That last IF is true and that's where it exits with the error.
Appreciate anyone being able to help.
The nicUpload.php script file laying around sucks and I don't even understand how it could work.
NicEditor uses imgur as the default image upload service. The source code follows the API format described here: http://api.imgur.com/resources_anon#upload
My suggestion would be to implement the API request and response defined there.
I did not use the niceedit upload function to do what you want. I managed to add a button to the link and img dropdown menu. The button opens a file manager window where you also can upload. I managed to put then de url of the image or document into the nicedit drop down img or url window. That is how I solved the problem.
I am customizing the default build process template in TFS 2010.
i am using "DownloadFiles" build activity and in server path i have given "$/TFS/Libraries/Foo.DLL", when i run the execute definition its throwing error as "Access to the path '\ServerName\SharedFolder\BuildName\TempFolder' is denied.".
But when i give server path as "$/TFS/Libraries" its downloading all the files in Libraries folder into shared TempFolder.
But i need do download only one file. Please help..
Thanks in advance..
Now, DownloadFiles does work for a whole folder only:
ServerPath="$/proj/path" - works great, all is downloaded to LocalPath.
ServerPath="$/proj/path/name.ext" - borked.
I've de-compiled DownloadFiles to see why: First it gets a list of server items, in our case just $/proj/path/name.ext. Then, it calculates the local path like this:
localItemPath = Path.Combine(LocalPath,VersionControlPath.MakeRelative(ServerItem, ServerPath));
In this line, the activity assumes that ServerPath is a path. If it's not, then MakeRelative will not recognize it, and the local path will be LocalPath/$/proj/path/name.ext, as the OP has observed.
Also, if ServerPath is not canonical - for example, $/proj/path/../path2, the same will happen. Solution: use VersionControlPath.GetFullPath(myNonCanonicalPath).
You need to grant the user running the build service with write permissions on the shared folder.
http://msdn.microsoft.com/en-us/library/cc668757.aspx
There are two separate Build activities, DownloadFiles for a folder ServerItem and a DownloadFile for a single file ServerItem.I'd expect it should work with DownloadFile.