curl -X<REST Verb> <Node>:<Port>/<Index>/<Type>/<ID>
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
This file contains hidden or 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
| package main | |
| import ( | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "os/user" | |
| "strconv" | |
| ) |
This file contains hidden or 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
| import groovy.json.JsonSlurper | |
| import org.sonatype.nexus.repository.storage.Asset | |
| import org.sonatype.nexus.repository.storage.StorageFacet | |
| def DOCKER_REPOSITORY_NAME = 'docker-hosted' | |
| def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME) | |
| def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName) | |
| def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get() | |
| try { |
This file contains hidden or 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
| enum PatchLevel { | |
| MAJOR, MINOR, PATCH | |
| } | |
| class SemVer implements Serializable { | |
| private int major, minor, patch | |
| SemVer(String version) { | |
| def versionParts = version.tokenize('.') |
This file contains hidden or 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
| import org.sonatype.nexus.common.entity.* | |
| import org.sonatype.nexus.security.* | |
| import org.sonatype.nexus.security.authz.* | |
| import org.sonatype.nexus.selector.* | |
| import com.google.common.collect.ImmutableMap | |
| // use container.lookup to fetch internal APIs we need to use | |
| def selectorManager = container.lookup(SelectorManager.class.name) | |
| def securitySystem = container.lookup(SecuritySystem.class.name) |
This file contains hidden or 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
| import org.sonatype.nexus.repository.storage.StorageFacet; | |
| import org.sonatype.nexus.repository.storage.Query; | |
| import org.joda.time.DateTime; | |
| import org.joda.time.format.DateTimeFormat; | |
| def fmt = DateTimeFormat.forPattern('yyyy-MM-dd HH:mm:ss'); | |
| // Get a repository | |
| def repo = repository.repositoryManager.get('nuget-releases'); | |
| // Get a database transaction | |
| def tx = repo.facet(StorageFacet).txSupplier().get(); |
This file contains hidden or 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
| import { ChangeDetectorRef } from '@angular/core'; | |
| import { ComponentFixture } from '@angular/core/testing'; | |
| export async function runOnPushChangeDetection<T>(cf: ComponentFixture<T>) { | |
| const cd = cf.debugElement.injector.get<ChangeDetectorRef>( | |
| // tslint:disable-next-line:no-any | |
| ChangeDetectorRef as any | |
| ); | |
| cd.detectChanges(); | |
| await cf.whenStable(); |
OlderNewer