Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to update github url in remotes using swagger #2973

Closed
worksamp opened this issue Nov 3, 2016 · 15 comments
Closed

Need to update github url in remotes using swagger #2973

worksamp opened this issue Nov 3, 2016 · 15 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@worksamp
Copy link

worksamp commented Nov 3, 2016

Hi,

I have eclipse che workspace with java project.

I need to change github url in remotes but using swagger api.

Is there any way to do it?

Thanks and regards,
worksamp

@tolusha tolusha added the kind/question Questions that haven't been identified as being feature requests or bugs. label Nov 4, 2016
@tolusha
Copy link
Contributor

tolusha commented Nov 4, 2016

Duplicates #2951

@ghost
Copy link

ghost commented Nov 4, 2016

PUT to endpoint: https://localhost:${PORT}/wsagent/ext/git/remote?projectPath=/console-java-simple

where $PORT is the port is the published port for ws-agent port (4401)

Request payload:

{"branches":[], "url":"${your-remote}", "name":"${your-remote-name}"}

@worksamp
Copy link
Author

worksamp commented Nov 7, 2016

Hi @eivantsov

in request payload:
url = github url
name = github project name

is it ryt??

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
I am using endpoint mentioned by you.

can you please help me with parameters.

project path = ?
url = ?
name = ?

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
i am getting following error:
There is no any resources matched to request path /remote

@ghost
Copy link

ghost commented Nov 8, 2016

@worksamp can you share more info on how you execute the request?

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
I am using rest client, following are the details:

Request type: PUT
Request url: http://${ip-address}:${PORT}/wsagent/ext/git/remote?projectPath=/aspnet-web-simple
Request payload:

{"branches":[], "url":"${github-url}", "name":"origin"}

@ghost
Copy link

ghost commented Nov 8, 2016

What is your port in this case?

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

wsagent
4401/tcp
ip-address:33024
http://ip-address:33024/wsagent/ext

so port no is: 33024

@ghost
Copy link

ghost commented Nov 8, 2016

@worksamp sorry for the confusion. Two mistakes from me:

remote-add instead of remote in the endpoint

And it should be POST method.

Let me know if it works for you

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
will try it and let you know

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
I replaced remote to remote-add but getting following error:
java.lang.NullPointerException

@worksamp
Copy link
Author

worksamp commented Nov 8, 2016

@eivantsov
Now i am getting following error:
"message": "Add Remote operation failed, remote name origin already exists."
so i think first i need to remove name "origin"

can you please tell me the endpoint for removing origin?

@ghost
Copy link

ghost commented Nov 22, 2016

@worksamp i got it wrong, since I thought about adding a new remote. As a workaround you may remove an existing origin remote and add a new one with a new URL.

DELETE /api/git/remote/origin?projectPath=/yourProject

@TylerJewell
Copy link

Thanks @eivantsov - closing as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

3 participants