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

Add ability to bind requests to a specific node in a multi-node TeamCity setup #124

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

Andronnix
Copy link
Contributor

Usage example:

import org.jetbrains.teamcity.rest.BuildId
import org.jetbrains.teamcity.rest.TeamCityInstanceBuilder;

val tc = TeamCityInstanceBuilder("https://<multi-node-server>")
    .bindToNode("secondary-node")
    .withTokenAuth("<token>")
    .build()

@Andronnix
Copy link
Contributor Author

Updated approach

import org.jetbrains.teamcity.rest.BuildId
import org.jetbrains.teamcity.rest.NodeSelector
import org.jetbrains.teamcity.rest.TeamCityInstanceBuilder;


fun main() {
    val tc = TeamCityInstanceBuilder("<server_url>")
        .selectNode(NodeSelector.ServerControlled) // .selectNode(NodeSelector.PinToNode("node-id")
        .withTokenAuth("<token>")
        .buildBlockingInstance()

    val b = tc.build(BuildId("12345"))

    println(b)
}

@Andronnix Andronnix merged commit b85e19b into master Aug 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants