Class: NexusAPI::ParameterBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/utilities/parameter_builder.rb

Constant Summary collapse

ALLOW =

Write Policies

'ALLOW'
ALLOW_ONCE =
'ALLOW_ONCE'
DENY =
'DENY'
RELEASE =

Version Policy

'RELEASE'
SNAPSHOT =
'SNAPSHOT'
MIXED =
'MIXED'
STRICT =

Layout or Deploy Policy

'STRICT'
PERMISSIVE =
'PERMISSIVE'

Class Method Summary collapse

Class Method Details

.docker_hosted(name, port, write_policy: ALLOW_ONCE) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/utilities/parameter_builder.rb', line 17

def self.docker_hosted(name, port, write_policy: ALLOW_ONCE)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    },
    'docker' => {
      'v1Enabled' => false,
      'forceBasicAuth' => true,
      'httpPort' => port
    }
  }
end

.maven_hosted(name, write_policy: ALLOW_ONCE, version_policy: RELEASE, layout_policy: STRICT) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/utilities/parameter_builder.rb', line 34

def self.maven_hosted(name, write_policy: ALLOW_ONCE, version_policy: RELEASE, layout_policy: STRICT)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    },
    'maven' => {
      'versionPolicy' => version_policy,
      'layoutPolicy' => layout_policy
    }
  }
end

.npm_hosted(name, write_policy: ALLOW_ONCE) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/utilities/parameter_builder.rb', line 50

def self.npm_hosted(name, write_policy: ALLOW_ONCE)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    }
  }
end

.pypi_hosted(name, write_policy: ALLOW_ONCE) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/utilities/parameter_builder.rb', line 62

def self.pypi_hosted(name, write_policy: ALLOW_ONCE)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    }
  }
end

.raw_hosted(name, write_policy: ALLOW_ONCE) ⇒ Object



74
75
76
77
78
79
80
81
82
83
84
# File 'lib/utilities/parameter_builder.rb', line 74

def self.raw_hosted(name, write_policy: ALLOW_ONCE)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    }
  }
end

.rubygems_hosted(name, write_policy: ALLOW_ONCE) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
# File 'lib/utilities/parameter_builder.rb', line 86

def self.rubygems_hosted(name, write_policy: ALLOW_ONCE)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    }
  }
end

.yum_hosted(name, depth, write_policy: ALLOW_ONCE, deploy_policy: STRICT) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/utilities/parameter_builder.rb', line 98

def self.yum_hosted(name, depth, write_policy: ALLOW_ONCE, deploy_policy: STRICT)
  {
    'name' => name,
    'online' => true,
    'storage' => {
      'blobStoreName' => 'default',
      'strictContentTypeValidation' => true,
      'writePolicy' => write_policy
    },
    'yum' => {
      'repodataDepth' => depth,
      'deployPolicy' => deploy_policy
    }
  }
end