object Nelson
- Source
- Nelson.scala
- Alphabetic
- By Inheritance
- Nelson
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- final case class CommitUnit(unitName: UnitName, version: Version, target: NamespaceName) extends Product with Serializable
- final case class LoadbalancerSummary(namespace: Namespace, loadbalancer: LoadbalancerDeployment, outboundDependencies: Vector[RoutingNode]) extends Product with Serializable
- type NelsonFK[F[_[_], _], U] = Kleisli[[β$0$]F[IO, β$0$], NelsonConfig, U]
-
type
NelsonK[U] = Kleisli[IO, NelsonConfig, U]
NelsonK[U] provides us with a context that accepts a configuration and gives us a cats IO[U] NelsonFK[F[_[_], _], U] provides a context that accepts a configuration and gives us an F[IO, U] this gives us the flexibility of defining a monadic function that yields FS2 streams of IO and U as emitted values (e.g.
NelsonK[U] provides us with a context that accepts a configuration and gives us a cats IO[U] NelsonFK[F[_[_], _], U] provides a context that accepts a configuration and gives us an F[IO, U] this gives us the flexibility of defining a monadic function that yields FS2 streams of IO and U as emitted values (e.g. Stream[IO, U], Sink[IO, U])
- final case class RecentStatistics(statusCounts: List[(String, Int)], mostDeployed: List[(String, Int)], leastDeployed: List[(String, Int)]) extends Product with Serializable
- final case class RuntimeSummary(deployment: DeploymentSummary, health: List[HealthStatus], currentStatus: DeploymentStatus, expiresAt: Instant) extends Product with Serializable
- final case class StackSummary(namespace: Namespace, deployment: Deployment, statuses: List[(DeploymentStatus, Option[String], Instant)], expiration: Instant, inboundDependencies: Vector[(RoutePath, RoutingNode)], outboundDependencies: Vector[(RoutePath, RoutingNode)]) extends Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def commit(un: UnitName, v: Version, ns: NamespaceName): NelsonK[Unit]
- def commit(un: UnitName, ns: NamespaceName, dcs: List[Datacenter], m: @@[Manifest, Versioned]): NelsonK[Unit]
- def commitLoadbalancer(name: String, v: Int, dcName: DatacenterRef, ns: NamespaceName): NelsonK[Unit]
-
val
config: NelsonK[NelsonConfig]
- Attributes
- protected
- def createBlueprint(name: String, description: Option[String], sha: Sha256, template: String): NelsonK[Option[Blueprint]]
-
def
createDatacenters(list: List[Datacenter]): NelsonK[Unit]
This is a bootstrapping function - definitions of datacenters come from the Nelson configuration, and the database is a read-only reference of that, simply so we can provide forigen key constraints when doing queries.
This is a bootstrapping function - definitions of datacenters come from the Nelson configuration, and the database is a read-only reference of that, simply so we can provide forigen key constraints when doing queries.
This function should only ever be called at bootup.
- def createDefaultNamespaceIfAbsent(dcs: List[Datacenter], ns: NamespaceName): NelsonK[Unit]
-
def
createHook(session: Session, slug: Slug): NelsonK[Repo]
Actually setup the webhook both in the nelson database, and also on the remote github repository.
Actually setup the webhook both in the nelson database, and also on the remote github repository. The user must have admin privileges on the repo for this to successfully work.
-
def
createManualDeployment(s: Session, m: ManualDeployment): NelsonK[GUID]
Create a manual deployment.
Create a manual deployment. That is to say, let Nelson know about something that was not deployed via Nelson (e.g. databases and other ops-infrastructure)
-
def
createSessionFromGithubToken(githubToken: AccessToken): NelsonK[Session]
Given a users Github personal access token - obtained either directly by user input, or via the OAtuh web flow - and lift it into a Github session.
Given a users Github personal access token - obtained either directly by user input, or via the OAtuh web flow - and lift it into a Github session. This function is distinct from
createSessionFromOAuthCode
because we require a way for non-web clients to obtain a token they can use when calling the Nelson API programatically. -
def
createSessionFromOAuthCode(code: TempoaryAccessCode): NelsonK[Session]
Create a Nelson session based on the web-flow Github provides.
Create a Nelson session based on the web-flow Github provides. The AccessToken is an opaque, one-time code used to obtain the github token for the user who is currently logged in. This function will only ever work in an OAuth web-flow, as TempoaryAccessCode tokens cannot be obtained apiori or out of band.
-
def
deleteHook(session: Session, slug: Slug): NelsonK[Unit]
Remove the webhook from the repository.
- def deleteLoadbalancerDeployment(guid: GUID): NelsonK[Unit]
- def deploy(actions: List[Action]): NelsonK[Unit]
-
def
deprecateService(sn: ServiceName): NelsonK[Unit]
Deprecates all deloyments for a service / feature version accross all datacenters and namepaces
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
expireService(sn: ServiceName): NelsonK[Unit]
Expires all deloyments for a service accross all datacenters and namepaces
- def fetchBlueprint(name: String, revision: Revision): NelsonK[Option[Blueprint]]
-
def
fetchDatacenterByName(name: String): NelsonK[Option[(Datacenter, Set[Namespace])]]
Fetch a specific datacenter based on its name, along with the namespaces that are avalible in that specific datacenter (if any).
- def fetchDeployment(guid: GUID): NelsonK[Option[StackSummary]]
-
def
fetchDeploymentStatuses(guid: GUID): NelsonK[List[(DeploymentStatus, Option[String], Instant)]]
Given a deployment GUID, list the deployment statuses
- def fetchLoadbalancerDeployment(guid: GUID): NelsonK[Option[LoadbalancerSummary]]
- def fetchRawRepoManifest(token: AccessToken)(slug: Slug, ref: Reference = Github.Branch("master")): NelsonK[String]
-
def
fetchRepoManifestAndValidateDeployable(slug: Slug, ref: Reference = Github.Branch("master")): NelsonK[ValidatedNel[NelsonError, Manifest]]
Actually reach out to the repository in question using the github content API and fetch the manifest file, if it exists.
Actually reach out to the repository in question using the github content API and fetch the manifest file, if it exists.
This function ensures that the file exists, that its content can be loaded into a Manifest instance, and validates that it cab be deployed
Anything else is just not cricket.
- def fetchWorkflowLog(guid: GUID, offset: Int): NelsonK[Option[(Int, List[String])]]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def findDeploymentExpiration(guid: GUID): NelsonK[Option[Instant]]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDeploymentsByDatacenter(dc: Datacenter, f: (Namespace) ⇒ StoreOpF[List[Deployment]]): StoreOpF[Set[Deployment]]
- def getLoadbalancerByGUID(guid: GUID): NelsonK[Option[LoadbalancerDeployment]]
- def getOrCreateNamespace(dc: DatacenterRef, ns: NamespaceName): StoreOpF[ID]
-
def
getRelease(id: Long): NelsonK[SortedMap[Released, List[ReleasedDeployment]]]
Given the ID of a particular release, show the release information and any associated deployments
-
def
getRoutingGraphs(dc: DatacenterRef, ns: List[NamespaceName]): NelsonK[List[(Namespace, RoutingGraph)]]
Gets routing graphs for a given datacenter and list of namespaces.
Gets routing graphs for a given datacenter and list of namespaces. If namespaces is not provided then default to all namespaces
- def getRuntimeSummary(guid: GUID): NelsonK[Option[RuntimeSummary]]
-
def
getStatusOfReleaseUnit(s: Slug, u: UnitName): NelsonK[Option[DeploymentStatus]]
Given a repo slug and a specific unit, figure out what the state of the latest released version is, for the specified unit only.
Given a repo slug and a specific unit, figure out what the state of the latest released version is, for the specified unit only. This is primarily used to power the SVG badging.
TIM: REALLY NEEDS CACHING TO SCALE; *PROBALLY* TOO EXPENSIVE RIGHT NOW.
- def getVersionedManifestForRelease(r: Released): NelsonK[@@[Manifest, Versioned]]
-
def
handleDeployment(e: DeploymentEvent): NelsonK[Unit]
Invoked when the inbound webhook from Github arrives, notifying Nelson that a new deployment needs to take place.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
lift[F[_[_], _], U](f: (NelsonConfig) ⇒ F[IO, U]): Kleisli[[β$1$]F[IO, β$1$], NelsonConfig, U]
a simple lift operation for easy construction of a NelsonFK
- def listAuditEvents(limit: Long, offset: Long, releaseId: Option[Long], action: Option[String], category: Option[String]): NelsonK[List[AuditLog]]
- def listBlueprints: NelsonK[List[Blueprint]]
-
def
listDatacenterDeployments(dcName: String, ns: NonEmptyList[NamespaceName], status: NonEmptyList[DeploymentStatus], unit: Option[UnitName]): NelsonK[List[(Namespace, Deployment, DeploymentStatus)]]
Given a specific datacenter and a list of namespaces figure out deployments by DeploymentStatus.
Given a specific datacenter and a list of namespaces figure out deployments by DeploymentStatus. TIM: this probally wont scale, but its likley ok for the moment.
- def listDatacenterUnitsByStatus(dc: String, ns: NonEmptyList[NamespaceName], status: NonEmptyList[DeploymentStatus]): NelsonK[List[(Namespace, GUID, ServiceName)]]
-
def
listDatacenters(implicit ec: ExecutionContext): NelsonK[Map[Datacenter, Set[Namespace]]]
List all the datacenters Nelson is currently aware of, and return the namespaces associated with that datacenter.
- def listDeployments(dcs: List[String], ns: NonEmptyList[NamespaceName], status: NonEmptyList[DeploymentStatus], unit: Option[UnitName]): NelsonK[List[(DatacenterRef, Namespace, Deployment, DeploymentStatus)]]
-
def
listDeploymentsWithDeprecatedDependencies(dc: Datacenter): NelsonK[Vector[DependencyEdge]]
Like listDeploymentsWithDeprecatedDependencies but for a single Datacenter
-
def
listDeploymentsWithDeprecatedDependencies: NelsonK[Vector[DependencyEdge]]
Lists all deployments accross datacenters and namspaces that depend on a deployment that is deprecated.
- def listLoadbalancerDeployments(dc: DatacenterRef, ns: NonEmptyList[NamespaceName]): NelsonK[List[(Namespace, LoadbalancerDeployment)]]
- def listLoadbalancers(dcs: List[String], ns: NonEmptyList[NamespaceName]): NelsonK[List[(DatacenterRef, Namespace, LoadbalancerDeployment)]]
-
def
listReleases(limit: Option[Int]): NelsonK[SortedMap[Released, List[ReleasedDeployment]]]
list recent releases, regardless of repository.
-
def
listRepositories(session: Session, owner: Option[String]): NelsonK[List[Repo]]
- Annotations
- @SuppressWarnings()
-
def
listRepositoryReleases(s: Slug): NelsonK[SortedMap[Released, List[ReleasedDeployment]]]
list releases this repository has had.
- def listUnitsByStatus(dcs: List[DatacenterRef], ns: NonEmptyList[NamespaceName], status: NonEmptyList[DeploymentStatus]): NelsonK[List[(DatacenterRef, Namespace, GUID, ServiceName)]]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def proofBlueprint(templateContent: String): NelsonK[String]
-
def
recentActivityStatistics: NelsonK[RecentStatistics]
Fetches statistics about what happened over the last N days, where
N
is defined by thewhence
instance ofjava.time.Instant
. - def recursiveCreateNamespace(dc: DatacenterRef, ns: NamespaceName): NelsonK[Unit]
- def recursiveCreateSubordinateNamespace(dc: DatacenterRef, ns: NamespaceName): NelsonK[Unit]
- def redeploy(deploymentGuid: GUID): NelsonK[Unit]
- def reverseTrafficShift(guid: GUID): NelsonK[TrafficShift]
- def storeManifest(m: @@[Manifest, Versioned], repoId: ID): NelsonK[Unit]
-
def
syncRepos(session: Session): NelsonK[Unit]
Given a session, sync up the users repositories to nelson to make sure we have the latest set of repos and their associated access.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )