Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #3904] feature - operate instance's metadata alonely #3912

Merged
merged 22 commits into from
Oct 19, 2020

Conversation

horizonzy
Copy link
Collaborator

What is the purpose of the change

#3904

@KomachiSion
Copy link
Collaborator

@horizonzy I think the API can be move to InstanceController
@chuntaojun What's your think about?

@horizonzy
Copy link
Collaborator Author

@horizonzy I think the API can be move to InstanceController

it should be move to InstanceController

@horizonzy
Copy link
Collaborator Author

horizonzy commented Sep 28, 2020

update demo:
curl -X PUT 'http://localhost:8848/nacos/v1/ns/instance/metadata/batch?namespaceId=public' -d 'metadata={"age":"20","name":"cocolan"}&namespace=public&serviceName=xxxx@@xxxx&instances=[{"ip":"3.3.3.3","port": "8080","ephemeral":"true","clusterName":"xxxx-cluster"},{"ip":"2.2.2.2","port":"8080","ephemeral":"true","clusterName":"xxxx-cluster"}]'
or
curl -X PUT 'http://localhost:8848/nacos/v1/ns/instance/metadata/batch?namespaceId=public' -d 'metadata={"age":"20","name":"cocolan"}&namespace=public&serviceName=xxxx@@xxxx&consistencyType=ephemeral'

the result:
{"updated":["2.2.2.2:8080:unknown:xxxx-cluster:ephemeral","3.3.3.3:8080:unknown:xxxx-cluster:ephemeral"]}

@horizonzy
Copy link
Collaborator Author

horizonzy commented Sep 28, 2020

delete demo:
curl -X DELETE 'http://localhost:8848/nacos/v1/ns/instance/metadata/batch?namespaceId=public' -d 'metadata={"age":"20","name":"cocolan"}&namespace=public&serviceName=xxxx@@xxxx&instances=[{"ip":"3.3.3.3","port": "8080","ephemeral":"true","clusterName":"xxxx-cluster"},{"ip":"2.2.2.2","port":"8080","ephemeral":"true","clusterName":"xxxx-cluster"}]'
or
curl -X DELETE 'http://localhost:8848/nacos/v1/ns/instance/metadata/batch?namespaceId=public' -d 'metadata={"age":"20","name":"cocolan"}&namespace=public&serviceName=xxxx@@xxxx&consistencyType=ephemeral'

the result:
{"updated":["2.2.2.2:8080:unknown:xxxx-cluster:ephemeral","3.3.3.3:8080:unknown:xxxx-cluster:ephemeral"]}

2.move Map operation from NamingUtils to MapUtils
2. modify the batch operate http param. just support (1 services : n instance)
2.fix client params not set instances bug
2.remove moditfy property method in InstanceOperationContext and InstanceOperationInfo, it just defined by constructor.
chuntaojun
chuntaojun previously approved these changes Oct 2, 2020
@chuntaojun
Copy link
Collaborator

最后补一个集成测试吧,总体应该可以先merge

KomachiSion
KomachiSion previously approved these changes Oct 12, 2020
@KomachiSion
Copy link
Collaborator

@horizonzy
Copy link
Collaborator Author

@KomachiSion KomachiSion added the kind/feature type/feature label Oct 12, 2020
@KomachiSion KomachiSion added this to the 1.4.0 milestone Oct 12, 2020
@KomachiSion KomachiSion merged commit 1898ddc into alibaba:develop Oct 19, 2020
WesleyOne pushed a commit to WesleyOne/nacos that referenced this pull request Oct 20, 2020
…libaba#3912)

* feature. add update and delete operation on instance's metadata 90%

* 1.add unit test
2.fix-locateInstance error

* format code style

* add @link on class

* move metadata operate to InstanceController.

* format code 50%

* complete bacth operation of metadata

* remove unnecessary test unit

* modify the variable name

* perfect log info

* modify consumer's dto to match it's description

* 1.rename class OperationContext -> InstanceOperationContext
2.move Map operation from NamingUtils to MapUtils

* check datum is null

* code refactor.

* 1. code refactor
2. modify the batch operate http param. just support (1 services : n instance)

* 1.set default clusterName if instance not set
2.fix client params not set instances bug

* npe fix

* 1.remove consistencyType *, just support ephemeral or persist.
2.remove moditfy property method in InstanceOperationContext and InstanceOperationInfo, it just defined by constructor.

* add instance controller test

* fix code too length

* update the param name

* add feature's version of start
loveincode added a commit to Framework-Source-Code/nacos that referenced this pull request Oct 21, 2020
* 'develop' of github.com:alibaba/nacos: (678 commits)
  Fix integration test error
  Fix unit test error in ci
  For checkStyle
  Modify the startup script custom configuration first default configuration (alibaba#4021)
  Revert "Naming module Raft protocol migration"
  [ISSUE alibaba#3904] feature - operate instance's metadata alonely (alibaba#3912)
  For alibaba#3710#, Fix special characters cannot be used in Metadata (alibaba#4019)
  [ISSUE-alibaba#3855] Provided a feature to view version comparisons in the configDetails page (alibaba#3988)
  Refactor dispatch task execute (alibaba#3995)
  Revert "for alibaba#3621 (alibaba#3668)" (alibaba#3999)
  Naming module Raft protocol migration (alibaba#3989)
  refactor: code refactor
  [ISSUE alibaba#3576] [Enhancement] Adding the destroy lifecycle method on NamingMaintainService (alibaba#3985)
  Fix issue 2866 (alibaba#3984)
  For alibaba#3384, Fix member extend info do not update error. (alibaba#3982)
  Fix#3973 (alibaba#3974)
  Move remove listener logic to ServiceManager
  Move remove listener logic to ServiceManager
  1.fix unit test can't pass (alibaba#3956)
  [ISSUE alibaba#3909] add domain's judgement (alibaba#3913)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature type/feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants