Implement Keystone environment deployments
This commit is contained in:
@@ -44,14 +44,9 @@ class Server extends Model
|
||||
return $this->hasMany(Service::class);
|
||||
}
|
||||
|
||||
public function instances(): HasMany
|
||||
public function serviceReplicas(): HasMany
|
||||
{
|
||||
return $this->hasMany(Instance::class);
|
||||
}
|
||||
|
||||
public function applications(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Application::class, Instance::class);
|
||||
return $this->hasMany(ServiceReplica::class);
|
||||
}
|
||||
|
||||
public function firewallRules(): HasMany
|
||||
@@ -64,26 +59,16 @@ class Server extends Model
|
||||
return $this->belongsTo(Provider::class);
|
||||
}
|
||||
|
||||
public function serviceDeployments(): HasManyThrough
|
||||
public function serviceOperations(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(
|
||||
Deployment::class,
|
||||
Operation::class,
|
||||
Service::class,
|
||||
'server_id',
|
||||
'target_id',
|
||||
)->where('target_type', (new Service)->getMorphClass());
|
||||
}
|
||||
|
||||
public function applicationDeployments(): HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(
|
||||
Deployment::class,
|
||||
Application::class,
|
||||
'server_id',
|
||||
'target_id',
|
||||
)->where('target_type', (new Application)->getMorphClass());
|
||||
}
|
||||
|
||||
public function sshClient(string $user = 'root'): Ssh
|
||||
{
|
||||
return Ssh::create($user, $this->ipv4)
|
||||
|
||||
Reference in New Issue
Block a user