forked from titan-data/titan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
192 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3.1 | ||
0.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
[ | ||
{ | ||
"name":"java.net.SocketTimeoutException", | ||
"allDeclaredFields":true, | ||
"allPublicMethods":true, | ||
"allDeclaredConstructors":true, | ||
"allPublicConstructors":true, | ||
"allDeclaredClasses":true, | ||
"allPublicClasses":true | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ Subcommands | |
cmd/checkout | ||
cmd/clone | ||
cmd/commit | ||
cmd/delete | ||
cmd/cp | ||
cmd/install | ||
cmd/log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. _cli_cmd_delete: | ||
|
||
titan delete | ||
============== | ||
|
||
Delete a previous commit from the current container. The commit must be | ||
present in `titan log`. For more general information on managing local | ||
commits, see the :ref:`local_commit` section. | ||
|
||
.. warning:: | ||
|
||
This will stop and start the associated docker container if it is already | ||
running. This will interrupt any active connections, and may require | ||
client-specific actions to reconnect. | ||
|
||
Syntax | ||
------ | ||
|
||
:: | ||
|
||
titan delete -c <id> <repository> | ||
|
||
Arguments | ||
--------- | ||
|
||
repository | ||
*Required*. The name of the target repository. | ||
|
||
Options | ||
------- | ||
|
||
-c, --commit id *Required*. Specify the commit ID to delete. Must be a known | ||
commit in `titan log` for the given repository. | ||
|
||
Example | ||
------- | ||
|
||
:: | ||
|
||
$ titan delete -c 7715327e-9535-4263-870f-f5c92c18cb23 myrepo | ||
7715327e-9535-4263-870f-f5c92c18cb23 deleted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2019 by Delphix. All rights reserved. | ||
*/ | ||
|
||
package io.titandata.titan.commands | ||
|
||
import io.titandata.titan.Dependencies | ||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.core.requireObject | ||
import com.github.ajalt.clikt.parameters.arguments.argument | ||
import com.github.ajalt.clikt.parameters.options.option | ||
import org.kodein.di.Kodein | ||
import org.kodein.di.generic.bind | ||
import org.kodein.di.generic.inSet | ||
import org.kodein.di.generic.provider | ||
|
||
class Delete : CliktCommand( | ||
help = "Delete objects from titan" | ||
) { | ||
private val dependencies: Dependencies by requireObject() | ||
private val repository by argument() | ||
private val commit by option("-c", "--commit", help="Commit GUID to delete") | ||
override fun run() { | ||
val provider = dependencies.provider | ||
provider.delete(repository, commit) | ||
} | ||
} | ||
|
||
val deleteModule = Kodein.Module("delete") { | ||
bind<CliktCommand>().inSet() with provider { | ||
Delete() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/kotlin/io/titandata/titan/providers/local/Delete.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright (c) 2019 by Delphix. All rights reserved. | ||
*/ | ||
|
||
package io.titandata.titan.providers.local | ||
|
||
import io.titandata.client.apis.CommitsApi | ||
|
||
class Delete ( | ||
private val commitsApi: CommitsApi = CommitsApi() | ||
) { | ||
fun deleteCommit(repository: String, commit: String) { | ||
commitsApi.deleteCommit(repository, commit) | ||
println("$commit deleted") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.