File tree Expand file tree Collapse file tree 8 files changed +9
-9
lines changed
src/main/kotlin/com/kotlin/xray Expand file tree Collapse file tree 8 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
33plugins {
4- kotlin(" jvm" ) version " 1.9 .0"
4+ kotlin(" jvm" ) version " 2.1 .0"
55 application
66}
77
@@ -27,7 +27,7 @@ repositories {
2727}
2828apply (plugin = " org.jlleitschuh.gradle.ktlint" )
2929dependencies {
30- implementation(platform(" aws.sdk.kotlin:bom:1.3.112 " ))
30+ implementation(platform(" aws.sdk.kotlin:bom:1.4.119 " ))
3131 implementation(" aws.sdk.kotlin:xray" )
3232 implementation(" aws.sdk.kotlin:secretsmanager" )
3333 implementation(" aws.smithy.kotlin:http-client-engine-okhttp" )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ suspend fun createNewGroup(groupNameVal: String?) {
4444 groupName = groupNameVal
4545 }
4646
47- XRayClient { region = " us-east-1" }.use { xRayClient ->
47+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
4848 val groupResponse = xRayClient.createGroup(groupRequest)
4949 println (" The Group ARN is " + (groupResponse.group?.groupArn))
5050 }
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ suspend fun createRule(ruleNameVal: String?) {
5858 samplingRule = rule
5959 }
6060
61- XRayClient { region = " us-east-1" }.use { xRayClient ->
61+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
6262 val ruleResponse: CreateSamplingRuleResponse = xRayClient.createSamplingRule(ruleRequest)
6363 println (" The ARN of the new rule is ${ruleResponse.samplingRuleRecord?.samplingRule?.ruleArn} " )
6464 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ suspend fun deleteSpecificGroup(groupNameVal: String) {
4343 groupName = groupNameVal
4444 }
4545
46- XRayClient { region = " us-east-1" }.use { xRayClient ->
46+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
4747 xRayClient.deleteGroup(groupRequest)
4848 println (" $groupNameVal was deleted!" )
4949 }
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ suspend fun deleteRule(ruleNameVal: String?) {
4343 ruleName = ruleNameVal
4444 }
4545
46- XRayClient { region = " us-east-1" }.use { xRayClient ->
46+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
4747 xRayClient.deleteSamplingRule(ruleRequest)
4848 println (" $ruleNameVal was deleted" )
4949 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ suspend fun main() {
2121
2222// snippet-start:[xray.kotlin_get_groups.main]
2323suspend fun getAllGroups () {
24- XRayClient { region = " us-east-1" }.use { xRayClient ->
24+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
2525 val response = xRayClient.getGroups(GetGroupsRequest {})
2626 response.groups?.forEach { group ->
2727 println (" The AWS X-Ray group name is ${group.groupName} " )
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ suspend fun main() {
2121
2222// snippet-start:[xray.kotlin_get_rules.main]
2323suspend fun getRules () {
24- XRayClient { region = " us-east-1" }.use { xRayClient ->
24+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
2525 val response = xRayClient.getSamplingRules(GetSamplingRulesRequest {})
2626 response.samplingRuleRecords?.forEach { record ->
2727 println (" The rule name is ${record.samplingRule?.ruleName} " )
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ suspend fun getGraph(groupNameVal: String?) {
4545 this .startTime = time.now()
4646 endTime = time.now()
4747 }
48- XRayClient { region = " us-east-1" }.use { xRayClient ->
48+ XRayClient .fromEnvironment { region = " us-east-1" }.use { xRayClient ->
4949 val response = xRayClient.getServiceGraph(getServiceGraphRequest)
5050 response.services?.forEach { service ->
5151 println (" The name of the service is ${service.name} " )
You can’t perform that action at this time.
0 commit comments