Learn and Be Curious

API Connect

Cloud/Bluemix2017. 4. 5. 18:00

| | | `-- ansi-regex@2.0.0
| | +-- strip-ansi@3.0.1
| | | `-- ansi-regex@2.0.0
| | `-- supports-color@2.0.0
| +-- cli-table@0.3.1
| | `-- colors@1.0.3
| +-- cvss@1.0.1
| +-- https-proxy-agent@1.0.0
| | +-- agent-base@2.0.1
| | | `-- semver@5.0.3
| | +-- debug@2.2.0
| | | `-- ms@0.7.1
| | `-- extend@3.0.0
| +-- joi@6.10.1
| | +-- hoek@2.16.3
| | +-- isemail@1.2.0
| | +-- moment@2.12.0
| | `-- topo@1.1.0
| +-- nodesecurity-npm-utils@5.0.0
| +-- path-is-absolute@1.0.0
| +-- rc@1.1.6
| | +-- deep-extend@0.4.1
| | +-- ini@1.3.4
| | +-- minimist@1.2.0
| | `-- strip-json-comments@1.0.4
| +-- semver@5.1.0
| +-- subcommand@2.0.3
| | +-- cliclopts@1.1.1
| | +-- debug@2.2.0
| | | `-- ms@0.7.1
| | +-- minimist@1.2.0
| | `-- xtend@4.0.1
| `-- wreck@6.3.0
|   +-- boom@2.10.1
|   `-- hoek@2.16.3
+-- serve-favicon@2.4.2
| +-- etag@1.8.0
| +-- fresh@0.5.0
| +-- ms@1.0.0
| `-- parseurl@1.3.1
`-- strong-error-handler@1.2.1
  +-- http-status@0.2.5
  `-- js2xmlparser@2.0.2
    `-- xmlcreate@0.1.1

하위 프로세스 npm install이(가) 코드 0(으)로 종료되었습니다.

swagger 및 제품 정의 업데이트 중
C:\Users\SDS\pgintegration\definitions\pgintegration.yaml swagger 설명 작성됨
pgintegration-product.yaml 제품 정의 작성됨[pgintegration:1.0.0]

다음 단계:

  앱에 대한 디렉토리 변경
    $ cd C:\Users\SDS\pgintegration

  앱에서 모델 작성
    $ apic create --type model

  API를 작성하고, API Connect를 사용하여 이를 실행, 관리, 적용 및 배치합니다.
    $ apic edit

  앱 실행
    $ apic start


C:\Users\SDS>cd pgintegration

C:\Users\SDS\pgintegration>apic edit

The user model "User" is attached to an application that does not specify
whether other sessions should be invalidated when a password or
an email has changed. Session invalidation is important for security
reasons as it allows users to recover from various account breach
situations.

We recommend turning this feature on by setting
"logoutSessionsOnSensitiveChanges" to true in
server/config.json (unless you have implemented your own solution
for token invalidation).

We also recommend enabling "injectOptionsFromRemoteContext" in
User's settings (typically via common/models/*.json file).
This setting is required for the invalidation algorithm to keep
the current session valid.

Express server listening on http://127.0.0.1:9000
loopback deprecated loopback#context middleware is deprecated. See https://docs.strongloop.com/display/APIC/Using%20current%20context for more details
. ..\AppData\Roaming\npm\node_modules\apiconnect\node_modules\loopback\server\middleware\rest.js:60:32

swagger 및 제품 정의 업데이트 중
C:\Users\SDS\pgintegration\definitions\pgintegration.yaml swagger 설명 작성됨

swagger 및 제품 정의 업데이트 중
C:\Users\SDS\pgintegration\definitions\pgintegration.yaml swagger 설명 작성됨
^C일괄 작업을 끝내시겠습니까 (Y/N)? y

C:\Users\SDS\pgintegration>apic start
pgintegration-gw이(가) 제한시간 내에 포트를 리턴하지 않았습니다.
Error: 서비스 pgintegration-gw이(가) 시작되었지만 제한시간 내에 초기화되지 않았습니다. 로그 버퍼 덤핑 중입니다.
2017-04-05T07:59:26.569Z pid:1624 worker:0 INFO strong-agent native addon missing, install a compiler
2017-04-05T07:59:26.573Z pid:1624 worker:0 INFO strong-agent v2.1.2 profiling app 'microgateway' pid '1624'
2017-04-05T07:59:26.576Z pid:1624 worker:0 INFO strong-agent[1624] started profiling agent
2017-04-05T07:59:26.577Z pid:1624 worker:0 INFO supervisor starting (pid 1624)
2017-04-05T07:59:26.584Z pid:1624 worker:0 INFO strong-agent strong-agent using strong-cluster-control v2.2.3
2017-04-05T07:59:26.586Z pid:1624 worker:0 INFO supervisor reporting metrics to `internal:`
2017-04-05T07:59:26.719Z pid:1624 worker:0 INFO strong-agent not profiling, agent metrics requires a valid license.
2017-04-05T07:59:26.719Z pid:1624 worker:0 Please contact sales@strongloop.com for assistance.
2017-04-05T07:59:26.721Z pid:1624 worker:0 INFO supervisor size set to 1
2017-04-05T07:59:27.990Z pid:1624 worker:0 INFO supervisor started worker 1 (pid 16452)
2017-04-05T07:59:27.991Z pid:1624 worker:0 INFO supervisor resized to 1
2017-04-05T07:59:28.627Z pid:16452 worker:1 INFO strong-agent native addon missing, install a compiler
2017-04-05T07:59:28.628Z pid:16452 worker:1 INFO strong-agent v2.1.2 profiling app 'microgateway' pid '16452'
2017-04-05T07:59:28.632Z pid:16452 worker:1 INFO strong-agent[16452] started profiling agent
2017-04-05T07:59:29.097Z pid:16452 worker:1 Error: Fail to load environment variables:  { Error: ENOENT: no such file or directory, open 'C:\Users\SDS
\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgateway\env.yaml'
2017-04-05T07:59:29.097Z pid:16452 worker:1     at Error (native)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Object.fs.openSync (fs.js:640:18)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Object.fs.readFileSync (fs.js:508:33)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Function.Utils.getStringFromFile (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_mod
ules\yamljs\lib\Utils.js:271:19)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Function.Yaml.parseFile (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\yaml
js\lib\Yaml.js:46:21)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Function.Yaml.load (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\yamljs\li
b\Yaml.js:89:17)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Object.<anonymous> (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgate
way\index.js:18:22)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Module._compile (module.js:570:32)
2017-04-05T07:59:29.098Z pid:16452 worker:1     at Object.Module._extensions..js (module.js:579:10)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Module.load (module.js:487:32)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at tryModuleLoad (module.js:446:12)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Function.Module._load (module.js:438:3)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Object.<anonymous> (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\strong-su
pervisor\bin\sl-run.js:77:19)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Module._compile (module.js:570:32)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Object.Module._extensions..js (module.js:579:10)
2017-04-05T07:59:29.099Z pid:16452 worker:1     at Module.load (module.js:487:32)
2017-04-05T07:59:29.099Z pid:16452 worker:1   errno: -4058,
2017-04-05T07:59:29.099Z pid:16452 worker:1   code: 'ENOENT',
2017-04-05T07:59:29.100Z pid:16452 worker:1   syscall: 'open',
2017-04-05T07:59:29.100Z pid:16452 worker:1   path: 'C:\\Users\\SDS\\AppData\\Roaming\\npm\\node_modules\\apiconnect\\node_modules\\microgateway\\env.
yaml' }
2017-04-05T07:59:38.162Z pid:16452 worker:1 Error: not able to perform the handshake with APIM, error: Error: can not load default private key
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Object.exports.handshakeWithAPIm (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_mod
ules\microgateway\utils\utils.js:192:14)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at performHandshake (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgatewa
y\lib\analytics.js:251:9)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at sendAnalytics (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgateway\l
ib\analytics.js:49:3)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Object.<anonymous> (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgate
way\lib\microgw.js:37:9)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Module._compile (module.js:570:32)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Object.Module._extensions..js (module.js:579:10)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Module.load (module.js:487:32)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at tryModuleLoad (module.js:446:12)
2017-04-05T07:59:38.162Z pid:16452 worker:1     at Function.Module._load (module.js:438:3)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Module.require (module.js:497:17)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Module.module.__proto__.require (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modu
les\strong-agent\lib\agent.js:183:42)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at require (internal/module.js:20:19)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Object.<anonymous> (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\microgate
way\index.js:35:1)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Module._compile (module.js:570:32)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Object.Module._extensions..js (module.js:579:10)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Module.load (module.js:487:32)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at tryModuleLoad (module.js:446:12)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Function.Module._load (module.js:438:3)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Object.<anonymous> (C:\Users\SDS\AppData\Roaming\npm\node_modules\apiconnect\node_modules\strong-su
pervisor\bin\sl-run.js:77:19)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Module._compile (module.js:570:32)
2017-04-05T07:59:38.163Z pid:16452 worker:1     at Object.Module._extensions..js (module.js:579:10)
2017-04-05T07:59:38.164Z pid:16452 worker:1     at Module.load (module.js:487:32)
2017-04-05T07:59:38.389Z pid:16452 worker:1 INFO strong-agent not profiling, agent metrics requires a valid license.
2017-04-05T07:59:38.391Z pid:16452 worker:1 Please contact sales@strongloop.com for assistance.


C:\Users\SDS\pgintegration>apic start
pgintegration 서비스가 시작됨  포트 4001에서
pgintegration-gw 서비스가 시작됨  포트 4002에서



C:\Users\SDS>curl -s http://localhost:4001/api/users | python -m json.tool
[
    {
        "name": "                    ",
        "password": ""
    },
    {
        "name": "1                   ",
        "password": "1"
    },
    {
        "name": "asd                 ",
        "password": "asd"
    },
    {
        "name": "myung               ",
        "password": "12345"
    },
    {
        "name": "myung2              ",
        "password": "123qwe"
    },
    {
        "name": "myung3              ",
        "password": "123qwe"
    },
    {
        "name": "myung5              ",
        "password": "123qwe"
    },
    {
        "name": "myung7              ",
        "password": "123qwe"
    },
    {
        "name": "vbudi               ",
        "password": "passw0rd"
    }
]

C:\Users\SDS>curl -s http://localhost:4001/api/todos | python -m json.tool
[
    {
        "category": "PERSONAL            ",
        "description": "Initial todo list",
        "id": 1,
        "name": "vbudi               "
    },
    {
        "category": "PERSONAL            ",
        "description": "More todo items",
        "id": 2,
        "name": "vbudi               "
    },
    {
        "category": "asd                 ",
        "description": "asd",
        "id": 1,
        "name": "asd                 "
    }
]

C:\Users\SDS>apic stop


C:\Users\SDS>apic login
API Connect 서버 입력
? Server: us.apiconnect.ibmcloud.com
us.apiconnect.ibmcloud.com에 로그인됨






C:\Users\SDS\pgintegration>apic config:set catalog=apic-catalog://us.apiconnect.ibmcloud.com/orgs/jesangmyung-test/catalogs/sb
catalog: apic-catalog://us.apiconnect.ibmcloud.com/orgs/jesangmyung-test/catalogs/sb



C:\Users\SDS\pgintegration\definitions>apic publish pgintegration-product.yaml
jesangmyung-test:sb에 pgintegration-product.yaml 스테이징[pgintegration:1.0.0]
pgintegration-product.yaml을(를) jesangmyung-test:sb에 공개함[pgintegration:1.0.0]

C:\Users\SDS\pgintegration\definitions>

'Cloud > Bluemix' 카테고리의 다른 글

Cloud Tranformation Master Planning  (0) 2017.04.06
bluemix에 faro oracle 이미지 올리기  (0) 2017.04.06
Faro test  (0) 2017.04.05
TLS  (0) 2017.04.04
3-2 webinar  (0) 2017.04.04