I am using Crucible v3.3.3.
I can easily add new repositories via Web-Interface.
Can we add new repositories via REST, command line? Is there any other way rather than web-interface?
You should review the Crucible API documentation. I believe you can query for a list of repositories, I am not sure if you can add a repository, but the API docs should answer the question.
Managing repositories REST API was extended in Crucible 3.4 and 3.5.
Have a look at this endpoint: https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html#rest-service-fecru:admin:repositories (added to Crucible 3.4).
To create a repository send a POST to rest-service-fecru/admin/repositories with the following payload (git repository example):
{
"type" : "git",
"name" : "myGitRepo",
"description" : "My GIT repo",
"storeDiff" : true,
"enabled" : true,
"git" : {
"location" : "git#bitbucket.org:atlassian/fecru-rest-examples.git",
"auth" : {
"authType" : "key-generate"
},
"commandTimeout" : "1 hour"
}
}
You can do updates / partial updates by sending a PUT to rest-service-fecru/admin/repositories/[name] with the following payload (change description and disable repository example):
{
"description" : "My old GIT repo",
"enabled" : false
}
You can list all (paged) repositories by sending a GET to rest-service-fecru/admin/repositories or get specific repository settings by sending a GET to rest-service-fecru/admin/repositories/[name]
Have a look at the documentation for all other repository REST admin options.
Related
I want to Mirror bitbuket repo in Google Source Repository so, what should I need to pass in below json request body.
{
"mirrorConfig": {
"url": "",
"deployKeyId": "",
"webhookId": ""
},
"name": "",
"pubsubConfigs": {}
}```
As mentioned in the projects.repos resource reference, the mirrorConfig field is currently set to read-only, so it is not possible to set any values for it manually.
Currently it is not possible to mirror the repository via the API, you will have to connect to the external sources through the Cloud Console, like explained in the Mirroring a Bitbucket repository documentation.
Artifact management system is JFrog Artifactory Pro X.
According to REST API of JFrog in my Jenkins job with REST API I try to get latest artifact version of a specific package, in this case the id is "MyLib".
My NuGet package is stored here: https://artifactory.myserver.net/artifactory/api/storage/projectx-nuget/MyLib/MyLib.1.0.0.nupkg?properties=nuget.version, which results in following JSON response:
{
"properties" : {
"nuget.version" : [ "1.0.0" ]
},
"uri" : "https://artifactory.myserver.net/artifactory/api/storage/projectx-nuget/MyLib/MyLib.1.0.0.nupkg"
}
Also with following URL: https://artifactory.myserver.net/artifactory/api/storage/projectx-nuget/MyLib/MyLib.1.0.0.nupkg?properties=nuget.id I get valid JSON response:
{
"properties" : {
"nuget.id" : [ "MyLib" ]
},
"uri" : "https://artifactory.myserver.net/artifactory/api/storage/projectx-nuget/MyLib/MyLib.1.0.0.nupkg"
}
I tried with following URL https://artifactory.myserver.net/artifactory/api/versions/_any/_any?nuget.id=MyLib, but got
{
"errors" : [ {
"status" : 404,
"message" : "Not Found"
} ]
}
What is the correct URL to get the latest version, based on the property "nuget.id"?
According to the doc artifactory/api/versions : Search for artifacts with the latest value in the "version" property. Only artifacts with a "version" property expressly defined will be returned.
In your case you do not have the "version" property set (I guess) but only "nuget.version" which is extracted metadata from the nuget packages during indexation.
Just set a "version" property on the package and the REST call will work.
You can automate this by using a user plugin in artifactory that will set the "version" property after the package has been written.
Another solution without the need of a user plugin would be to use the native nuget api for example with nuget v3 api :
https://artifactory.myserver.net/artifactory/api/nuget/v3/projectx-nuget/query?q= MyLib&prerelease=false
Will give you a json response with latest version (and also a list of other versions as mentionned in doc https://learn.microsoft.com/fr-fr/nuget/api/search-query-service-resource : "The metadata contained in the search result object is taken from the latest package version. Each item in the versions array is a JSON object " )
We have Bower hosted in a Nexus 3 repository. Our .bowerrc file looks like:
{
"directory": "bower_components",
"registry": {
"search": [
"https://<host>/nexus/repository/bower/"
]
},
"resolvers": [ "bower-nexus3-resolver" ]
}
So far it has had anonymous access so this worked fine. However, Nexus has now had authentication enabled so we need some way of authenticating.
I've read some documentation and it suggests we need to add
{
"nexus" : {
"username" : "myusername",
"password" : "mypassword"
}
}
But this uses plain text credentials. Is there a way to use authentication without plain text credentials?
Professional (licensed) customers can use user tokens as documented here.
To OSS users, I know that might sound a bit like NXRM doesn't care, but what is shown there comes from Bower not from NXRM, so to have that guarded, is really (in this example) a Bower change.
Can anyone enlighten me on the Graph API endpoint to create a team using a team template. The create team endpoint does exist but Im looking for the endpoint that allows me to create a team from an existing team (aka Team template )
Ok I figured it out. Its a clone operation
Actually, creating a team from a template and cloning a team from an existing team are two different things.
Teams Templates are currently only available in the beta endpoint and not supported in production. You can use the ones listed here:
https://learn.microsoft.com/en-us/MicrosoftTeams/get-started-with-teams-templates
On the https://graph.microsoft.com/beta/teams endpoint, you can create a Team from a template by providing the chosen template in the request body:
$body = #{
"template#odata.bind" = "$targetTemplate"
"displayName" = "Test Team DisplayName"
"description" = "Description"
}
$targetTemplate being one of the values from the documentation above, for example: https://graph.microsoft.com/beta/teamsTemplates('educationStaff').
Cloning a team is done using the supported in production v1.0 endpoint:
https://learn.microsoft.com/en-us/graph/api/team-clone?view=graph-rest-1.0 where you have to specify from which team and which parts you want to clone:
$body = #{
"displayName": "My Test Team",
"description": "New Description",
"mailNickname": "TestTeam2",
"partsToClone": "apps,tabs,settings,channels,members",
"visibility": "private"
}
I'm trying to get test results from a Jenkins job and was wondering if it was possible to get the json results by making a GET request (e.g. to a certain job: JENKINS_URL/job/JOB_NAME/build/api/json) while not logged into the Jenkins server.
I am having trouble understanding how you can send all the how do you pass the authentication information in the API call (e.g. API token / password, username).
I know the Jenkins CLI is an option, but I would prefer not to use it if possible.
To be clear, when logged in on my computer, calls to JENKINS_URL/job/JOB_NAME/build/api/json yield the build results, but when I log out, the link takes me to the log in page.
You have to configure your credentials and give read access for anonymous or pass your user/password in your request:
curl --user username:password jenkins_url/job/job_name/build_number/api/json
The same but using api_token:
curl --user username:api_token jenkins_url/job/job_name/build_number/api/json
If you pass also?pretty=true parameter, you should see something like this:
{
"actions" : [
{
"parameters" : [
...
}
],
...
"building" : false,
"description" : null,
"displayName" : "#36",
"duration" : 1936,
"estimatedDuration" : 2020,
"number" : 36,
"queueId" : 224,
}